unstale

npm / @ai-sdk/mcp

@ai-sdk/mcp

What changed in @ai-sdk/mcp 1 to 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.

5 breaking7 security9 new APIs and options3 behavior and defaults12 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

@ai-sdk/mcp 233 changes

Breaking changes 5

  • Managed event subscription creation now requires ttlMs as a millisecond duration or null instead of accepting expiresAt; responses still include the backend-calculated expiresAt deadline.

    2.0.76release notes

  • Rejects invalid or missing adapter operations, nullish results, and Promise or thenable results with MCPClientError before the transport starts.

    2.0.73release notes

  • Pass an integration implementing createAdapter instead of passing subscription operations directly; existing operations can be wrapped with { createAdapter: () => operations }.

    2.0.73release notes

  • The configured integration type is now Experimental_MCPEventAdapter and requires implementing createAdapter.

    2.0.73release notes

  • The former subscription operations interface is renamed to Experimental_MCPEventOperations; update imports and operation type annotations.

    2.0.73release notes

Security 6

  • Prevents authorization server paths beginning with repeated slashes from bypassing validation.

    1.0.92, 2.0.70release notesrelease notes

  • Failed OAuth tokens are identified for conditional invalidation.

    2.0.65release notes

  • Pre-registered OAuth clients are preserved after client authentication errors, and dynamically registered credentials are replaced only with explicit provider provenance.

    1.0.85, 2.0.55release notesrelease notes

  • DNS validation and connection pinning remain in place when frameworks or instrumentation wrap global fetch before or after the SDK loads.

    0.0.39, 1.0.90, 2.0.51release notesrelease notesrelease notes

  • Prevents SSRF in OAuth metadata discovery.

    0.0.39, 1.0.90, 2.0.49release notesrelease notesrelease notes

  • OAuth client registration is hardened according to the latest protocol.

    2.0.33release notes

New APIs and options 8

  • Experimental event adapters implement synchronous createAdapter({ transport }) to receive the configured transport description and return bound subscription operations, so applications no longer configure the endpoint twice.

    2.0.73release notes

  • Adds experimental adapters for backend-owned subscription lifecycles without a local event store.

    2.0.70release notes

  • Adds an exclusive configuration union that distinguishes managed and direct event APIs from a single MCPClientConfig.

    2.0.70release notes

  • Adds compatibility for webhook-based MCP events.

    2.0.70release notes

  • Exports MCPClientError for typed MCP failure handling.

    2.0.67release notes

  • Adds an error for OAuth authorization server pin mismatches.

    2.0.66release notes

  • Adds the foundation for the latest 2026 protocol discovery.

    2.0.33release notes

  • Adds support for MCP 2026 streamable HTTP.

    2.0.33release notes

Behavior and default changes 2

  • Renames the unreleased client event configuration to experimental_events.

    2.0.70release notes

  • Server-provided tool annotations are now surfaced in tool metadata.

    1.0.78, 2.0.45release notesrelease notes

Fixes and other changes 12

@ai-sdk/mcp 13 changes

Security 1

  • Private OAuth endpoints are rejected before credentials are sent, preventing credential disclosure.

    0.0.39, 1.0.75release notesrelease notes

New APIs and options 1

  • OAuthClientProvider.invalidateCredentials accepts optional token context so providers sharing storage can atomically delete only the rejected token generation and preserve tokens saved by a concurrent refresh.

    1.0.91release notes

Behavior and default changes 1

  • MCP scope selection now applies to dynamic client registration as well as authorization.

    1.0.75release notes