Commit graph typescript-sdk/src
Author SHA1 Message Date
Justin Spahr-Summers
fceebdcf5a
Add MCP-Protocol-Version header 2025-02-11 17:58:58 +00:00
Justin Spahr-Summers
141f3f5532
Don't need full OAuth client metadata in response 2025-02-11 16:54:57 +00:00
Justin Spahr-Summers
9fea0af998
Correctly provide client ID (+ secret) to every auth step 2025-02-11 15:59:16 +00:00
Justin Spahr-Summers
47fd6df229
Higher-level auth flow 2025-02-11 15:13:17 +00:00
Justin Spahr-Summers
fa50204a11
Fix import of auth.js in test 2025-02-11 14:17:10 +00:00
Justin Spahr-Summers
4c87fb50ab
Prefix client metadata + info with OAuth 2025-02-11 14:17:02 +00:00
Justin Spahr-Summers
d17a382a65
Auth tests and fixes 2025-02-11 13:47:58 +00:00
Justin Spahr-Summers
2b9a58182c
Add dynamic client registration 2025-02-11 13:32:10 +00:00
Justin Spahr-Summers
62d67ad874
Add refresh token support 2025-02-06 16:37:47 +00:00
Justin Spahr-Summers
fe24aa5c26
Remove nested folder for auth 2025-02-06 16:34:33 +00:00
Justin Spahr-Summers
956f6658e8
Implement token exchange 2025-02-06 14:52:37 +00:00
Justin Spahr-Summers
8a26e2d9e8
Validate auth flow is supported 2025-02-06 14:39:50 +00:00
Justin Spahr-Summers
c39c8bf62b
WIP start authorization flow 2025-02-06 13:44:41 +00:00
Justin Spahr-Summers
0bc3a74ac3
OAuth metadata discovery 2025-02-06 13:38:21 +00:00
Justin Spahr-Summers
63f8f07a22
Add SseError class for easier introspection 2025-01-24 11:26:12 +00:00
Justin Spahr-Summers
9923aecf29
Report SSE error codes 2025-01-23 17:29:46 +00:00
Justin Spahr-Summers
edfdea539f
Merge pull request #134 from modelcontextprotocol/justin/sse-auth
Use `eventsource` package, to permit custom headers for SSE
2025-01-23 13:56:41 +00:00
Justin Spahr-Summers
87bfb61544
Try a different way of waiting for close 2025-01-23 11:53:41 +00:00
Justin Spahr-Summers
742b8b43a0
General tests for SSE client transport
Since we're here anyway…
2025-01-22 18:55:47 +00:00
Justin Spahr-Summers
e2723d30b8
Tests for passing custom SSE headers 2025-01-22 18:51:00 +00:00
Justin Spahr-Summers
c828067171
Use eventsource package 2025-01-22 18:49:04 +00:00
Kalvin Chau
5087087190 style: fix linting error on String vs string 2025-01-22 09:25:28 -08:00
Kalvin Chau
443c0829ed feat: add mcp client instruction support 2025-01-22 09:17:59 -08:00
Justin Spahr-Summers
dbf560f24a
Don't double-add completion handler 2025-01-22 11:41:11 +00:00
Justin Spahr-Summers
eba6461567
Failing test case for double completion handlers 2025-01-22 11:41:05 +00:00
Justin Spahr-Summers
2590d40e74
Fix registering multiple tools/resources/prompts
Request handlers were being re-registered every time a new tool/resource/prompt was added, which would fail since the handlers were already registered. Now we track whether handlers have been initialized and only register them once.

Added tests to verify that multiple registrations work correctly.

Resolves #124.
2025-01-21 09:14:14 +00:00
Justin Spahr-Summers
5a6823a0db
Stick with %20, don't replace with + 2025-01-16 11:24:39 +00:00
Justin Spahr-Summers
2e35b15353
Merge branch 'main' into justin/simplified-api 2025-01-13 20:34:08 +00:00
Kalvin Chau
1bb51d0fca style: remove private getter for getInstructions 2025-01-13 09:50:02 -08:00
Kalvin Chau
54472d2ae1 feat: add optional instructions field to server _oninitialize 2025-01-13 09:09:05 -08:00
Justin Spahr-Summers
7629c70ef9
Remove unused import 2025-01-08 22:02:00 +00:00
Justin Spahr-Summers
2289dbc0d0
Factor out convenience APIs into another class 2025-01-08 21:59:38 +00:00
Jerome
e72ff8d97f
Merge pull request #115 from modelcontextprotocol/jerome/fix/clean-stdio-shutdown
Added clean shutdown + tests
2025-01-08 18:07:28 +00:00
Justin Spahr-Summers
189cc84113
Autocomplete on resource template variables 2025-01-08 15:46:43 +00:00
Justin Spahr-Summers
8635c6384f
Autocomplete on prompt arguments 2025-01-08 15:19:16 +00:00
Justin Spahr-Summers
02fa78728c
Add completable wrapper for Zod schemas 2025-01-08 15:00:33 +00:00
Justin Spahr-Summers
9b95fa8203
Server.prompt() convenience API 2025-01-08 14:20:44 +00:00
Justin Spahr-Summers
5ddfa0a0d9
Add extra to resource request handlers 2025-01-08 14:20:43 +00:00
Justin Spahr-Summers
f090c93127
Move Server helper definitions to bottom of file 2025-01-08 13:47:38 +00:00
Justin Spahr-Summers
8356cb900c
Create ResourceTemplate class and move listCallback into it 2025-01-08 13:44:12 +00:00
Justin Spahr-Summers
45f99e6590
Make Variables non-optional with resource template URIs 2025-01-07 22:36:20 +00:00
Justin Spahr-Summers
3f9acec31e
Add a test for listCallback 2025-01-07 22:10:05 +00:00
Justin Spahr-Summers
1970509131
Method documentation 2025-01-07 22:05:55 +00:00
Justin Spahr-Summers
098266ae22
Add simplified API for registering resources and resource templates 2025-01-07 22:01:41 +00:00
Justin Spahr-Summers
e4b382044e
Add UriTemplate.toString 2025-01-07 22:01:40 +00:00
Justin Spahr-Summers
1e040e9932
Add method to determine if a URI is a template or not 2025-01-07 22:01:40 +00:00
Justin Spahr-Summers
dc77d9cf47
More thorough handling of edge cases/pathologies 2025-01-07 18:40:53 +00:00
Justin Spahr-Summers
7f0cf7305d
URI Template parser and matcher 2025-01-07 16:42:13 +00:00
Justin Spahr-Summers
bb28c9b519
Minor tweak to make test code more idiomatic 2025-01-07 15:57:10 +00:00
Justin Spahr-Summers
aac1959855
Errors invoking tools should be erroneous tool results, not McpErrors 2025-01-07 14:53:56 +00:00