Cliff Hall
f2f030e479
Merge branch 'main' into update-protocol-version
2025-04-28 17:59:36 -04:00
cliffhall
3a9a6c944b
Update protocol version
...
* This fixes #378
* In types.ts
- set LATEST_PROTOCOL_VERSION to "2025-03-26"
- add "2025-03-26" to SUPPORTED_PROTOCOL_VERSIONS
* In auth.test.ts
- in test "returns metadata when discovery succeeds"
- expect "MCP-Protocol-Version" to be "2025-03-26"
2025-04-25 09:16:28 -04:00
Marcel Samyn
75eb1c431a
Pass request _meta to request handlers extra param
2025-04-25 14:42:59 +02:00
Basil Hosmer
0096be432f
Add ToolAnnotations support to McpServer.tool() method
2025-04-22 15:24:32 -04:00
ihrpr
31f44e0b68
add isInitializeRequest and isInitializedNotification utility
2025-04-16 10:19:46 +01: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
Shinya Fujino
1c1178143c
feat: add completions capability in ServerCapabilitiesSchema
2025-04-06 22:46:02 +09:00
Nathan Arseneau
9f5b4bf00d
Add audio content
2025-04-01 19:01:22 -04:00
Justin Spahr-Summers
f6e47c4751
Add missing name to McpError
2025-02-18 14:15:22 +00:00
Kalvin Chau
443c0829ed
feat: add mcp client instruction support
2025-01-22 09:17:59 -08:00
Justin Spahr-Summers
0c5d6c4f18
Missed one
2025-01-06 21:37:30 +00:00
Justin Spahr-Summers
b5711be1ad
Can just reuse z.infer instead of using ReturnType
2025-01-03 14:01:17 +00:00
Justin Spahr-Summers
73ea68cf13
Disable ESLint warning
2025-01-03 13:49:07 +00:00
Justin Spahr-Summers
9b5efc4286
Recursively flatten types for better inference
2025-01-03 13:47:19 +00:00
Sumitesh Naithani
21e3d465ca
chore: updated documentation comment in ErrorCode enum and set protocol test timeout to 0
2025-01-03 06:59:01 +05:30
Sumitesh Naithani
d77cd0deb3
style: fixed linting issues
2024-12-22 23:20:35 +05:30
Sumitesh Naithani
e7d08c738e
fix(protocol): restrict SDK error codes to JSON-RPC server error range
...
The SDK's custom error codes were previously using arbitrary negative numbers
(-1, -2) which could conflict with application-specific error codes. This change:
- Updates ConnectionClosed from -1 to -32000
- Updates RequestTimeout from -2 to -32001
- Keeps standard JSON-RPC error codes unchanged
- Adds documentation explaining the server error range usage
This modification ensures compliance with the JSON-RPC 2.0 specification, which
reserves -32000 to -32099 for implementation-defined server errors. This change
allows applications to freely use other error code ranges without potential
conflicts with SDK-generated errors.
Issue: #85
2024-12-22 23:12:22 +05:30
Justin Spahr-Summers
1962943b22
Revert "Remove CompatibilityCallToolResult"
2024-12-04 17:09:31 +00:00
Justin Spahr-Summers
e911ece970
Remove CompatibilityCallToolResult
...
Resolves #82 .
2024-12-03 16:03:26 +00:00
Justin Spahr-Summers
2cc3bc8a40
Add RequestOptions.timeout
2024-11-16 16:30:20 +00:00
Justin Spahr-Summers
15bd2dc7aa
Fix cancelled notification method name
2024-11-14 14:07:16 +00:00
Justin Spahr-Summers
347e8905a9
Add types for cancellation notifications
2024-11-14 13:39:43 +00:00
Justin Spahr-Summers
d0c83e946c
Fix notification params schemas not permitting _meta
2024-11-14 13:26:24 +00:00
Justin Spahr-Summers
002f82332d
Merge branch 'main' into justin/call-tool-iserror
2024-11-12 13:47:43 +00:00
Justin Spahr-Summers
dc45f5d148
Handle capabilities checks at the request() level, make non-strict by default
2024-11-12 10:57:59 +00:00
Justin Spahr-Summers
7631cdb6d1
CallToolResult.isError should not be required
2024-11-11 21:27:02 +00:00
Justin Spahr-Summers
2b7a23bb81
Fix some missing type exports
2024-11-10 13:50:10 +00:00
Justin Spahr-Summers
68ef1f9f52
Prevent new server code from returning toolResult
...
This doesn't impact the ability of clients to handle it (see `Client.callTool`), but does make it a type error to return the old format. This will make it easier to catch sites that haven't been updated.
2024-11-08 16:12:55 +00:00
Justin Spahr-Summers
5c6a7a247e
CallToolResult.isError should be optional
2024-11-07 13:36:57 +00:00
Justin Spahr-Summers
1f3dbef66c
Support old tools/call result structure, if explicitly opted in
2024-11-07 13:09:20 +00:00
Justin Spahr-Summers
b618157c93
Continue allowing 2024-10-07 in version negotiation
2024-11-07 13:00:52 +00:00
Justin Spahr-Summers
0bf7e66e98
Require protocolVersion to be a string now
2024-11-07 12:57:19 +00:00
Justin Spahr-Summers
f74a289211
Split out ModelHintSchema for better typing and docs
2024-11-06 11:56:20 +00:00
Justin Spahr-Summers
f7f0ccff0e
Declare known stopReasons, as a kind of documentation
2024-11-06 11:56:05 +00:00
Justin Spahr-Summers
45a4c9ee37
List roots is not a client request
2024-11-06 11:45:19 +00:00
Justin Spahr-Summers
579ac51f21
Export type aliases for roots
2024-11-06 11:44:37 +00:00
Justin Spahr-Summers
ce50ba4915
Fix resources/templates/list not being included in client/server schemas
2024-11-06 11:42:09 +00:00
Justin Spahr-Summers
7e085d0519
Update for spec changes
2024-11-06 11:38:02 +00:00
Justin Spahr-Summers
bcf9862937
progressToken should be required in progress notifications
2024-11-04 20:50:27 +00:00
Justin Spahr-Summers
f02952aa81
Fix paginated requests requiring params
...
Resolves #21 .
2024-11-04 20:50:23 +00:00
Justin Spahr-Summers
ee7eb5e5c9
Make most object types pass through unrecognized properties
2024-10-21 12:32:41 +01:00
Justin Spahr-Summers
209f8eb1c0
Revert string -> URL transformations
2024-10-18 17:53:01 +01:00
Ashwin Bhat
65a861328b
fix schema definitions for RequestSchema
2024-10-16 15:30:24 -07:00
Justin Spahr-Summers
ec96ffc958
Treat URIs as 'URL' type
2024-10-11 16:02:24 +01:00
Justin Spahr-Summers
69daade659
Update to latest protocol version
2024-10-11 14:01:35 +01:00
Justin Spahr-Summers
8b476ddc85
Start JSON-RPC messages with 'jsonrpc' and 'id' fields, instead of the other way around
2024-10-02 22:22:00 +01:00
Justin Spahr-Summers
cc1f19a051
Allow messages to contain other protocol versions
2024-10-02 14:51:56 +01:00
Justin Spahr-Summers
d5c3d8178e
Add TypeScript types from Zod schemas
2024-10-02 14:51:56 +01:00
Justin Spahr-Summers
cd6820e810
Use an enum for error codes
2024-10-02 14:51:55 +01:00