Skip to content

fix(deps): update dependency @mastra/mcp to v1#50

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/mastra-mcp-1.x
Open

fix(deps): update dependency @mastra/mcp to v1#50
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/mastra-mcp-1.x

Conversation

@renovate

@renovate renovate Bot commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

ℹ️ Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
@mastra/mcp (source) ^0.11.0^1.0.0 age confidence

Release Notes

mastra-ai/mastra (@​mastra/mcp)

v1.10.0

Compare Source

Minor Changes
  • Added MCP server Fine-Grained Authorization mapping overrides for tool authorization. (#​17529)

    Use the new fga option on MCPServer to customize the resource and permission mappings used for tools/list and tools/call checks without changing the Mastra instance-level tool mapping used by internal agent and workflow tool execution.

    const server = new MCPServer({
      name: 'My Server',
      version: '1.0.0',
      tools: { getData },
      fga: {
        resourceMapping: {
          tool: {
            fgaResourceType: 'user',
            deriveId: ({ user }) => user.id,
          },
        },
        permissionMapping: {
          'tools:execute': 'read',
        },
      },
    });
Patch Changes

v1.9.1

Compare Source

Patch Changes

v1.9.0

Compare Source

Minor Changes
  • Added opt-in MCP server instructions forwarding into agent system prompts. (#​17155)

    When an MCP server advertises instructions during initialization, you can now forward that guidance into the system prompt of agents that use the server's tools. This is opt-in — set forwardInstructions: true per server to enable it. Forwarded instructions are injected into the agent's system prompt, so only enable this for servers you trust.

    const mcp = new MCPClient({
      servers: {
        db: {
          url: new URL('http://localhost:4111/mcp'),
          forwardInstructions: true, // opt in; defaults to false
          instructionsMaxLength: 512, // max chars forwarded per server
        },
      },
    });
    
    const agent = new Agent({
      id: 'db-agent',
      name: 'DB Agent',
      instructions: 'Help with database changes.',
      model,
      tools: await mcp.listTools(),
    });

    You can always inspect cached instructions without forwarding them:

    const instructions = mcp.getServerInstructions();
    // => { db: 'Always validate before migrating.', other: undefined }
  • Added native multimodal tool-result support. Core now converts MCP-style tool results with image and audio content parts into model-native media output when building model prompts, without requiring MCP tools to persist duplicate media payloads in providerMetadata.mastra.modelOutput. (#​16866)

    return {
      content: [
        { type: 'text', text: 'Screenshot captured' },
        { type: 'image', data: base64Png, mimeType: 'image/png' },
      ],
    };
Patch Changes
  • Support conditional, function-based tool approvals. (#​17337)

    • MCP tools that wrap a server-level requireToolApproval function are now honored end-to-end. The per-tool approval function was previously dropped when the agent converted MCP tools (it kept only the boolean flag), so conditional approval silently fell back to always-on. CoreToolBuilder now preserves a needsApprovalFn attached directly to a tool instance.
    • The global requireToolApproval option on agent.stream/agent.generate now accepts a function in addition to a boolean. It is evaluated per tool call with the tool name, arguments, and request context, enabling policies such as regex allowlists on tool names. Returning true requires approval for that call; false allows it. On error the call defaults to requiring approval. When a function policy is set, tool calls run sequentially so approval suspensions don't race. Durable agents and stored agents continue to accept only a boolean (a function degrades to requiring approval for every call, since their options must be serializable).
    // Approve only tool calls whose name is not on an allowlist.
    const allowlist = /^(get|list|search)_/;
    await agent.generate('...', {
      requireToolApproval: ({ toolName }) => !allowlist.test(toolName),
    });
    • Precedence is unchanged from before: a per-tool approval function (createTool({ requireApproval: fn }) or an MCP-derived needsApprovalFn) is authoritative for that tool and overrides the global setting, so a tool can still opt out of approval by returning false even when the global option is on. The only new behavior is that the global option may now be a function in addition to a boolean.
    • The previously implicit, runtime-attached per-tool approval predicate is now a typed contract: @mastra/core exports NeedsApprovalFn and declares the optional needsApprovalFn property on the Tool class. The MCP client and the agent runtime now share this typed contract instead of reaching through any. This is additive — no public API changes.
  • Close the stale MCP transport before reconnecting so SSE connections no longer leak orphaned EventSource instances and accumulate server-side sessions on implicit reconnect. (#​17326)

  • Fixed FGA-enabled MCP servers so OAuth authInfo can be mapped to a Mastra user before tools/list and tools/call authorization. (#​17475)

  • Updated dependencies [fa63872, d779de3, 1750c97, 9283971, f07b646, d8838ae, 40f9297, 19a8658, 850af77, 0f0d1ba, a18775a, 1baf2d1, 8c31bcd, 0e32507, 95b14cd, 07c3de7, 0bf2d93, 7b0d34c, a659a77, aa36be2, 3332be9, 212c635, d8838ae, 9aa5a73, f73c789, 8bd16da, c8630f8, 94dfef6, 47f71dc, 50ceae2, a122f79, 8cdde58, 3a081c1, 49f8abc, 847ff1e, 0c1ed1d, 259d409, 9e16c68, cefca33, d00e8c5, 36fa7e2, 87e9774, 65a72e7, fe9eacd, 4c02027, 0f77241, 849efb9, 92ff509, 3fce5e7, a763592, db79c86, 6855012, 80c7737, 7fef31c, 7fef31c, 3f1cf47]:

v1.8.1

Compare Source

Patch Changes

v1.8.0

Compare Source

Minor Changes
  • Added MCP tool annotations to the requireToolApproval context and exposed them on tools returned from listTools() / listToolsets(). (#​16784)

    The requireToolApproval callback now receives the server-advertised annotations (title, readOnlyHint, destructiveHint, idempotentHint, openWorldHint) alongside toolName and args. This lets you write declarative approval policies instead of hardcoding tool name lists. Annotations are also propagated onto Mastra tools as tool.mcp.annotations so apps can render them in UI.

    Security caveat (per the MCP spec): annotations are hints, not guarantees. Clients MUST treat them as untrusted unless they come from a trusted server. Do not use annotations alone as a security boundary for servers you do not control — set requireToolApproval: true for those. When the server omits annotations entirely, this field is undefined, so policies can distinguish "no annotations" from "annotated as safe".

    import { MCPClient } from '@​mastra/mcp';
    
    // Before — hardcoded tool name lists, server-specific
    const mcp = new MCPClient({
      servers: {
        github: {
          url: new URL('https://example.com/mcp'),
          requireToolApproval: ({ toolName }) => toolName === 'delete_repo',
        },
      },
    });
    
    // After — annotation-driven, works across any trusted MCP server
    const mcp = new MCPClient({
      servers: {
        github: {
          url: new URL('https://example.com/mcp'),
          requireToolApproval: ({ annotations }) => {
            if (!annotations) return true;
            if (annotations.readOnlyHint) return false;
            if (annotations.destructiveHint) return true;
            return false;
          },
        },
      },
    });
    
    // Annotations are also visible on tools returned by listTools()
    const tools = await mcp.listTools();
    for (const tool of Object.values(tools)) {
      console.log(tool.mcp?.annotations);
    }

    Closes #​16766.

Patch Changes

v1.7.0

Compare Source

Minor Changes
  • Added MCP Apps support for interactive UI rendering over MCP. (#​16004)

    MCPClientServerProxy — a lightweight proxy that delegates resource and tool operations to remote MCP servers via MCPClient, enabling Studio to fetch app resources from any connected server.

    toMCPServerProxies() — new convenience method on MCPClient that creates proxy objects for all configured servers, ready for Mastra-level registration.

    Automatic serverId stamping — tools returned by listTools() now carry _meta.ui.serverId, allowing consumers to resolve ui:// app resources from the correct MCP server in multi-server environments.

    const mcp = new MCPClient({
      servers: {
        myApps: { url: new URL('https://my-mcp-server.example.com/mcp') },
      },
    });
    
    const mastra = new Mastra({
      agents: { myAgent },
      mcpServers: { ...mcp.toMCPServerProxies() },
    });
  • Added MCP Apps extension support (SEP-1865). MCPServer now accepts an appResources config to register interactive ui:// HTML resources. MCPClient preserves full tool _meta (including ui.resourceUri) when converting MCP tools to Mastra tools. Both advertise the io.modelcontextprotocol/ui extension capability. (#​16004)

    Example — MCPServer with app resources:

    const server = new MCPServer({
      name: 'my-server',
      tools: { myTool },
      appResources: {
        dashboard: {
          name: 'Dashboard',
          description: 'Interactive dashboard UI',
          html: '<html>...</html>',
        },
      },
    });
Patch Changes

v1.6.0

Compare Source

Minor Changes
  • Added jsonSchemaValidator pass-through option on MCPClient server entries and MCPServer. Forward this option from @modelcontextprotocol/sdk to opt into a non-default validator. Pass CfWorkerJsonSchemaValidator from @modelcontextprotocol/sdk/validation/cfworker to make tools with outputSchema work in Cloudflare Workers / V8 isolates, where the default Ajv validator's new Function(...) compile path is blocked. (#​15866)

    import { MCPClient, MCPServer } from '@&#8203;mastra/mcp';
    import { CfWorkerJsonSchemaValidator } from '@&#8203;modelcontextprotocol/sdk/validation/cfworker';
    
    const mcp = new MCPClient({
      servers: {
        upstream: {
          url: new URL('https://example/mcp'),
          jsonSchemaValidator: new CfWorkerJsonSchemaValidator(),
        },
      },
    });
    
    const server = new MCPServer({
      name: 'My Server',
      version: '1.0.0',
      tools: { ... },
      jsonSchemaValidator: new CfWorkerJsonSchemaValidator(),
    });

    Closes #​15862.

Patch Changes

v1.5.2

Compare Source

Patch Changes

v1.5.1

Compare Source

Patch Changes

v1.5.0

Compare Source

Minor Changes
  • Added requireToolApproval option to MCP server configuration for requiring human approval before tool execution. Supports both boolean (all tools) and function (dynamic per-tool logic). (#​15315)
Patch Changes

v1.4.2

Compare Source

Patch Changes
  • Improved MCP tool discovery to retry once after reconnectable connection errors like Connection closed during tools/list. (#​15141)

    MCPClient.listToolsets(), listToolsetsWithErrors(), and listTools() now attempt a reconnect before treating transient discovery failures as missing tools.

  • Fixed MCP server to return HTTP 404 (instead of 400) when a client sends a stale or unknown session ID. Per the MCP spec, this tells clients to re-initialize with a new session, which fixes broken tool calls after server redeploys. (#​15160)

  • Updated dependencies [8db7663, 153e864, 715710d, 378c6c4, 9f91fd5, ba6fa9c]:

v1.4.1

Compare Source

Patch Changes
  • Standardized all logger calls across the codebase to use static string messages with structured data objects. Dynamic values are now passed as key-value pairs in the second argument instead of being interpolated into template literal strings. This improves log filterability and searchability in observability storage. (#​14899)

    Removed ~150 redundant or noisy log calls including duplicate error logging after trackException and verbose in-memory storage CRUD traces.

  • Updated dependencies [cbeec24, cee146b, aa0aeff, 2bcec65, ad9bded, cbeec24, 208c0bb, f566ee7]:

v1.4.0

Compare Source

Minor Changes
  • Added support for passing custom _meta metadata when calling tools on external MCP servers. The execute context now accepts an optional _meta field with arbitrary key-value pairs that are forwarded in the callTool request, enabling use cases like distributed tracing, compliance tagging, and multi-tenant routing. Custom _meta is merged with the progress token when progress tracking is enabled. (#​14809)

    const tools = await mcpClient.tools();
    await tools['my_tool'].execute({ query: 'active users' }, { _meta: { traceId: 'span-456', tenantId: 'org-123' } });

    When enableProgressTracking is enabled, the progressToken is automatically merged into _meta alongside your custom fields.

Patch Changes

v1.3.2

Compare Source

Patch Changes

Note

PR body was truncated to here.


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot force-pushed the renovate/mastra-mcp-1.x branch from 82fa005 to c918bb0 Compare January 22, 2026 07:20
@renovate renovate Bot force-pushed the renovate/mastra-mcp-1.x branch 3 times, most recently from 5c7c7a0 to d4cd4dc Compare February 17, 2026 18:41
@renovate renovate Bot force-pushed the renovate/mastra-mcp-1.x branch 3 times, most recently from e16d39b to 4d05e36 Compare March 4, 2026 15:08
@renovate renovate Bot force-pushed the renovate/mastra-mcp-1.x branch 3 times, most recently from cadf916 to 944e923 Compare March 12, 2026 04:59
@renovate renovate Bot force-pushed the renovate/mastra-mcp-1.x branch 3 times, most recently from 5eb4d2a to ce86bb7 Compare March 20, 2026 12:41
@renovate renovate Bot force-pushed the renovate/mastra-mcp-1.x branch 3 times, most recently from a469e50 to a089d71 Compare April 1, 2026 00:50
@renovate renovate Bot force-pushed the renovate/mastra-mcp-1.x branch 2 times, most recently from 0d5a094 to b79563b Compare April 12, 2026 12:23
@renovate renovate Bot force-pushed the renovate/mastra-mcp-1.x branch 2 times, most recently from fb5aeb2 to 86d6d31 Compare April 22, 2026 04:51
@renovate renovate Bot force-pushed the renovate/mastra-mcp-1.x branch 2 times, most recently from 9244436 to f1a8913 Compare April 29, 2026 00:55
@renovate renovate Bot force-pushed the renovate/mastra-mcp-1.x branch from f1a8913 to 5b75a61 Compare May 4, 2026 22:47
@renovate renovate Bot force-pushed the renovate/mastra-mcp-1.x branch 2 times, most recently from 7102a85 to 756c032 Compare May 18, 2026 12:11
@renovate renovate Bot force-pushed the renovate/mastra-mcp-1.x branch 2 times, most recently from 9a7e82f to 0a43fc9 Compare May 27, 2026 05:43
@renovate renovate Bot force-pushed the renovate/mastra-mcp-1.x branch 3 times, most recently from 8b3e6ef to 68b731b Compare June 3, 2026 20:13
@renovate renovate Bot force-pushed the renovate/mastra-mcp-1.x branch 2 times, most recently from f7b78f0 to 313a1ef Compare June 17, 2026 01:47
@renovate renovate Bot force-pushed the renovate/mastra-mcp-1.x branch from 313a1ef to 28bbafe Compare June 17, 2026 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants