Recipes

automcp: wrap existing CrewAI, LangGraph, OpenAI Agents SDK and Pydantic AI projects as MCP servers

Discovered from README cross-links · yesterday

Software & DevOpsWork & Operations

Convert an existing agent project into a deployable MCP server

What they did

The author of automcp noticed that most MCP servers are standalone tool projects, which makes it awkward to expose agents and multi-agent workflows over MCP. Their approach: let AI engineers keep prototyping in whatever agent framework they already use, then add automcp as a dependency and convert with minimal work when ready to ship. Supported frameworks at the time of posting were CrewAI, LangGraph, Llama Index, OpenAI Agents SDK, Pydantic AI and mcp-agent, with more planned. The workflow is: install automcp into the existing project, run a CLI command that generates a run_mcp.py file, make a few edits to that file, then run it to start an MCP server locally. The author frames run_mcp.py as analogous to Heroku's Procfile, Codespaces configs, or Pulumi/AWS CDK-style infrastructure-as-code — a small declarative-ish entrypoint that describes how the agent project becomes a server. Beyond local conversion, they built a demo deployment platform where you paste the GitHub URL of your project, deploy with one click, and get a URL for a hosted SSE server that MCP clients like Cursor can connect to. They describe it as "Vercel for MCP servers." A YouTube demo walks through the flow, and the site is auto-mcp.com with the deployment platform at labs.naptha.ai. The author is explicit that a few manual steps remain for the user and could be automated further, and floats a future direction: instead of one monolithic MCP server per project, automatically create an MCP server for each orchestrator, agent and tool in a project.

How it went

A working open-source library plus a hosted deployment demo: convert a supported agent project, edit the generated run_mcp.py, run it locally, or push a GitHub URL to get a hosted SSE endpoint usable from Cursor. The author is upfront that the flow still has manual steps and is asking for feedback rather than claiming a finished product. Per-agent/per-tool server splitting is described as a future direction, not something shipped.

Worth knowing

Framework coverage is limited to the listed integrations (CrewAI, LangGraph, Llama Index, OpenAI Agents SDK, Pydantic AI, mcp-agent) with more promised. The generated run_mcp.py requires manual edits, so it is not a zero-config conversion. The one-click deployment platform is described as a demo, so treat hosting, auth and persistence as unproven. Exposing agents as remote SSE endpoints raises real questions about credentials, tool permissions and who can call the server — none of that is addressed in the post.

Wiring

Order of operations: (1) the existing agent project stays as-is in its framework of choice — CrewAI, LangGraph, Llama Index, OpenAI Agents SDK, Pydantic AI or mcp-agent; (2) add automcp as a dependency in that project; (3) run the automcp CLI, which generates run_mcp.py at the project root; (4) edit run_mcp.py to point at the right agent/orchestrator and declare what gets exposed; (5) run run_mcp.py to start the MCP server locally; (6) optionally push the repo to GitHub and use the Naptha labs deployment platform to build a hosted SSE endpoint; (7) point an MCP client such as Cursor at either the local server or the hosted SSE URL. run_mcp.py is the single config surface, analogous to a Procfile or IaC file, so it is the file to review in code review and to keep in version control.

Try it yourself

I have an existing agent project in this repo built with one of CrewAI, LangGraph, OpenAI Agents SDK or Pydantic AI. Please:
1. Identify which agent framework the project uses and where the main agent/orchestrator entrypoint lives.
2. Add automcp as a dependency and run its CLI to generate a run_mcp.py file at the repo root.
3. Read the generated run_mcp.py and fill in the edits it needs so it exposes my agent as an MCP server — point it at the correct agent object, name the server, and expose the agent's main entrypoint as an MCP tool.
4. Run the server locally and verify it starts, then show me the exact command and the local endpoint URL.
5. Write a short README section explaining how to connect an MCP client (e.g. Cursor) to the local server, and note which steps are still manual.
Do not change my existing agent logic; only add the conversion layer.

Source

Tools in this stack