Commit graph typescript-sdk/src/shared
Author SHA1 Message Date
Konstantin Konstantinov
db9ba7b419
raw request propagation in tools - implementation, unit tests, types 2025-06-14 01:08:02 +03:00
Itsuki
69dbfac0e4
Feat: Separate authorization server and resource server on client auth flow (#416)
* add type and schema for protected resource metadata

* add private variable to keep track of
authorization server url to avoid fetching Protected Resource Metadata every time

* change auth flow to use authroization server and
add function to discover protected resource metadata

* add/modify tests for new added auth functions

* modify test to use the authorization server

* remove unused variable

* add resource parameter when building auth url

* Change resource to use the protected resource metadata

* resolve typo.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* Update src/client/sse.ts import.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* remove log.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* Update section title.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* remove log.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* remove resource parameter.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* remove resource parameter.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* remove resource parameter.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* remove resource parameter.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* remove resource parameter.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* remove resource parameter.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* remove resource parameter.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* remove resource parameter.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* remove resource parameter.

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>

* make backwards compatibile

* s/resourceServerUrl/serverUrl/g for backwards compat

* fix test comment

---------

Co-authored-by: itsuki <itsuki.enjyoy@gmail.com>
Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>
Co-authored-by: Paul Carleton <paulc@anthropic.com>
2025-05-21 14:55:38 +01:00
Paul Carleton
ac1b80a331
feat: Add support for separate Authorization Server / Resource server in server flow (spec: DRAFT-2025-v2) (#503)
* add support for .oauth-protected-resource metadata endpoint and www-authenticate

* test and types

* thread throughs scopes

* have example separate AS and RS

* make inmemory explicitly demo

* fix type

* fix types

* fix client example

* fixup comments

* refactor metadata endpoints to cleanup

* almost working w/ forwarding

* separate AS/RS working

* add to readme

* de-async the auth server setup for happier top level flow

* add test for new router

* fix test

* remove redundant comment

* clarify comment

* remove more unused endpoints

* simplify router

* slim down

* simplify verifier, and fix router test

* fix doc string
2025-05-21 13:13:34 +01:00
Basil Hosmer
d37de9b110
Add support for message field in progress notifications
Implements the new optional message field for progress notifications as
defined in the MCP specification update. This allows servers to provide
descriptive status updates alongside progress values.

Changes:
- Add optional message field to ProgressSchema in types.ts
- Add tests for progress notifications with message field
- Update protocol tests to verify message field handling

Refs: https://github.com/modelcontextprotocol/modelcontextprotocol/pull/197

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-16 15:18:28 -04:00
Marcel Samyn
75eb1c431a Pass request _meta to request handlers extra param 2025-04-25 14:42:59 +02:00
Luca Forstner
ec23b71f4e
Pass requestId to handlers via metadata 2025-04-17 11:41:11 +02:00
ihrpr
f9f2ba4717
Merge branch 'main' into ihrpr/resume-long-running-requests 2025-04-15 22:10:58 +01:00
ihrpr
f1c5ef1a8d
apply suggested changes 2025-04-15 20:40:26 +01:00
ihrpr
1359e9fe6a
pull transport send options into own named type 2025-04-15 11:42:16 +01:00
ihrpr
7aeb67988a
improve comments 2025-04-14 09:37:19 +01:00
ihrpr
43cb015844
resume long running requst from new client 2025-04-13 21:40:15 +01:00
Allen Zhou
85e6457b84
Update protocol.ts 2025-04-12 16:47:18 -07:00
Allen Zhou
6f852a1117
Merge remote-tracking branch 'upstream/main' into request-auth-info 2025-04-12 16:41:22 -07:00
Allen Zhou
c4381b857b
Pass extra object instead of authInfo directly 2025-04-12 16:38:55 -07:00
Frédéric Barthelet
4e749dba4d Add isJSONRPCError method 2025-04-10 00:06:07 +02:00
Frédéric Barthelet
8215651552 Add helper functions to distinguish between jsonRPC message types 2025-04-09 23:45:25 +02:00
Allen Zhou
72f46d44c2
Update src/shared/transport.ts
Co-authored-by: Justin Spahr-Summers <justin@jspahrsummers.com>
2025-04-08 12:49:31 -05:00
Allen Zhou
b5b322e859
Merge branch 'main' into request-auth-info 2025-04-07 10:30:00 -07:00
ihrpr
f29cbe7e06
reject session as an array 2025-04-07 16:49:46 +01:00
ihrpr
251bb9d97d
Merge branch 'main' into ihrpr/http-streamable-server 2025-04-07 14:29:09 +01:00
ihrpr
6c1b9ba06a
remove local storage for replaying and remove support for sse connection thought get 2025-04-07 12:12:43 +01:00
Justin Spahr-Summers
44839ee01d
Merge pull request #272 from modelcontextprotocol/revert-249-main
Revert "feat: support extending McpServer with authorization"
2025-04-07 11:17:03 +01:00
Justin Spahr-Summers
b5024bf170
Merge pull request #188 from li-yechao/main
feat: expose variableNames to retrieve all parameters from UriTemplate
2025-04-07 11:16:44 +01:00
Justin Spahr-Summers
4b69f40005
Merge pull request #214 from Shchvova/fixing-for-windows
Fixing for windows terminal forcing \r\n
2025-04-07 11:10:40 +01:00
Justin Spahr-Summers
8027ae1593
Revert "feat: support extending McpServer with authorization" 2025-04-07 10:47:37 +01:00
ihrpr
873f51f4ac
Merge branch 'main' into ihrpr/http-streamable-server 2025-04-06 17:39:40 +01:00
ihrpr
bafd9e74f3
Add ways to associate related requests and notifications 2025-04-05 19:52:29 +01:00
shijun
9482d936d4
Merge branch 'main' into main 2025-04-05 11:36:43 +08:00
Allen Zhou
9aee425c38
Merge remote-tracking branch 'upstream/main' into request-auth-info 2025-04-03 10:25:28 -07:00
Cliff Hall
deb2737d0f
Merge branch 'main' into fix-reset-timeout-on-progress 2025-04-02 18:52:22 -04:00
wangshijun
3571fc353f feat: support extending McpServer with subclass 2025-04-01 12:21:08 +08:00
Vlad Svoka
b2655cdd46
Fixing for windows terminal forcing \r\n 2025-03-21 17:08:18 -07:00
Yechao Li
670d98863d
feat: add variableNames for UriTemplate 2025-03-13 15:42:20 +08:00
Allen Zhou
af025e26a7
Include AuthInfo from bearer validation in transport request handler 2025-02-28 15:20:55 -08:00
Jerome
a22092bea2
Merge branch 'main' into add-sessionid-to-context 2025-02-28 11:50:37 +00:00
Jason Victor
57f3b07bb9 docstring 2025-02-25 17:48:14 -05:00
Tuomas
d63324e34e Fix resetTimeoutOnProgress option not being checked, add test 2025-02-25 11:32:24 -06:00
Tuomas
92da5861f4 Fix resetTimeoutOnProgress option not being checked 2025-02-25 11:30:50 -06:00
Justin Spahr-Summers
5c07636405
Merge pull request #152 from Ozamatash/feature/progress-timeout-reset
Add timeout reset on progress notifications
2025-02-24 20:54:18 +00:00
Jason Victor
44c9bffa85 added session id to request handler extra data 2025-02-23 12:39:15 -05:00
Tuomas
b09240bc10 only return early from progress notification on actual timeout errors 2025-02-20 15:36:57 -06:00
Tuomas
28415d3917 Refactor progress notification timeout handling in protocol 2025-02-19 12:23:16 -06:00
Justin Spahr-Summers
1dfb9aa709
Classes for standard OAuth error types 2025-02-18 14:15:47 +00:00
Justin Spahr-Summers
76b9781c85
Use URL.canParse instead of custom isValidUrl 2025-02-18 10:33:21 +00:00
Justin Spahr-Summers
f4002e559e
Add type definition for token revocation requests 2025-02-18 09:24:51 +00:00
Tuomas
7f6c0465f5 Add timeout reset on progress notifications 2025-02-17 15:57:02 -06:00
Justin Spahr-Summers
54f643cee8
Validate redirect URIs _as_ URIs 2025-02-17 14:46:08 +00:00
Justin Spahr-Summers
6bfbd2092b
Client registration using a "store" interface 2025-02-17 13:29:51 +00:00
Justin Spahr-Summers
a0069e2341
Split full/partial client information 2025-02-17 11:41:42 +00:00
Justin Spahr-Summers
afae4212e6
Move OAuth definitions into shared, add more 2025-02-17 11:07:59 +00:00