Skip to content

Interface: MastraMcpConfig

Fine-grained control for the optional MCP server exposure (MastraPluginConfig.mcp). Every field is optional; the object form only needs to set what differs from the defaults.

optional agents?: boolean

Expose every registered agent as an ask_<agentId> MCP tool. Defaults to true - this is the “leverage the Mastra agents over MCP” behavior most callers want.


optional description?: string

Optional human-readable description advertised over MCP.


optional extraTools?: ToolsInput

Extra tools to expose over MCP beyond the agent / ambient sets. Use this for tools written specifically for MCP consumers.


optional name?: string

Display name advertised over MCP. Defaults to "<displayName> MCP".


optional serverId?: string

Server id used in the route path (/mcp/<serverId>/...) and as the MCP registry id. Defaults to the plugin’s registered name.


optional tools?: boolean

Also expose the plugin’s ambient tools (the built-in render_data plus anything in config.tools) as MCP tools. Defaults to false: the ambient tools assume an in-process chat turn (they publish writer events the chat UI consumes), so they aren’t useful to a standalone MCP client. Turn this on only when those tools are safe to call out-of-band.


optional version?: string

Semantic version advertised over MCP. Defaults to "1.0.0".