DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to publish your agents and tools as an MCP server with Mastra

Author an MCP server in Mastra so other systems and agents can use what you built.

Short answer: Build your agent and tools in a Mastra project created with npm create mastra@latest; then follow the MCP servers docs to author a server exposing them; connect an MCP client to the server and call the tools. All steps.

Who it is forA developer whose Mastra agent should be callable from Claude, Cursor or another team's agent.

The problemEach new client needs its own integration, so useful agents stay locked inside one app.

The outcomeAgents, tools and resources exposed through the MCP interface for any client that supports it.

What you need first

  • 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

Steps

  1. Build your agent and tools in a Mastra project created with npm create mastra@latest
  2. Follow the MCP servers docs to author a server exposing them
  3. Connect an MCP client to the server and call the tools
  4. Add evals and observability to watch how external callers use it

Prompt for your agent

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.

Caveat. Anything exposed over MCP can be called by the connected client, so expose only the tools you mean to share.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for mastra-ai/mastra and "Publish your agents and tools as an MCP server"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer