unstale

npm / @mastra/mcp

@mastra/mcp

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

39 breaking7 security41 new APIs and options2 performance11 behavior and defaults27 fixes and other

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

npx @unstale/cli init

@unstale/cli 0.2.2 on npm

@mastra/mcp 266 changes

Breaking changes 34

  • @mastra/mcp requires @mastra/core 1.79.0 or later; upgrade the core package together with @mastra/mcp and @mastra/connect.

    2.5.0release notes

  • @mastra/mcp now requires @mastra/core 1.76.0 or later.

    2.2.0release notesrelease notes

  • The connectSSE API has been removed.

    2.0.0release notes

  • Tools that need caller input suspend with a payload and return; after the caller replies, the tool runs again with context.resumeData and context.suspendPayload.

    2.0.0release notes

  • Elicitation actions have been removed.

    2.0.0release notes

  • The method throws on a 2.0 server; caller-input workflows should use the suspend-and-resume flow instead.

    2.0.0release notes

  • The eventSourceInit setting has been removed.

    2.0.0release notes

  • The method throws on a 2.0 server.

    2.0.0release notes

  • The method throws on a 2.0 server.

    2.0.0release notes

  • The getServer API has been removed.

    2.0.0release notes

  • The handleServerlessRequest API has been removed.

    2.0.0release notes

  • The Hono dependency and peer ranges were raised to address a security advisory.

    2.0.0release notes

  • MCPClient server definitions accept a per-server inputRequests handler in place of mcp.elicitation.onRequest().

    2.0.0release notes

  • Log levels are now requested per request through this metadata key.

    2.0.0release notes

  • The logging/setLevel API has been removed.

    2.0.0release notes

  • This release requires @mastra/core 1.68 or newer.

    2.0.0release notes

  • MastraApiMCPServer was removed while its tool design is reconsidered.

    2.0.0release notes

  • Servers now serve only the MCP 2026-07-28 revision. Requests are self-contained, with no initialize handshake, session header, ping, or standalone HTTP+SSE transport; Streamable HTTP responses still stream as Server-Sent Events.

    2.0.0release notes

  • Requires exactly one of clientInformation or clientMetadataUrl and no longer registers dynamically.

    2.0.0release notes

  • The OAuthClientRegistrationError API has been removed.

    2.0.0release notes

  • The server protocolVersion option has been removed.

    2.0.0release notes

  • The reconnectionOptions setting has been removed.

    2.0.0release notes

  • The registerClient API has been removed.

    2.0.0release notes

  • The resources/subscribe API has been removed.

    2.0.0release notes

  • The signature remains, but subscriptions now ride one subscriptions/listen stream per server.

    2.0.0release notes

  • The signature remains, but subscriptions now ride one subscriptions/listen stream per server.

    2.0.0release notes

  • The roots API has been removed.

    2.0.0release notes

  • The sampling API has been removed.

    2.0.0release notes

  • The sendLoggingMessage API has been removed.

    2.0.0release notes

  • Returns a suspended or completed status object, and invalid input is answered with an error instead of a completed result.

    2.0.0release notes

  • The sessionId API has been removed.

    2.0.0release notes

  • The sessionIds API has been removed.

    2.0.0release notes

  • The startHonoSSE API has been removed.

    2.0.0release notes

  • The startSSE API has been removed.

    2.0.0release notes

Security 2

  • MCPClient can register a webhook URL and route requests to mcp.events.handleWebhook(); subscriptions prefer webhook delivery, verify signatures, and refresh before expiry.

    2.5.0release notes

  • Tool schemas are advertised and validated as JSON Schema 2020-12; untrusted schemas are bounded to 128 levels and 10,000 nodes.

    2.0.0release notes

New APIs and options 15

  • Servers can enable experimental webhook delivery for emitted event types; callers must authenticate, and callback URLs must be public HTTPS URLs that pass a verification challenge.

    2.5.0release notes

  • MCPServer exposes declared event descriptors to Studio, including whether each event type can be emitted.

    2.5.0release notes

  • MCPServer provides a Studio inspector that polls and streams events through the same code path as protocol requests and can send test events.

    2.5.0release notes

  • Clients can list and subscribe to events advertised by MCP servers, with push or poll delivery, cursor resumption, duplicate suppression, and reconnect handling.

    2.5.0release notes

  • The experimental provider delivers MCP server events to agent threads as untrusted notifications, sharing subscriptions across threads and supporting pluggable cursor storage and optional event-management tools.

    2.5.0release notes

  • MCPServer can declare and emit experimental MCP Events; clients can poll or stream occurrences, with optional argument matching and authorization.

    2.5.0release notes

  • Set traceContext on the server configuration to send custom trace context or none.

    2.4.0release notes

  • Set the client name and version MCP servers receive on connect and with each request, globally or per server, instead of the server key and 1.0.0.

    2.3.0release notes

  • Returns the identity announced by each connected MCP server, including its name and version and optional display metadata; entries are undefined before connection or when no identity was announced.

    2.2.0release notes

  • MCPServer announces title, description, websiteUrl, and icons to MCP clients alongside name and version, enabling clients to display richer server identity.

    2.2.0release notes

  • MCPServer publishes tool titles, and tools returned by MCPClient retain the server title or fall back to annotations.title.

    2.1.0release notes

  • Adds a root span for each request handled by MCPServer and for executeTool(); served requests are traced when the server is registered on a Mastra instance with observability configured.

    2.0.0release notes

  • The client probes servers with server/discover and falls back to the legacy handshake unless protocolVersion pins '2026-07-28' or 'legacy'; getServerProtocolVersions() reports the outcome.

    2.0.0release notes

  • Configure a shared key to sign continuation state so resumed rounds can be answered by any process; without it, rounds can only resume on the process that started them.

    2.0.0release notes

  • Server definitions accept a traceContext provider, and received W3C trace fields are exposed to tools through requestContext.

    2.0.0release notes

Behavior and default changes 6

  • With onToolError: 'return', failed calls resolve with the full CallToolResult instead of only structuredContent, so callers can inspect isError and content.

    2.5.0release notes

  • With the default onToolError: 'throw', thrown MastraError instances include the structured reason as a JSON string in details.structuredContent.

    2.5.0release notes

  • MCP tools declaring an outputSchema now pass embedded resource block text to the model along with text blocks; structuredContent remains excluded.

    2.4.1release notes

  • MCPClient propagates the tool call span's W3C trace context to MCPServer and links the client and server spans, making it possible to move between their traces.

    2.4.0release notes

  • MCP continuation keys are now generated with Web Crypto.

    2.1.2release notes

  • MCPClient now accepts tools from other MCP servers that describe their inputs with JSON Schema draft 2019-09.

    2.1.1release notes

Fixes and other changes 9

  • The handler now registers and fires for MCP servers on older protocol revisions, and reconnecting no longer logs a subscriptions/listen failure.

    2.5.0release notes

  • The handler now registers and fires for MCP servers on older protocol revisions, and reconnecting no longer logs a subscriptions/listen failure; resource subscriptions still require revision 2026-07-28.

    2.5.0release notes

  • The handler now registers and fires for MCP servers on older protocol revisions, and reconnecting no longer logs a subscriptions/listen failure.

    2.5.0release notes

  • @mastra/mcp declares zod as a peer dependency, at the minimum version already required by @modelcontextprotocol/ext-apps.

    2.5.0release notes

  • Malformed or oversized tool input schemas are skipped with a warning so other tools remain usable; toolsFromDefinitions skips cached definitions, while toolFromDefinition throws MCP_CLIENT_INVALID_TOOL_INPUT_SCHEMA.

    2.4.1release notes

  • Disconnecting a replaced MCPClient no longer prevents reuse of the replacing client when both share an id.

    2.3.0release notes

  • Resource read results now include the optional mimeType and _meta fields, preserving content type and metadata such as MCP App UI settings.

    2.2.0release notes

  • Successful tool call results now include the tool's UI resource link under nested and legacy flat keys, so hosts can open MCP Apps from call results; flat-key-only tools also advertise the MCP Apps extension.

    2.2.0release notes

  • MCP tool calls no longer fail with a schema validation error when tools are defined with zod v3 schemas.

    2.1.1release notes

@mastra/mcp 161 changes

Breaking changes 5

  • MCP now requires @mastra/core 1.64 or newer to use its tool output validation API.

    1.17.3release notes

  • Custom jsonSchemaValidator implementations must now be imported from the MCP client validators path instead of the SDK validation path.

    1.16.0release notes

  • Resource subscriptions are tracked per session; updates only reach sessions subscribed to the URI, so clients must subscribe before receiving resource update notifications.

    1.14.0release notes

  • Per server, onToolError: 'return' opts into resolving with the raw result instead of throwing; the default is 'throw'.

    1.13.0release notes

  • MCP tool results with isError: true now follow the failed-tool-call path and throw the server's error text, so failures are reflected in traces, stream chunks, scorers, and persisted messages.

    1.13.0release notes

Security 5

  • Prompts no longer leak across authenticated callers.

    1.17.2release notes

  • Notification text now escapes backslashes, and osascript runs without a shell so notification text can't inject commands.

    1.13.0release notes

  • MCP serverless 500 responses no longer echo internal error messages to clients; details are still logged server-side.

    1.13.0release notes

  • Clean versions were published to supersede compromised versions that declared the malicious easy-day-js dependency, and the latest dist-tag was moved forward.

    1.10.1release notes

  • Opt in to forwarding instructions advertised by an MCP server into the system prompts of agents that use its tools; defaults to false.

    1.9.0release notes

New APIs and options 26

  • Read the existing hidden MCP content channel through an exported helper.

    1.17.2release notes

  • Read result-level _meta from returned structured MCP tool results; metadata is now preserved for consumers such as MCP Apps hosts.

    1.17.2release notes

  • Servers can optionally advertise ttlMs and cacheScope on cacheable results such as tools/list.

    1.17.0release notes

  • The 2026-07-28 protocol revision supports multi-round-trip elicitation; tool calls retry after clients answer, and elicitation.onRequest() handles requests on both protocol eras.

    1.17.0release notes

  • MCP discovery methods accept per-server time budgets and return duration metrics.

    1.17.0release notes

  • MCPServer and the MCP client can opt into protocol revision 2026-07-28; omitting the flag keeps existing behavior unchanged.

    1.17.0release notes

  • Custom middleware can use this server.mcpOptions hook to build request auth info when it verifies the caller.

    1.17.0release notes

  • HTTP server configs can restrict which hosts the client's requests may target, including during initial connection, SSE fallback, and OAuth discovery.

    1.16.0release notes

  • Setting inheritDefaultEnv to false prevents stdio subprocesses from inheriting SDK default environment variables; only entries listed in env are passed.

    1.16.0release notes

  • Exports the MCP tool catalog as JSON-serializable definitions grouped by server and keyed by tool name, allowing it to be cached and reused.

    1.16.0release notes

  • Reports per-server failures alongside tool definitions so partial catalogs are not cached silently.

    1.16.0release notes

  • Rebuilds a single executable tool from a cached definition; hydrated tools connect lazily on first execution.

    1.16.0release notes

  • Rebuilds a namespaced tool map from definitions, matching the serverName_toolName keys from listTools().

    1.16.0release notes

  • Adds an end-to-end interactive OAuth authorization-code flow for HTTP MCP servers, including token exchange and reconnection.

    1.15.0release notes

  • Exports the local loopback OAuth callback server for hosts that need custom redirect handling.

    1.15.0release notes

  • Exposes the server authentication state, including needs-auth when an HTTP MCP server rejects a connection with an authorization error.

    1.15.0release notes

  • Adds a way for a tool to send a log notification to the client that called it.

    1.14.0release notes

  • Adds a way for tools to report progress to the calling client.

    1.14.0release notes

  • Adds a client callback for reacting to server tool-list changes.

    1.14.0release notes

  • Adds server-side log notifications that can be broadcast to connected clients; each session's minimum level set through logging/setLevel is honored.

    1.14.0release notes

  • Adds request-scoped SSE streaming in serverless mode so progress notifications reach the MCP client before the final result; the default JSON-response behavior is unchanged.

    1.14.0release notes

  • Adds runtime tool management and list-change notification methods; when registered with Mastra, dynamic additions and removals also synchronize the Mastra tool registry.

    1.14.0release notes

  • Adds a method that returns namespaced tools alongside per-server discovery errors, allowing applications to use discovered tools and inspect failures.

    1.12.0release notes

  • The new fga option customizes resource and permission mappings for tools/list and tools/call authorization checks without changing the Mastra instance-level tool mapping.

    1.10.0release notes

  • Inspect cached server instructions without forwarding them to agent prompts.

    1.9.0release notes

  • Set the maximum number of characters forwarded per server.

    1.9.0release notes

Performance 2

  • CHANGELOG.md is no longer included in distributed npm files, reducing package size.

    1.17.3release notes

  • Discovery methods query configured servers concurrently rather than sequentially, reducing total discovery time and preventing a slow server from stalling the rest; ordering and per-server error reporting are unchanged.

    1.15.1release notes

Behavior and default changes 5

  • MCP tools over HTTP now receive the authenticated user in extra.authInfo when server.auth is configured, on streamable HTTP and SSE transports.

    1.17.0release notes

  • Resource updates and resource/prompt list changes now reach clients connected over streamable HTTP, with notifications broadcast to every connected session across all transports.

    1.14.0release notes

  • MCP no longer relies on core-bundled Hono context types at package boundaries; request types support standard Request objects and Hono-compatible request shapes.

    1.9.1release notes

  • Image and audio content parts in MCP-style tool results are converted into model-native media output when building model prompts, without requiring duplicate media payloads in providerMetadata.mastra.modelOutput.

    1.9.0release notes

  • The global option on agent.stream and agent.generate now accepts a function as well as a boolean; the function is evaluated per tool call, and errors default to requiring approval.

    1.9.0release notes

Fixes and other changes 18

  • MCP tools rebuilt from cached catalogs and live-discovered tools now validate structured results against their output schema before sending them to the model.

    1.17.3release notes

  • Aggregate MCP discovery errors preserve structured HTTP status and transport codes while retaining legacy string errors.

    1.17.2release notes

  • Fixed tool listing when a tool has no input schema.

    1.17.1release notes

  • Declared the MCP SDK v1 peer required by @modelcontextprotocol/ext-apps as a direct dependency, preventing import failures when automatic peer installation is skipped.

    1.17.1release notes

  • In-band tool errors containing transport-like words are no longer mistaken for transport failures that trigger reconnects and retries, preventing duplicate calls.

    1.16.0release notes

  • Tool schemas advertised over MCP no longer declare a draft-07 $schema dialect, avoiding rejection by the MCP 2.0 default validator.

    1.16.0release notes

  • After a transport-level reconnect fails, callers receive the actual reconnection error rather than the stale error that triggered recovery.

    1.16.0release notes

  • Corrects fallback handling for non-OK Streamable HTTP responses so servers that only support HTTP+SSE can be reached.

    1.16.0release notes

  • MCP tools with outputSchema send LLM-facing content text to the model through toModelOutput while retaining structuredContent in tool.execute() results.

    1.16.0release notes

  • Concurrent MCP tool calls no longer fail while the client reconnects after a dropped connection.

    1.15.1release notes

  • listTools(), callTool(), and forceReconnect() work again after a failed reconnect once the server is reachable.

    1.15.0release notes

  • Fixes MCP clients advertising elicitation support before a handler is registered.

    1.14.0release notes

  • Preserves a resource's _meta in resources/read results, allowing clients to receive metadata such as UI CSP settings.

    1.14.0release notes

  • MCP tools that declare outputSchema now expose it on the Mastra tool wrapper, allowing Studio and other consumers to document expected outputs.

    1.13.1release notes

  • MCPClient can now be safely imported on workerd without causing Cloudflare Workers to fail during module initialization.

    1.12.1release notes

  • FGA-enabled MCP servers can map OAuth authInfo to a Mastra user before tools/list and tools/call authorization.

    1.9.0release notes

  • The stale MCP transport is closed before reconnecting, preventing orphaned EventSource instances and accumulated server-side sessions on implicit reconnect.

    1.9.0release notes

  • MCP tools wrapping a server-level requireToolApproval function now preserve and honor the per-tool approval function when converted by the agent.

    1.9.0release notes