Commit graph typescript-sdk/src/shared
Author SHA1 Message Date
Konstantin Konstantinov
43189335a3
Follow up: unify v3 and v4 zod types via describe matrix and a test helper (#1141) 2025-11-20 10:10:15 +00:00
Devin Clark
418b7f9b85
feat: zod v4 with backwards compatibility for v3.25+ (#1040) 2025-11-19 20:24:53 +00:00
Matt
7fca1f2b15
feat: url based client metadata registration (SEP 991) (#1127) 2025-11-19 16:44:53 +00:00
Nate Barbettini
4debc740a5
SEP-1036: URL Elicitation (#1105) 2025-11-18 10:53:15 +00:00
David Soria Parra
df56e35322
fix: Pass RequestInit options to auth requests (#1066)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>
2025-11-17 16:06:21 +00:00
Matt
98df118a4c
Migrate to vitest from jest (#1074)
Co-authored-by: Felix Weinberger <3823880+felixweinberger@users.noreply.github.com>
Co-authored-by: Felix Weinberger <fweinberger@anthropic.com>
2025-11-14 14:08:00 +00:00
Kent C. Dodds
29cb08071a
Implementation of SEP-986: Specify Format for Tool Names (#900)
Co-authored-by: Felix Weinberger <fweinberger@anthropic.com>
Co-authored-by: Felix Weinberger <3823880+felixweinberger@users.noreply.github.com>
2025-11-11 18:45:31 +00:00
Konstantin Konstantinov
f59996ae66
SEP-1319: Decouple Request Payloads, Remove passthrough iteration, Typecheck fixes (#1086) 2025-11-07 16:50:20 +00:00
Chip
874aa27a89
fix: Prefer the token_endpoint_auth_method response from DCR registration (#1022) 2025-10-28 11:24:46 +00:00
Frédéric Barthelet
caa25503cd
Allow empty string as valid URL in DCR workflow (#987) 2025-10-13 15:43:58 +01:00
Inna Harper
1150b1d843
run prettier (#995) 2025-10-02 18:21:00 +01:00
Paul Carleton
64f7cdd09b
restrict url schemes allowed in oauth metadata (#877)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-08-19 14:39:21 +00:00
Grimmer Kang
31acdcbb18
fix: prevent responses being sent to wrong client when multiple transports connect (#820) 2025-07-29 14:07:01 +01:00
Frédéric Barthelet
ee16173865
(fix): Update fallbackRequestHandler type to match _requestHandlers leaves type (#784) 2025-07-29 14:06:27 +01:00
Xiao Yijun
bb7cccc3ba
feat: support oidc discovery in client sdk (#652)
Co-authored-by: Paul Carleton <paulc@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-07-24 14:11:48 +01:00
Jesse
af61a086ae
feat(protocol): Debounce notifications to improve network efficiancy (#746) 2025-07-15 09:40:17 +01:00
Daniel Kelleher
5b99c24bda
Add OIDC ID token support (#680) 2025-07-14 12:22:04 +00:00
cliffhall
f383a9cb8c * In sse.test.ts
- More specific expectations in test "uses custom fetch implementation from options"

* In sse.ts
  - Import FetchLike from transport.ts

* In steramableHttp.ts
  - Import FetchLike from transport.ts
  - Export StartSSEOptions interface for testing

* In streamableHttp.test.ts
  - import StartSSEOptions from streamableHttp.ts
  - use StartSSEOptions instead of any in test "uses custom fetch implementation"

* In transport.ts
  - Add FetchLike function type
2025-07-01 14:00:56 -04:00
Inna Harper
71d309d0d8
Merge pull request #477 from nichtsam/pr/protocol-overwriting-transport-hooks
Pr/protocol overwriting transport hooks
2025-06-26 14:04:16 +01:00
Konstantin Konstantinov
924c1ce56b
Merge branch 'request-propagation-in-tools' of github.com:KKonstantinov/typescript-sdk into request-propagation-in-tools 2025-06-25 16:25:09 +03:00
Konstantin Konstantinov
606c278668
clean up tests - remove mockRequestInfo 2025-06-25 16:24:30 +03:00
Konstantin Konstantinov
384095c30b
Merge branch 'main' into request-propagation-in-tools 2025-06-25 14:16:18 +03:00
Chris Dickinson
05d98bb3a4
feat(shared/auth): support software_statement in OAuthClientMetadata (#696)
Per [Section 3.1.1][ref], `software_statement` is an OPTIONAL member
of the client creation request, which may contain a JWT encoding claims
about client software.

[ref]: https://datatracker.ietf.org/doc/html/rfc7591#section-3.1.1
2025-06-25 11:20:26 +01:00
Konstantin Konstantinov
166da76b00
extra parameter - remain optional for backwards compatibility 2025-06-24 19:39:37 +03:00
Konstantin Konstantinov
96ff8573cf
Merge branch 'main' into request-propagation-in-tools 2025-06-24 17:21:09 +03:00
Samuel Jensen
9edb619600 make protocol class not overwrite existing hooks when connecting transports 2025-06-20 19:59:30 +02:00
Paul Carleton
87da0e0c3a
adjust default validation for resource parameter in client flow, and server example 2025-06-19 17:52:24 +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
ihrpr
741a201a3d
remove hasCustomTitle 2025-06-17 12:35:29 +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
1f4e42c09e
cleanup auth-utils and remove example files
Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 20:05:02 +01:00
Olivier Chafik
7b5bfcee52
implementation of RFC 8707 Resource Indicators (Fixes #592, Fixes #635) 2025-06-16 19:29:04 +01:00
ihrpr
54c30109fb
Merge branch 'main' into ihrpr/elicitation 2025-06-16 19:11:57 +01:00
Konstantin Konstantinov
71abccb874
Merge branch 'main' into request-propagation-in-tools 2025-06-16 18:51:44 +03:00
ihrpr
d1c94a2c69
refactor 2025-06-16 10:43:31 +01:00
ihrpr
4d03b243e3
add title 2025-06-15 20:42:25 +01:00
Konstantin Konstantinov
e714050642
Merge branch 'main' into request-propagation-in-tools 2025-06-14 01:10:58 +03:00
Konstantin Konstantinov
db9ba7b419
raw request propagation in tools - implementation, unit tests, types 2025-06-14 01:08:02 +03:00
Olivier Chafik
33257f14d4
switch to optional Transport.setProtocolVersion 2025-06-13 13:36:04 +01:00
Olivier Chafik
84971c83ea
Set Mcp-Protocol-Version in client requests after init, and warn when it doesn't match negotiated version (it SHOULD match) 2025-06-11 17:29:09 +01:00
ihrpr
eed97c9d17
Merge branch 'main' into ihrpr/elicitation 2025-06-10 14:43:35 +01:00
ihrpr
cdcb00975c
fix build and add tests 2025-05-29 14:59:47 +01:00
PapacyDai
49777d5652
fix: Ensure _meta object is not lost when onprogress option is passed
When the onprogress option is passed, the _meta object in the request
params was being overwritten, causing any existing _meta content to be lost.
2025-05-29 15:15:52 +08:00
ihrpr
04cbbfbb0d
elicitation example 2025-05-21 16:59:37 -04: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