{
 "schema_version": 1,
 "generated": "2026-10-31",
 "id": "mastra-ai-mastra--publish-mastra-agents-as-an-mcp-server",
 "repo": "mastra-ai/mastra",
 "repo_url": "https://github.com/mastra-ai/mastra",
 "repo_slug": "mastra-ai-mastra",
 "title": "Publish your agents and tools as an MCP server",
 "page_title": "How to publish your agents and tools as an MCP server with Mastra",
 "summary": "Author an MCP server in Mastra so other systems and agents can use what you built.",
 "who": "A developer whose Mastra agent should be callable from Claude, Cursor or another team's agent.",
 "problem": "Each new client needs its own integration, so useful agents stay locked inside one app.",
 "outcome": "Agents, tools and resources exposed through the MCP interface for any client that supports it.",
 "steps": [
  "Build your agent and tools in a Mastra project created with `npm create mastra@latest`",
  "Follow the MCP servers docs to author a server exposing them",
  "Connect an MCP client to the server and call the tools",
  "Add evals and observability to watch how external callers use it"
 ],
 "agent_prompt": "Using mastra-ai/mastra, expose my <agent> and <tools> as an MCP server, connect it to <MCP client>, and call each tool once to confirm it works.",
 "agents": [
  "claude-code",
  "codex",
  "cursor"
 ],
 "difficulty": "Intermediate",
 "time": "30 minutes",
 "basis": "readme",
 "caveat": "Anything exposed over MCP can be called by the connected client, so expose only the tools you mean to share.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "typescript",
 "requirements": [
  "Node.js and npm",
  "An API key for a provider such as OpenAI, Anthropic, Google or xAI",
  "Optional: storage for suspend and resume and memory"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.8,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/mastra-ai-mastra/publish-mastra-agents-as-an-mcp-server/",
 "md": "https://dedupedai.com/use-cases/mastra-ai-mastra/publish-mastra-agents-as-an-mcp-server/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/mastra-ai-mastra--publish-mastra-agents-as-an-mcp-server.json",
 "api_version": "v1"
}
