Draft
Conversation
3744138 to
44cb6da
Compare
4022681 to
204cb9c
Compare
8d87726 to
74f739c
Compare
c36ee9e to
f72114f
Compare
7b3464e to
12f66d8
Compare
5652354 to
6a20dfc
Compare
3c45260 to
1bdfa83
Compare
1bdfa83 to
fba4816
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@modelcontextprotocol/server@2.0.0
Major Changes
#1389
108f2f3Thanks @DePasqualeOrg! - Fix error handling forunknown tools and resources per MCP spec.
Tools: Unknown or disabled tool calls now return JSON-RPC protocol errors with code
-32602(InvalidParams) instead ofCallToolResultwithisError: true. Callers who checkedresult.isErrorfor unknown tools should catch rejected promises instead.Resources: Unknown resource reads now return error code
-32002(ResourceNotFound) instead of-32602(InvalidParams).Added
ProtocolErrorCode.ResourceNotFound.Minor Changes
#1673
462c3fcThanks @KKonstantinov! - refactor: extract taskorchestration from Protocol into TaskManager
Breaking changes:
taskStore,taskMessageQueue,defaultTaskPollInterval, andmaxTaskQueueSizemoved fromProtocolOptionstocapabilities.tasksonClientOptions/ServerOptions#1689
0784be1Thanks @felixweinberger! - Support Standard Schemafor tool and prompt schemas
Tool and prompt registration now accepts any schema library that implements the Standard Schema spec: Zod v4, Valibot, ArkType, and others.
RegisteredTool.inputSchema,RegisteredTool.outputSchema, andRegisteredPrompt.argsSchemanow useStandardSchemaWithJSON(requires both~standard.validateand~standard.jsonSchema) instead of the Zod-specificAnySchematype.Zod v4 schemas continue to work unchanged — Zod v4 implements the required interfaces natively.
For raw JSON Schema (e.g. TypeBox output), use the new
fromJsonSchemaadapter:Breaking changes:
experimental.tasks.getTaskResult()no longer accepts aresultSchemaparameter. ReturnsGetTaskPayloadResult(a looseResult); cast to the expected type at the call site.@modelcontextprotocol/core:SchemaInput,schemaToJson,parseSchemaAsync,getSchemaShape,getSchemaDescription,isOptionalSchema,unwrapOptionalSchema. Use the newstandardSchemaToJsonSchemaandvalidateStandardSchemainstead.completable()remains Zod-specific (it relies on Zod's.shapeintrospection).Patch Changes
#1363
0a75810Thanks @DevJanderson! - Fix ReDoS vulnerability inUriTemplate regex patterns (CVE-2026-0621)
#1372
3466a9eThanks @mattzcarey! - missing change for fix(client):replace body.cancel() with text() to prevent hanging
#1761
01954e6Thanks @felixweinberger! - Convert remainingcapability-assertion throws to
SdkError(SdkErrorCode.CapabilityNotSupported, ...). Follow-up tov2: Errors refactor (ProtocolError, SdkError, OAuthError) #1454 which missedClient.assertCapability(), the task capability helpers inexperimental/tasks/helpers.ts, and the sampling/elicitation capability checks inexperimental/tasks/server.ts.#1433
78bae74Thanks @codewithkenzo! - Fix transport errors beingsilently swallowed by adding missing
onerrorcallback invocations before allcreateJsonErrorResponsecalls inWebStandardStreamableHTTPServerTransport. This ensures errors like parse failures, invalid headers, and session validation errors are properly reported via theonerrorcallback.#1568
f1ade75Thanks @stakeswky! - Handle stdout errors (e.g. EPIPE)in
StdioServerTransportgracefully instead of crashing. When the client disconnects abruptly, the transport now catches the stdout error, surfaces it viaonerror, and closes.#1419
dcf708dThanks @KKonstantinov! - remove deprecated .tool,.prompt, .resource method signatures
#1388
f66a55bThanks @mattzcarey! - reverting application/json innotifications
#1534
69a0626Thanks @josefaidt! - remove npm references, use pnpm#1534
69a0626Thanks @josefaidt! - clean up package manager usage, allpnpm
#1419
dcf708dThanks @KKonstantinov! - deprecated .tool, .prompt,.resource method removal
#1279
71ae3acThanks @KKonstantinov! - Initial 2.0.0-alpha.0client and server package
@modelcontextprotocol/client@2.0.0
Minor Changes
#1527
dc896e1Thanks @felixweinberger! - AdddiscoverOAuthServerInfo()function and unified discovery state caching for OAuthdiscoverOAuthServerInfo(serverUrl)export that performs RFC 9728 protected resource metadata discovery followed by authorization server metadata discovery in a single call. Use this for operations like token refresh and revocation that need the authorization serverURL outside of
auth().OAuthDiscoveryStatetype and optionalOAuthClientProvidermethodssaveDiscoveryState()/discoveryState()allow providers to persist all discovery results (auth server URL, resource metadata URL, resource metadata, auth server metadata) across sessions. Thisavoids redundant discovery requests and handles browser redirect scenarios where discovery state would otherwise be lost.
'discovery'scope forinvalidateCredentials()to clear cached discovery state.OAuthServerInfotype exported for the return value ofdiscoverOAuthServerInfo().#1673
462c3fcThanks @KKonstantinov! - refactor: extract taskorchestration from Protocol into TaskManager
Breaking changes:
taskStore,taskMessageQueue,defaultTaskPollInterval, andmaxTaskQueueSizemoved fromProtocolOptionstocapabilities.tasksonClientOptions/ServerOptions#1689
0784be1Thanks @felixweinberger! - Support Standard Schemafor tool and prompt schemas
Tool and prompt registration now accepts any schema library that implements the Standard Schema spec: Zod v4, Valibot, ArkType, and others.
RegisteredTool.inputSchema,RegisteredTool.outputSchema, andRegisteredPrompt.argsSchemanow useStandardSchemaWithJSON(requires both~standard.validateand~standard.jsonSchema) instead of the Zod-specificAnySchematype.Zod v4 schemas continue to work unchanged — Zod v4 implements the required interfaces natively.
For raw JSON Schema (e.g. TypeBox output), use the new
fromJsonSchemaadapter:Breaking changes:
experimental.tasks.getTaskResult()no longer accepts aresultSchemaparameter. ReturnsGetTaskPayloadResult(a looseResult); cast to the expected type at the call site.@modelcontextprotocol/core:SchemaInput,schemaToJson,parseSchemaAsync,getSchemaShape,getSchemaDescription,isOptionalSchema,unwrapOptionalSchema. Use the newstandardSchemaToJsonSchemaandvalidateStandardSchemainstead.completable()remains Zod-specific (it relies on Zod's.shapeintrospection).#1710
e563e63Thanks @felixweinberger! - AddAuthProviderforcomposable bearer-token auth; transports adapt
OAuthClientProviderautomaticallyNew
AuthProviderinterface:{ token(): Promise<string | undefined>; onUnauthorized?(ctx): Promise<void> }. Transports calltoken()before every request andonUnauthorized()on 401 (then retry once).Transport
authProvideroption now acceptsAuthProvider | OAuthClientProvider. OAuth providers are adapted internally viaadaptOAuthProvider()— no changes needed to existingOAuthClientProviderimplementations.For simple bearer tokens (API keys, gateway-managed tokens, service accounts):
{ authProvider: { token: async () => myKey } }— one-line object literal, no class.New
adaptOAuthProvider(provider)export for explicit adaptation.New
handleOAuthUnauthorized(provider, ctx)helper — the standard OAuthonUnauthorizedbehavior.New
isOAuthClientProvider()type guard.New
UnauthorizedContexttype.Exported previously-internal auth helpers for building custom flows:
applyBasicAuth,applyPostAuth,applyPublicAuth,executeTokenRequest.Transports are simplified internally — ~50 lines of inline OAuth orchestration (auth() calls, WWW-Authenticate parsing, circuit-breaker state) moved into the adapter's
onUnauthorized()implementation.OAuthClientProvideritself is unchanged.#1614
1a78b01Thanks @pcarleton! - Apply resolved scope consistentlyto both DCR and the authorization URL (SEP-835)
When
scopes_supportedis present in the protected resource metadata (/.well-known/oauth-protected-resource), the SDK already uses it as the default scope for the authorization URL. This change applies the same resolved scope to the dynamic client registration requestbody, ensuring both use a consistent value.
registerClient()now accepts an optionalscopeparameter that overridesclientMetadata.scopein the registration body.auth()now computes the resolved scope once (WWW-Authenticate → PRMscopes_supported→clientMetadata.scope) and passes it to both DCR and the authorization request.Patch Changes
#1761
01954e6Thanks @felixweinberger! - Convert remainingcapability-assertion throws to
SdkError(SdkErrorCode.CapabilityNotSupported, ...). Follow-up tov2: Errors refactor (ProtocolError, SdkError, OAuthError) #1454 which missedClient.assertCapability(), the task capability helpers inexperimental/tasks/helpers.ts, and the sampling/elicitation capability checks inexperimental/tasks/server.ts.#1343
4b5fdcbThanks @christso! - Fix OAuth error handling for serversreturning errors with HTTP 200 status
Some OAuth servers (e.g., GitHub) return error responses with HTTP 200 status instead of 4xx. The SDK now checks for an
errorfield in the JSON response before attempting to parse it as tokens, providing users with meaningful error messages.#1534
69a0626Thanks @josefaidt! - remove npm references, use pnpm#1386
00249ceThanks @PederHP! - Respect capability negotiation in listmethods by returning empty lists when server lacks capability
The Client now returns empty lists instead of sending requests to servers that don't advertise the corresponding capability:
listPrompts()returns{ prompts: [] }if server lacks prompts capabilitylistResources()returns{ resources: [] }if server lacks resources capabilitylistResourceTemplates()returns{ resourceTemplates: [] }if server lacks resources capabilitylistTools()returns{ tools: [] }if server lacks tools capabilityThis respects the MCP spec requirement that "Both parties SHOULD respect capability negotiation" and avoids unnecessary server warnings and traffic. The existing
enforceStrictCapabilitiesoption continues to throw errors when set totrue.#1534
69a0626Thanks @josefaidt! - clean up package manager usage, allpnpm
#1595
13a0d34Thanks @bhosmer-ant! - Don't swallow fetchTypeErroras CORS in non-browser environments. Network errors (DNS resolution failure, connection refused, invalid URL) in Node.js and Cloudflare Workers now propagate from OAuth discovery instead of being silently misattributed to CORS and returning
undefined. This surfaces the realerror to callers rather than masking it as "metadata not found."
#1279
71ae3acThanks @KKonstantinov! - Initial 2.0.0-alpha.0client and server package
@modelcontextprotocol/express@2.0.0
Patch Changes
#1534
69a0626Thanks @josefaidt! - remove npm references, use pnpm#1534
69a0626Thanks @josefaidt! - clean up package manager usage, allpnpm
#1625
1fe9edaThanks @rameshreddy-adutla! - Add jsonLimitoption to createMcpExpressApp
Updated dependencies [
0a75810,3466a9e,462c3fc,01954e6,78bae74,f1ade75,108f2f3,dcf708d,f66a55b,69a0626,69a0626,dcf708d,0784be1,71ae3ac]:@modelcontextprotocol/hono@2.0.0
Patch Changes
#1534
69a0626Thanks @josefaidt! - remove npm references, use pnpm#1534
69a0626Thanks @josefaidt! - clean up package manager usage, allpnpm
Updated dependencies [
0a75810,3466a9e,462c3fc,01954e6,78bae74,f1ade75,108f2f3,dcf708d,f66a55b,69a0626,69a0626,dcf708d,0784be1,71ae3ac]:@modelcontextprotocol/node@2.0.0
Patch Changes
#1504
327243cThanks @corvid-agent! - Add missinghonopeerdependency to
@modelcontextprotocol/node. The package already depends on@hono/node-serverwhich requireshonoat runtime, buthonowas only listed in the workspace root, not as a peer dependency of the package itself.#1410
9296459Thanks @mattzcarey! - Prevent Hono from overridingglobal Response object by passing
overrideGlobalObjects: falsetogetRequestListener(). This fixes compatibility with frameworks like Next.js whose response classes extend the native Response.#1419
dcf708dThanks @KKonstantinov! - remove deprecated .tool,.prompt, .resource method signatures
#1534
69a0626Thanks @josefaidt! - remove npm references, use pnpm#1534
69a0626Thanks @josefaidt! - clean up package manager usage, allpnpm
#1419
dcf708dThanks @KKonstantinov! - deprecated .tool, .prompt,.resource method removal
Updated dependencies [
0a75810,3466a9e,462c3fc,01954e6,78bae74,f1ade75,108f2f3,dcf708d,f66a55b,69a0626,69a0626,dcf708d,0784be1,71ae3ac]:@modelcontextprotocol/core@2.0.0
Minor Changes
#1673
462c3fcThanks @KKonstantinov! - refactor: extract taskorchestration from Protocol into TaskManager
Breaking changes:
taskStore,taskMessageQueue,defaultTaskPollInterval, andmaxTaskQueueSizemoved fromProtocolOptionstocapabilities.tasksonClientOptions/ServerOptions#1389
108f2f3Thanks @DePasqualeOrg! - Fix error handling forunknown tools and resources per MCP spec.
Tools: Unknown or disabled tool calls now return JSON-RPC protocol errors with code
-32602(InvalidParams) instead ofCallToolResultwithisError: true. Callers who checkedresult.isErrorfor unknown tools should catch rejected promises instead.Resources: Unknown resource reads now return error code
-32002(ResourceNotFound) instead of-32602(InvalidParams).Added
ProtocolErrorCode.ResourceNotFound.#1689
0784be1Thanks @felixweinberger! - Support Standard Schemafor tool and prompt schemas
Tool and prompt registration now accepts any schema library that implements the Standard Schema spec: Zod v4, Valibot, ArkType, and others.
RegisteredTool.inputSchema,RegisteredTool.outputSchema, andRegisteredPrompt.argsSchemanow useStandardSchemaWithJSON(requires both~standard.validateand~standard.jsonSchema) instead of the Zod-specificAnySchematype.Zod v4 schemas continue to work unchanged — Zod v4 implements the required interfaces natively.
For raw JSON Schema (e.g. TypeBox output), use the new
fromJsonSchemaadapter:Breaking changes:
experimental.tasks.getTaskResult()no longer accepts aresultSchemaparameter. ReturnsGetTaskPayloadResult(a looseResult); cast to the expected type at the call site.@modelcontextprotocol/core:SchemaInput,schemaToJson,parseSchemaAsync,getSchemaShape,getSchemaDescription,isOptionalSchema,unwrapOptionalSchema. Use the newstandardSchemaToJsonSchemaandvalidateStandardSchemainstead.completable()remains Zod-specific (it relies on Zod's.shapeintrospection).Patch Changes
#1735
a2e5037Thanks @felixweinberger! - Abort in-flight requesthandlers when the connection closes. Previously, request handlers would continue running after the transport disconnected, wasting resources and preventing proper cleanup. Also fixes
InMemoryTransport.close()firingonclosetwice on the initiating side.#1574
379392dThanks @olaservo! - Add missingsizefield toResourceSchemato match the MCP specification#1363
0a75810Thanks @DevJanderson! - Fix ReDoS vulnerability inUriTemplate regex patterns (CVE-2026-0621)
#1761
01954e6Thanks @felixweinberger! - Convert remainingcapability-assertion throws to
SdkError(SdkErrorCode.CapabilityNotSupported, ...). Follow-up tov2: Errors refactor (ProtocolError, SdkError, OAuthError) #1454 which missedClient.assertCapability(), the task capability helpers inexperimental/tasks/helpers.ts, and the sampling/elicitation capability checks inexperimental/tasks/server.ts.#1486
65bbceaThanks @localden! - Fix InMemoryTaskStore to enforcesession isolation. Previously, sessionId was accepted but ignored on all TaskStore methods, allowing any session to enumerate, read, and mutate tasks created by other sessions. The store now persists sessionId at creation time and enforces ownership on all reads and writes.
#1419
dcf708dThanks @KKonstantinov! - remove deprecated .tool,.prompt, .resource method signatures
#1534
69a0626Thanks @josefaidt! - remove npm references, use pnpm#1534
69a0626Thanks @josefaidt! - clean up package manager usage, allpnpm
#1419
dcf708dThanks @KKonstantinov! - deprecated .tool, .prompt,.resource method removal
#1762
64897f7Thanks @felixweinberger! -ReadBuffer.readMessage()now silently skips non-JSON lines instead of throwingSyntaxError. This prevents noisyonerrorcallbacks when hot-reload tools (tsx, nodemon) write debug output like "Gracefully restarting..." to stdout. Lines that parse as JSON but fail JSONRPCschema validation still throw.
@modelcontextprotocol/test-integration@2.0.0
Patch Changes
#1419
dcf708dThanks @KKonstantinov! - remove deprecated .tool,.prompt, .resource method signatures
#1419
dcf708dThanks @KKonstantinov! - deprecated .tool, .prompt,.resource method removal