Skip to main content

MCP Server Overview

What Are MCP Servers?

The Mastra platform exposes its capabilities through Model Context Protocol (MCP) servers. MCP is an open standard that allows AI clients -- such as VS Code Copilot, Claude Desktop, or custom agents -- to discover and invoke tools over a structured protocol. Each MCP server groups related tools by domain, so clients only connect to the servers they need.


Available Servers

ServerToolsDomainServer IDNotes
Admin11Base Platformadmin
K12 Safety28K12 Educationk12-safety
Reasoning Engine8Reasoningreasoning-engineLoaded when the Reasoning Engine loader is active
Docs4Documentation (all)docs
K12 Docs4K12 Documentationk12-docs
SDAC Docs4SDAC Documentationsdac-docs
TAP Docs4TAP Documentationtap-docs
RE Docs4RE Documentationreasoning-engine-docs

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.


Discovering Servers

When runtime directory routes are enabled, the platform provides a JSON discovery endpoint that lists active MCP servers and their metadata:

EndpointFormatUse Case
GET /mcp-servers.jsonJSONMachine-readable registry for automated clients

The JSON endpoint returns server objects with IDs, names, and descriptions. The audited route factory does not expose a separate /mcp-servers HTML directory.


Connecting to a Server

The source-backed server IDs are listed above. Direct runtime paths use the root-relative patterns below. Through testing APIM/Replit, prefix them with /ai, for example /ai/api/mcp/docs/sse.

ProtocolURL PatternDescription
Streamable HTTP/api/mcp/{serverId}/mcpRecommended for most clients
Server-Sent Events (SSE)/api/mcp/{serverId}/sseFor clients that require SSE transport

For example, to connect to the K12 Safety server:

  • Streamable HTTP: /api/mcp/k12-safety/mcp
  • SSE: /api/mcp/k12-safety/sse

Testing APIM validation on 2026-06-23 confirmed the /ai/api/mcp/* transport prefix responds through APIM. /ai/mcp-servers.json still returns 401 in testing, so use the committed MCP inventory or local docs MCP config for Replit discovery until registry auth is reconciled.


How It Works

  1. The AI client connects to an MCP server using its URL.
  2. The client discovers available tools via the MCP protocol's tools/list method.
  3. The client invokes tools by calling tools/call with the tool ID and parameters.
  4. The server executes the tool against the platform's backend services and returns the result.

Next Steps