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.
Properties
Section titled “Properties”agents?
Section titled “agents?”
optionalagents?: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.
description?
Section titled “description?”
optionaldescription?:string
Optional human-readable description advertised over MCP.
extraTools?
Section titled “extraTools?”
optionalextraTools?:ToolsInput
Extra tools to expose over MCP beyond the agent / ambient sets. Use this for tools written specifically for MCP consumers.
optionalname?:string
Display name advertised over MCP. Defaults to "<displayName> MCP".
serverId?
Section titled “serverId?”
optionalserverId?:string
Server id used in the route path (/mcp/<serverId>/...) and as the
MCP registry id. Defaults to the plugin’s registered name.
tools?
Section titled “tools?”
optionaltools?: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.
version?
Section titled “version?”
optionalversion?:string
Semantic version advertised over MCP. Defaults to "1.0.0".