Skip to content

Version Packages#1420

Draft
github-actions[bot] wants to merge 1 commit intomainfrom
changeset-release/main
Draft

Version Packages#1420
github-actions[bot] wants to merge 1 commit intomainfrom
changeset-release/main

Conversation

@github-actions
Copy link

@github-actions github-actions bot commented Jan 22, 2026

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 108f2f3 Thanks @DePasqualeOrg! - Fix error handling for
    unknown tools and resources per MCP spec.

    Tools: Unknown or disabled tool calls now return JSON-RPC protocol errors with code -32602 (InvalidParams) instead of CallToolResult with isError: true. Callers who checked result.isError for 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 462c3fc Thanks @KKonstantinov! - refactor: extract task
    orchestration from Protocol into TaskManager

    Breaking changes:

    • taskStore, taskMessageQueue, defaultTaskPollInterval, and maxTaskQueueSize moved from ProtocolOptions to capabilities.tasks on ClientOptions/ServerOptions
  • #1689 0784be1 Thanks @felixweinberger! - Support Standard Schema
    for 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, and RegisteredPrompt.argsSchema now use
    StandardSchemaWithJSON (requires both ~standard.validate and ~standard.jsonSchema) instead of the Zod-specific AnySchema type.

    Zod v4 schemas continue to work unchanged — Zod v4 implements the required interfaces natively.

    import { type } from 'arktype';
    
    server.registerTool(
        'greet',
        {
            inputSchema: type({ name: 'string' })
        },
        async ({ name }) => ({ content: [{ type: 'text', text: `Hello, ${name}!` }] })
    );

    For raw JSON Schema (e.g. TypeBox output), use the new fromJsonSchema adapter:

    import { fromJsonSchema, AjvJsonSchemaValidator } from '@modelcontextprotocol/core';
    
    server.registerTool(
        'greet',
        {
            inputSchema: fromJsonSchema({ type: 'object', properties: { name: { type: 'string' } } }, new AjvJsonSchemaValidator())
        },
        handler
    );

    Breaking changes:

    • experimental.tasks.getTaskResult() no longer accepts a resultSchema parameter. Returns GetTaskPayloadResult (a loose Result); cast to the expected type at the call site.
    • Removed unused exports from @modelcontextprotocol/core: SchemaInput, schemaToJson, parseSchemaAsync, getSchemaShape, getSchemaDescription, isOptionalSchema, unwrapOptionalSchema. Use the new standardSchemaToJsonSchema and validateStandardSchema instead.
    • completable() remains Zod-specific (it relies on Zod's .shape introspection).

Patch Changes

  • #1363 0a75810 Thanks @DevJanderson! - Fix ReDoS vulnerability in
    UriTemplate regex patterns (CVE-2026-0621)

  • #1372 3466a9e Thanks @mattzcarey! - missing change for fix(client):
    replace body.cancel() with text() to prevent hanging

  • #1761 01954e6 Thanks @felixweinberger! - Convert remaining
    capability-assertion throws to SdkError(SdkErrorCode.CapabilityNotSupported, ...). Follow-up to v2: Errors refactor (ProtocolError, SdkError, OAuthError) #1454 which missed Client.assertCapability(), the task capability helpers in experimental/tasks/helpers.ts, and the sampling/elicitation capability checks in
    experimental/tasks/server.ts.

  • #1433 78bae74 Thanks @codewithkenzo! - Fix transport errors being
    silently swallowed by adding missing onerror callback invocations before all createJsonErrorResponse calls in WebStandardStreamableHTTPServerTransport. This ensures errors like parse failures, invalid headers, and session validation errors are properly reported via the
    onerror callback.

  • #1568 f1ade75 Thanks @stakeswky! - Handle stdout errors (e.g. EPIPE)
    in StdioServerTransport gracefully instead of crashing. When the client disconnects abruptly, the transport now catches the stdout error, surfaces it via onerror, and closes.

  • #1419 dcf708d Thanks @KKonstantinov! - remove deprecated .tool,
    .prompt, .resource method signatures

  • #1388 f66a55b Thanks @mattzcarey! - reverting application/json in
    notifications

  • #1534 69a0626 Thanks @josefaidt! - remove npm references, use pnpm

  • #1534 69a0626 Thanks @josefaidt! - clean up package manager usage, all
    pnpm

  • #1419 dcf708d Thanks @KKonstantinov! - deprecated .tool, .prompt,
    .resource method removal

  • #1279 71ae3ac Thanks @KKonstantinov! - Initial 2.0.0-alpha.0
    client and server package

@modelcontextprotocol/client@2.0.0

Minor Changes

  • #1527 dc896e1 Thanks @felixweinberger! - Add
    discoverOAuthServerInfo() function and unified discovery state caching for OAuth

    • New discoverOAuthServerInfo(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 server
      URL outside of auth().
    • New OAuthDiscoveryState type and optional OAuthClientProvider methods saveDiscoveryState() / discoveryState() allow providers to persist all discovery results (auth server URL, resource metadata URL, resource metadata, auth server metadata) across sessions. This
      avoids redundant discovery requests and handles browser redirect scenarios where discovery state would otherwise be lost.
    • New 'discovery' scope for invalidateCredentials() to clear cached discovery state.
    • New OAuthServerInfo type exported for the return value of discoverOAuthServerInfo().
  • #1673 462c3fc Thanks @KKonstantinov! - refactor: extract task
    orchestration from Protocol into TaskManager

    Breaking changes:

    • taskStore, taskMessageQueue, defaultTaskPollInterval, and maxTaskQueueSize moved from ProtocolOptions to capabilities.tasks on ClientOptions/ServerOptions
  • #1689 0784be1 Thanks @felixweinberger! - Support Standard Schema
    for 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, and RegisteredPrompt.argsSchema now use
    StandardSchemaWithJSON (requires both ~standard.validate and ~standard.jsonSchema) instead of the Zod-specific AnySchema type.

    Zod v4 schemas continue to work unchanged — Zod v4 implements the required interfaces natively.

    import { type } from 'arktype';
    
    server.registerTool(
        'greet',
        {
            inputSchema: type({ name: 'string' })
        },
        async ({ name }) => ({ content: [{ type: 'text', text: `Hello, ${name}!` }] })
    );

    For raw JSON Schema (e.g. TypeBox output), use the new fromJsonSchema adapter:

    import { fromJsonSchema, AjvJsonSchemaValidator } from '@modelcontextprotocol/core';
    
    server.registerTool(
        'greet',
        {
            inputSchema: fromJsonSchema({ type: 'object', properties: { name: { type: 'string' } } }, new AjvJsonSchemaValidator())
        },
        handler
    );

    Breaking changes:

    • experimental.tasks.getTaskResult() no longer accepts a resultSchema parameter. Returns GetTaskPayloadResult (a loose Result); cast to the expected type at the call site.
    • Removed unused exports from @modelcontextprotocol/core: SchemaInput, schemaToJson, parseSchemaAsync, getSchemaShape, getSchemaDescription, isOptionalSchema, unwrapOptionalSchema. Use the new standardSchemaToJsonSchema and validateStandardSchema instead.
    • completable() remains Zod-specific (it relies on Zod's .shape introspection).
  • #1710 e563e63 Thanks @felixweinberger! - Add AuthProvider for
    composable bearer-token auth; transports adapt OAuthClientProvider automatically

    • New AuthProvider interface: { token(): Promise<string | undefined>; onUnauthorized?(ctx): Promise<void> }. Transports call token() before every request and onUnauthorized() on 401 (then retry once).

    • Transport authProvider option now accepts AuthProvider | OAuthClientProvider. OAuth providers are adapted internally via adaptOAuthProvider() — no changes needed to existing OAuthClientProvider implementations.

    • 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 OAuth onUnauthorized behavior.

    • New isOAuthClientProvider() type guard.

    • New UnauthorizedContext type.

    • 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. OAuthClientProvider itself is unchanged.

  • #1614 1a78b01 Thanks @pcarleton! - Apply resolved scope consistently
    to both DCR and the authorization URL (SEP-835)

    When scopes_supported is 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 request
    body, ensuring both use a consistent value.

    • registerClient() now accepts an optional scope parameter that overrides clientMetadata.scope in the registration body.
    • auth() now computes the resolved scope once (WWW-Authenticate → PRM scopes_supportedclientMetadata.scope) and passes it to both DCR and the authorization request.

Patch Changes

  • #1761 01954e6 Thanks @felixweinberger! - Convert remaining
    capability-assertion throws to SdkError(SdkErrorCode.CapabilityNotSupported, ...). Follow-up to v2: Errors refactor (ProtocolError, SdkError, OAuthError) #1454 which missed Client.assertCapability(), the task capability helpers in experimental/tasks/helpers.ts, and the sampling/elicitation capability checks in
    experimental/tasks/server.ts.

  • #1343 4b5fdcb Thanks @christso! - Fix OAuth error handling for servers
    returning 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 error field in the JSON response before attempting to parse it as tokens, providing users with meaningful error messages.

  • #1534 69a0626 Thanks @josefaidt! - remove npm references, use pnpm

  • #1386 00249ce Thanks @PederHP! - Respect capability negotiation in list
    methods 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 capability

    • listResources() returns { resources: [] } if server lacks resources capability

    • listResourceTemplates() returns { resourceTemplates: [] } if server lacks resources capability

    • listTools() returns { tools: [] } if server lacks tools capability

      This respects the MCP spec requirement that "Both parties SHOULD respect capability negotiation" and avoids unnecessary server warnings and traffic. The existing enforceStrictCapabilities option continues to throw errors when set to true.

  • #1534 69a0626 Thanks @josefaidt! - clean up package manager usage, all
    pnpm

  • #1595 13a0d34 Thanks @bhosmer-ant! - Don't swallow fetch TypeError
    as 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 real
    error to callers rather than masking it as "metadata not found."

  • #1279 71ae3ac Thanks @KKonstantinov! - Initial 2.0.0-alpha.0
    client and server package

@modelcontextprotocol/express@2.0.0

Patch Changes

@modelcontextprotocol/hono@2.0.0

Patch Changes

@modelcontextprotocol/node@2.0.0

Patch Changes

@modelcontextprotocol/core@2.0.0

Minor Changes

  • #1673 462c3fc Thanks @KKonstantinov! - refactor: extract task
    orchestration from Protocol into TaskManager

    Breaking changes:

    • taskStore, taskMessageQueue, defaultTaskPollInterval, and maxTaskQueueSize moved from ProtocolOptions to capabilities.tasks on ClientOptions/ServerOptions
  • #1389 108f2f3 Thanks @DePasqualeOrg! - Fix error handling for
    unknown tools and resources per MCP spec.

    Tools: Unknown or disabled tool calls now return JSON-RPC protocol errors with code -32602 (InvalidParams) instead of CallToolResult with isError: true. Callers who checked result.isError for 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 0784be1 Thanks @felixweinberger! - Support Standard Schema
    for 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, and RegisteredPrompt.argsSchema now use
    StandardSchemaWithJSON (requires both ~standard.validate and ~standard.jsonSchema) instead of the Zod-specific AnySchema type.

    Zod v4 schemas continue to work unchanged — Zod v4 implements the required interfaces natively.

    import { type } from 'arktype';
    
    server.registerTool(
        'greet',
        {
            inputSchema: type({ name: 'string' })
        },
        async ({ name }) => ({ content: [{ type: 'text', text: `Hello, ${name}!` }] })
    );

    For raw JSON Schema (e.g. TypeBox output), use the new fromJsonSchema adapter:

    import { fromJsonSchema, AjvJsonSchemaValidator } from '@modelcontextprotocol/core';
    
    server.registerTool(
        'greet',
        {
            inputSchema: fromJsonSchema({ type: 'object', properties: { name: { type: 'string' } } }, new AjvJsonSchemaValidator())
        },
        handler
    );

    Breaking changes:

    • experimental.tasks.getTaskResult() no longer accepts a resultSchema parameter. Returns GetTaskPayloadResult (a loose Result); cast to the expected type at the call site.
    • Removed unused exports from @modelcontextprotocol/core: SchemaInput, schemaToJson, parseSchemaAsync, getSchemaShape, getSchemaDescription, isOptionalSchema, unwrapOptionalSchema. Use the new standardSchemaToJsonSchema and validateStandardSchema instead.
    • completable() remains Zod-specific (it relies on Zod's .shape introspection).

Patch Changes

  • #1735 a2e5037 Thanks @felixweinberger! - Abort in-flight request
    handlers when the connection closes. Previously, request handlers would continue running after the transport disconnected, wasting resources and preventing proper cleanup. Also fixes InMemoryTransport.close() firing onclose twice on the initiating side.

  • #1574 379392d Thanks @olaservo! - Add missing size field to
    ResourceSchema to match the MCP specification

  • #1363 0a75810 Thanks @DevJanderson! - Fix ReDoS vulnerability in
    UriTemplate regex patterns (CVE-2026-0621)

  • #1761 01954e6 Thanks @felixweinberger! - Convert remaining
    capability-assertion throws to SdkError(SdkErrorCode.CapabilityNotSupported, ...). Follow-up to v2: Errors refactor (ProtocolError, SdkError, OAuthError) #1454 which missed Client.assertCapability(), the task capability helpers in experimental/tasks/helpers.ts, and the sampling/elicitation capability checks in
    experimental/tasks/server.ts.

  • #1486 65bbcea Thanks @localden! - Fix InMemoryTaskStore to enforce
    session 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 dcf708d Thanks @KKonstantinov! - remove deprecated .tool,
    .prompt, .resource method signatures

  • #1534 69a0626 Thanks @josefaidt! - remove npm references, use pnpm

  • #1534 69a0626 Thanks @josefaidt! - clean up package manager usage, all
    pnpm

  • #1419 dcf708d Thanks @KKonstantinov! - deprecated .tool, .prompt,
    .resource method removal

  • #1762 64897f7 Thanks @felixweinberger! -
    ReadBuffer.readMessage() now silently skips non-JSON lines instead of throwing SyntaxError. This prevents noisy onerror callbacks when hot-reload tools (tsx, nodemon) write debug output like "Gracefully restarting..." to stdout. Lines that parse as JSON but fail JSONRPC
    schema validation still throw.

@modelcontextprotocol/test-integration@2.0.0

Patch Changes

@github-actions github-actions bot requested a review from a team as a code owner January 22, 2026 10:42
@github-actions github-actions bot force-pushed the changeset-release/main branch 5 times, most recently from 3744138 to 44cb6da Compare January 23, 2026 18:37
@felixweinberger felixweinberger added needs more work Not ready to be merged yet, needs additional follow-up from the author(s). v2 Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes labels Jan 23, 2026
@felixweinberger felixweinberger marked this pull request as draft January 26, 2026 13:52
@github-actions github-actions bot force-pushed the changeset-release/main branch 3 times, most recently from 4022681 to 204cb9c Compare January 28, 2026 17:12
@github-actions github-actions bot force-pushed the changeset-release/main branch 14 times, most recently from 8d87726 to 74f739c Compare February 6, 2026 15:47
@github-actions github-actions bot force-pushed the changeset-release/main branch 4 times, most recently from c36ee9e to f72114f Compare February 10, 2026 23:36
@github-actions github-actions bot force-pushed the changeset-release/main branch 9 times, most recently from 7b3464e to 12f66d8 Compare February 24, 2026 21:57
@github-actions github-actions bot force-pushed the changeset-release/main branch 10 times, most recently from 5652354 to 6a20dfc Compare March 2, 2026 17:14
@github-actions github-actions bot force-pushed the changeset-release/main branch 9 times, most recently from 3c45260 to 1bdfa83 Compare March 9, 2026 18:17
@github-actions github-actions bot force-pushed the changeset-release/main branch from 1bdfa83 to fba4816 Compare March 12, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs more work Not ready to be merged yet, needs additional follow-up from the author(s). v2 Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant