Commit graph typescript-sdk/src
Author SHA1 Message Date
ihrpr
d1c94a2c69
refactor 2025-06-16 10:43:31 +01:00
ihrpr
4d03b243e3
add title 2025-06-15 20:42:25 +01:00
ihrpr
e7284d29c8
added _meta to more objects 2025-06-15 18:47:44 +01:00
ihrpr
9bf5c62979
Merge pull request #619 from modelcontextprotocol/ihrpr/602
Rename ResourceReference to ResourceTemplateReference
2025-06-15 17:30:24 +01:00
ihrpr
6b3d326cf7
Merge pull request #614 from modelcontextprotocol/ochafik/protocol-version
feat: implement MCP-Protocol-Version header requirement for HTTP transport
2025-06-13 18:31:03 +01:00
Olivier Chafik
33257f14d4
switch to optional Transport.setProtocolVersion 2025-06-13 13:36:04 +01:00
Olivier Chafik
4aaa26d900
remove protocol version mismatch warning 2025-06-13 13:35:38 +01:00
bhosmer-ant
b6f0273569
Merge pull request #621 from modelcontextprotocol/carlpeaslee/fix-resource-template-list-metadata
Adding tests to prevent regressions for: fixes metadata for listed resources from resource templates so that they favor their own metadata
2025-06-12 13:53:43 -04:00
ihrpr
9d3374c519
Merge pull request #574 from loopwork-ai/carlpeaslee/fix-resource-template-list-metadata
fixes metadata for listed resources from resource templates so that they favor their own metadata
2025-06-12 18:50:23 +01:00
ihrpr
bc5312991e
adding tests to prevent regressions 2025-06-12 18:47:16 +01:00
Olivier Chafik
4e9d6a707d
Merge branch 'ochafik/protocol-version' of https://github.com/modelcontextprotocol/typescript-sdk into ochafik/protocol-version 2025-06-12 18:45:10 +01:00
Olivier Chafik
e573a0f342
nits: remove dead comment & align test style on local idioms 2025-06-12 18:43:49 +01:00
Olivier Chafik
a28e25a9c0
use const in test 2025-06-12 18:43:06 +01:00
Olivier Chafik
bb0592bd50
add supported versions to error message 2025-06-12 18:42:51 +01:00
ihrpr
255d30cbf2
Rename ResourceReference to ResourceTemplateReference 2025-06-12 15:10:12 +01:00
Olivier Chafik
18f8b40d00
Merge branch 'main' into ochafik/protocol-version 2025-06-11 18:53: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
2cf4f0ca86
Merge pull request #546 from fredericbarthelet/register-completions-capabilities
fix: Ensure completions capability is registered on setCompletionRequestHandler call
2025-06-10 13:21:12 +01:00
Carl Peaslee
6cf034595d
updates listed resources from resource templates to favor their own metadata 2025-05-30 11:32:10 -07: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
Frédéric Barthelet
7e0521550b Add tests for completions capability registration on template resource with completion or prompt completable argument registration 2025-05-25 19:07:26 -07:00
Frédéric Barthelet
269c8caf8e Remove server-specific capabilities definition from Client constructor in mcp tests 2025-05-25 18:00:28 -07:00
Frédéric Barthelet
5f5180c4d3 Register completions capabilities 2025-05-25 17:20:02 -07:00
Daniel Leal
d38a5979ac Add request init headers defined on the sse transport to the start 2025-05-22 19:11:23 +01:00
ihrpr
c69168cf93
Merge pull request #534 from modelcontextprotocol/ihrpr/fix-example-shttp
Fix StreamableHttp example for tool calls - have a separate option for testing notifications resumption
2025-05-22 16:43:03 +01:00
Jeff Escalante
0516f9898b
add state param to oauth provider (#529) 2025-05-22 12:55:00 +01:00
ihrpr
3d76bbe6c6
Merge pull request #526 from modelcontextprotocol/ihrpr/auth-example-client3
Example Auth client
2025-05-22 11:14:51 +01:00
ihrpr
cbe9279206
add new tool for testing resumability - leave the rest normal 2025-05-22 10:38:43 +01:00
ihrpr
9bb5ed6dc9
lint 2025-05-21 21:32:01 +01:00
ihrpr
70f03ee648
remove non mac open browser commands 2025-05-21 21:27:42 +01:00
Basil Hosmer
aeb7b8d741
server error if tool declares outputSchema but no structuredContent in result 2025-05-21 15:45:52 -04:00
bhosmer-ant
a41b174330
Merge pull request #524 from modelcontextprotocol/ihrpr/output-types
Make content in Tool Result required
2025-05-21 12:54:19 -04:00
Basil Hosmer
7636c63f39
update to track spec changes 2025-05-21 12:42:20 -04:00
Frédéric Barthelet
281cf0bf8d
Save existing refresh_token in store if no new refresh_token is returned (#483)
As described in https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-12#name-refresh-token-response,
server MAY return a new refresh_token. In case it doesn't, current implementation discard initial refresh
token if it was still valid.
2025-05-21 17:29:56 +01:00
Shubham Lohar
1d860bb217
fixing ProxyOAuthServerProvider: redirect_uri missing in token request (#519) 2025-05-21 17:19:49 +01:00
ihrpr
265ad071f7
make content required 2025-05-21 12:19:31 -04:00
ihrpr
8fd635cf72
exaple 2025-05-21 16:29:41 +01: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
bhosmer-ant
3975c1ac79
Merge pull request #517 from modelcontextprotocol/basil/ajv_downgrade
Fix Ajv import compatibility issue by downgrading to v6
2025-05-20 12:38:25 -04:00
bhosmer-ant
69f8ee4818
Merge pull request #502 from modelcontextprotocol/basil/progress_message
Add support for message field in progress notifications
2025-05-19 14:47:05 -04:00
Basil Hosmer
4cc8ed43b4
Fix Ajv import compatibility issue by downgrading to v6
Downgrade Ajv from v8.17.1 to v6.12.6 to resolve ESM/CJS module compatibility issues that were causing "does not provide an export named 'Ajv'" errors in projects using this SDK. This ensures consistent import patterns across different module systems.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-19 13:05:21 -04:00
Basil Hosmer
82f5f70924
rollback path preservation fix 2025-05-16 17:45:44 -04:00
Basil Hosmer
00cb9203cd
fix sse endpoint path preservation 2025-05-16 16:48:31 -04: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
Basil Hosmer
c964c5cf91
tsc being a diva on testOutputSchemaServers.ts 2025-05-15 10:40:34 -04:00
Basil Hosmer
f470f0996b
fix type error in testOutputSchemaServers.ts 2025-05-15 10:16:49 -04:00
Basil Hosmer
39b2f65434
restore server-side validation for tools returning structuredContent without outputSchema
Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-15 10:03:50 -04:00
Basil Hosmer
6b680ca18a
Move testOutputSchemaServers.ts to client examples directory
This file is a client implementation that tests outputSchema servers,
so it belongs in the client examples directory rather than server examples.
Updated file paths in error messages to reflect the new location.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-15 10:03:50 -04:00