MCP Servers
Overview
The Mastra Agent Framework exposes its tool registries as Model Context Protocol (MCP) servers. Each MCP server wraps a domain-specific tool registry, making the tools available to any MCP-compatible client (VS Code Copilot, Claude Desktop, custom agents).
MCP servers are instantiated through the active Mastra artifact loaders and then merged into the runtime configuration in apps/runtime/src/mastra-runtime.ts. Each server factory returns a fresh MCPServer instance wired to a source-owned tool registry.
Server Summary
| Server | Version | Tools | Domain | Skip/Opt-in Flag |
|---|---|---|---|---|
| Admin MCP Server | 1.0.0 | 11 | Base Platform | MASTRA_SKIP_ADMIN_MCP |
| K12 Safety MCP Server | 1.0.0 | 28 | K12 Education | MASTRA_SKIP_K12_MCP |
| Reasoning Engine MCP Server | 1.0.0 | 8 | Reasoning Engine | MASTRA_INCLUDE_REASONING_ENGINE=true |
| Docs MCP Server | 1.0.0 | 4 | Documentation (all) | MASTRA_SKIP_DOCS_MCP |
| K12 Docs MCP Server | 1.0.0 | 4 | K12 Docs | MASTRA_SKIP_DOCS_MCP |
| SDAC Docs MCP Server | 1.0.0 | 4 | SDAC Docs | MASTRA_SKIP_DOCS_MCP |
| TAP Docs MCP Server | 1.0.0 | 4 | TAP Docs | MASTRA_SKIP_DOCS_MCP |
| RE Docs MCP Server | 1.0.0 | 4 | RE Docs | MASTRA_SKIP_DOCS_MCP |
| Diagnostics MCP Server | service-owned | 11 | Read-only diagnostics | Gateway token and environment approval policy |
| Testing Workbench MCP | service-owned | 22 | Diagnostics plus static docs/contracts/source context | Gateway token and environment approval policy |
The eight runtime-composed profiles account for 67 server-tool registrations. The generated inventory also tracks the separate diagnostics (11) and testing workbench (22) profiles: 10 profiles and 100 server-tool registrations in all. These are registrations per server, not a claim of 100 unique implementations; the docs profiles intentionally reuse the same four-tool registry.
The skip flags are parsed through the environment schema. Reasoning Engine
inclusion is exposed through env.includeReasoningEngine, which reads
MASTRA_INCLUDE_REASONING_ENGINE=true directly.
The canonical generated inventory is
docs/internal/documentation-revival/mcp-inventory.json. Use it instead of
hand-maintaining counts when MCP factories or diagnostics context tools change.
Documentation
MCP server documentation is split into two audiences:
- Internal -- Architecture, factory patterns, source paths, testing, and implementation details for engineers maintaining the MCP layer
- External -- Available servers, tool inventories, connection methods, and usage guidance for MCP client developers