Commit graph typescript-sdk/src/server
Author SHA1 Message Date
Glen Maddern
4b2ad0385d
Adding invalidateCredentials() to OAuthClientProvider (#570)
Co-authored-by: Paul Carleton <paulc@anthropic.com>
2025-07-14 17:11:52 +01:00
Christian Daguerre
cc9ea7fd21
make client side client_id generation configurable in the oauth router (#734) 2025-07-14 17:07:50 +01:00
Daniel Kelleher
5b99c24bda
Add OIDC ID token support (#680) 2025-07-14 12:22:04 +00:00
Jerome
11e84f0471
Merge pull request #751 from modelcontextprotocol/jerome/fix/allow-async-onsession-callbacks
feat: support async callbacks for onsessioninitialized and onsessionclosed
2025-07-09 21:04:15 +01:00
Christian Bromann
8714f21541
fix(server): validate expiresAt token value for non existence (#446)
* fix(server): validate expiresAt token value for non existence

---------

Co-authored-by: Olivier Chafik <ochafik@anthropic.com>
2025-07-09 15:43:33 +01:00
Jerome
0ddf6827b6
feat: support async callbacks for onsessioninitialized and onsessionclosed
Updated StreamableHTTPServerTransport to support both sync and async callbacks:
- Changed callback types to return void | Promise<void>
- Used await Promise.resolve() to handle both sync and async callbacks
- Added comprehensive tests for async callback functionality
- Errors in callbacks now properly propagate to HTTP responses

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 14:48:40 +01:00
Jerome
61052b1fa8
Add comprehensive tests for onsessionclosed callback in StreamableHTTPServerTransport
• Tests callback is called when session is closed via DELETE
• Tests system works correctly when callback is not provided
• Tests callback is not called for invalid session DELETE requests
• Tests correct session ID is passed when multiple sessions exist
• Follows existing test patterns and includes proper cleanup

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-07 15:19:40 +01:00
Jerome
52e22ad7cb
Refactor ondelete hook to onsessionclosed in StreamableHTTPServerTransport
- Renamed ondelete callback to onsessionclosed for better clarity
- Moved callback from public property to private field following options pattern
- Added comprehensive JSDoc documentation explaining the callback's purpose
- Updated DELETE request handler to use the new callback structure

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-07 14:57:41 +01:00
Jerome
afb8971569
Add ondelete hook to StreamableHTTPServerTransport
Adds optional ondelete callback that fires when DELETE request is received, providing the sessionId for cleanup handling.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-07 14:44:35 +01:00
bhosmer-ant
9879d7a98e
Merge pull request #725 from sushichan044/revert-670-feat/structured-content-with-type-safety
Revert "fix: add type safety for tool output schemas in ToolCallback"
2025-07-03 17:03:31 -04:00
ihrpr
25048b9eaf
rename reject to decline 2025-07-03 15:51:16 +01:00
Kentaro Suzuki
a45e4febd9
Revert "fix: add type safety for tool output schemas in ToolCallback" 2025-07-03 22:13:24 +09:00
bhosmer-ant
a40b353fb6
Merge branch 'main' into feat/structured-content-with-type-safety 2025-06-30 10:08:09 -04:00
Inna Harper
7682c4cf4f
Merge pull request #598 from sinedied/fix-empty-schema
fix: missing "properties" property in empty schema
2025-06-30 13:20:42 +01:00
Inna Harper
99c75281bd
Merge pull request #661 from kentcdodds/resource-types
add overloads for registerResource method in McpServer class
2025-06-27 17:05:01 +01:00
ihrpr
53ad0a01d5
fix lint 2025-06-27 14:14:21 +01:00
David Dworken
8bc7374f5e
Fix merge conflict 2025-06-26 16:12:26 -07:00
David Dworken
185fb23f34
Merge branch 'main' into main 2025-06-26 16:10:00 -07:00
Christian Bromann
f76652bb10
Update src/server/sse.test.ts 2025-06-26 10:22:27 -07:00
Christian Bromann
08c767f8e1
Merge branch 'main' into cb/sse-tests 2025-06-26 09:50:41 -07:00
Konstantin Konstantinov
606c278668
clean up tests - remove mockRequestInfo 2025-06-25 16:24:30 +03:00
Konstantin Konstantinov
166da76b00
extra parameter - remain optional for backwards compatibility 2025-06-24 19:39:37 +03:00
Konstantin Konstantinov
33895f4520
Merge branch 'main' into request-propagation-in-tools 2025-06-24 19:32:49 +03:00
ihrpr
33e03f499e
Merge branch 'main' into fix/skip_validate_if_error 2025-06-24 17:12:34 +01:00
ihrpr
c20a47a79f
small fixes 2025-06-24 17:09:29 +01:00
Konstantin Konstantinov
96ff8573cf
Merge branch 'main' into request-propagation-in-tools 2025-06-24 17:21:09 +03:00
sushichan044
08808a45e0
test: add type assertion to bypass type check 2025-06-20 17:24:17 +09:00
sushichan044
fc9ca5ff2e
fix: update ToolCallback type to include output arguments for better type safety 2025-06-20 16:47:53 +09:00
Ashwin Bhat
f4b8a48ded
feat: remove console statements from SDK code
- Remove all console.log, console.warn, and console.error from src/client and src/server
- Add ESLint no-console rule for client and server directories (excluding tests)
- Keep console statements in test files, examples, and CLI tools as intended

Addresses feedback in PR #665

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-19 22:36:33 -07:00
Kent C. Dodds
b293911df7 add overloads for registerResource method in McpServer class
Otherwise, TypeScript can't properly distinguish the type of callback
2025-06-18 21:56:22 -06:00
ihrpr
e7a5e331f1
rename decline to reject 2025-06-18 20:11:18 +01:00
Inna Harper
90569d885f
Merge pull request #638 from modelcontextprotocol/ochafik/auth-resource
RFC 8707 Resource Indicators Implementation
2025-06-18 17:34:37 +01:00
joeyzzeng
e76faf6a18 fix: skip validation if tool reports error 2025-06-18 21:34:42 +08:00
Olivier Chafik
3f07bdb223
shrink tests 2025-06-18 13:32:45 +01:00
Olivier Chafik
5c60c77c93
shrink diff 2025-06-18 12:09:00 +01:00
Olivier Chafik
6a01d0d4a5
shrink token.test.ts 2025-06-18 12:07:38 +01:00
Olivier Chafik
9e2a565164
minimize changes 2025-06-18 12:01:51 +01:00
Olivier Chafik
bf72f87788
cleanups 2025-06-18 11:23:09 +01:00
David Dworken
c5922f8765
Fix node 18 incompatibility caused by race condition with closing server by using a newly allocated port for each test 2025-06-17 10:07:59 -07:00
Olivier Chafik
617faccf8e
Add test for default protocol version negotiation in bearerAuth middleware
- Tests that when mcp-protocol-version header is missing, the middleware
  uses DEFAULT_NEGOTIATED_PROTOCOL_VERSION when calling verifyAccessToken
- Ensures proper fallback behavior for protocol version negotiation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 17:08:21 +01:00
Olivier Chafik
40f61d88a0
show how to enable strict resource checking in mcp server 2025-06-17 17:05:34 +01:00
Olivier Chafik
b16a415623
cleanups 2025-06-17 11:15:38 +01:00
Olivier Chafik
551a43942e
use URL for resource throughout 2025-06-17 00:33:27 +01:00
Olivier Chafik
224a2e242d
update resource to be a url 2025-06-17 00:18:33 +01:00
Olivier Chafik
02ce81b90c
simplify diff 2025-06-16 23:10:27 +01:00
Olivier Chafik
6656d23d84
Simplify demo in-memory oauth provider
Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 22:56:55 +01:00
David Dworken
188c1d3680
Merge branch 'main' into main 2025-06-16 14:08:53 -07:00
Olivier Chafik
ccccb4b7cc
simplify PR / only keep verification in demo inmemory oauth provider
Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 21:34:06 +01:00
Olivier Chafik
cba6a6ea58
Update authorize.config.test.ts
Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 20:41:56 +01:00
Olivier Chafik
1f4e42c09e
cleanup auth-utils and remove example files
Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 20:05:02 +01:00