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@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.
Rejects invalid or missing adapter operations, nullish results, and Promise or thenable results with MCPClientError before the transport starts.
Pass an integration implementing createAdapter instead of passing subscription operations directly; existing operations can be wrapped with { createAdapter: () => operations }.
The configured integration type is now Experimental_MCPEventAdapter and requires implementing createAdapter.
The former subscription operations interface is renamed to Experimental_MCPEventOperations; update imports and operation type annotations.
Security 6
Prevents authorization server paths beginning with repeated slashes from bypassing validation.
Failed OAuth tokens are identified for conditional invalidation.
Pre-registered OAuth clients are preserved after client authentication errors, and dynamically registered credentials are replaced only with explicit provider provenance.
DNS validation and connection pinning remain in place when frameworks or instrumentation wrap global fetch before or after the SDK loads.
Prevents SSRF in OAuth metadata discovery.
OAuth client registration is hardened according to the latest protocol.
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.
Adds experimental adapters for backend-owned subscription lifecycles without a local event store.
Adds an exclusive configuration union that distinguishes managed and direct event APIs from a single MCPClientConfig.
Adds compatibility for webhook-based MCP events.
Exports MCPClientError for typed MCP failure handling.
Adds an error for OAuth authorization server pin mismatches.
Adds the foundation for the latest 2026 protocol discovery.
Adds support for MCP 2026 streamable HTTP.
Behavior and default changes 2
Renames the unreleased client event configuration to experimental_events.
Server-provided tool annotations are now surfaced in tool metadata.
Fixes and other changes 12
MCP tools can now execute without options.
Preserves OAuth credentials when callback codes are rejected.
Rejects startup when the connection closes before an endpoint is received.
Preserves prototype-named tools, providers, and provider metadata as own properties without changing lookup object prototypes, preventing inherited names from resolving as registered providers or breaking image metadata aggregation.
Explicit environment values for the stdio transport are now preserved.
Avoids duplicate OAuth refreshes for stale 401 responses in legacy SSE.
OAuth callbacks use the stored authorization server when protected resource metadata rediscovery fails.
MCP tool results can return structuredContent without content; the serialized structured result is added as text.
Origin-only OAuth issuers now accept trailing slashes.
Creating an MCP tool set now fetches all paginated tool definitions.
Command shims such as npx can now be spawned on Windows.
Rejects SSE requests when POST responses are unsuccessful.
@ai-sdk/mcp 13 changes
Security 1
Private OAuth endpoints are rejected before credentials are sent, preventing credential disclosure.
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.
Behavior and default changes 1
MCP scope selection now applies to dynamic client registration as well as authorization.