automcp: 기존 CrewAI, LangGraph, OpenAI Agents SDK, Pydantic AI 프로젝트를 MCP 서버로 래핑
README 링크에서 발견 · yesterday
기존 에이전트 프로젝트를 배포 가능한 MCP 서버로 변환
What they did
automcp 작성자는 대부분의 MCP 서버가 독립형 도구 프로젝트라는 점을 알아차렸고, 이로 인해 에이전트와 멀티 에이전트 워크플로를 MCP로 노출하기가 어색해진다고 보았다. 그들의 접근 방식은 AI 엔지니어가 이미 사용 중인 에이전트 프레임워크에서 계속 프로토타이핑하게 하고, 출시 준비가 되면 automcp를 의존성으로 추가해 최소한의 작업으로 변환하는 것이다. 글 작성 시점에 지원되던 프레임워크는 CrewAI, LangGraph, Llama Index, OpenAI Agents SDK, Pydantic AI, mcp-agent였으며, 더 추가될 예정이었다. 워크플로는 다음과 같다: 기존 프로젝트에 automcp를 설치하고, run_mcp.py 파일을 생성하는 CLI 명령을 실행하고, 그 파일을 몇 군데 수정한 뒤, 실행하여 로컬에서 MCP 서버를 시작한다. 작성자는 run_mcp.py를 Heroku의 Procfile, Codespaces 설정, 또는 Pulumi/AWS CDK 스타일의 infrastructure-as-code에 비유한다. 에이전트 프로젝트가 어떻게 서버가 되는지를 설명하는 작은 선언형에 가까운 엔트리포인트라는 것이다. 로컬 변환을 넘어, 그들은 프로젝트의 GitHub URL을 붙여넣고 한 번의 클릭으로 배포하면 Cursor 같은 MCP 클라이언트가 연결할 수 있는 호스팅 SSE 서버의 URL을 받는 데모 배포 플랫폼을 만들었다. 그들은 이를 "MCP 서버를 위한 Vercel"이라고 설명한다. YouTube 데모가 전체 흐름을 안내하며, 사이트는 auto-mcp.com이고 배포 플랫폼은 labs.naptha.ai에 있다. 작성자는 사용자에게 몇 가지 수동 단계가 남아 있으며 더 자동화될 수 있다고 분명히 밝히고, 향후 방향으로 프로젝트당 하나의 모놀리식 MCP 서버 대신 프로젝트의 각 오케스트레이터, 에이전트, 도구마다 자동으로 MCP 서버를 생성하는 방안을 제시한다.
How it went
작동하는 오픈소스 라이브러리와 호스팅 배포 데모: 지원되는 에이전트 프로젝트를 변환하고, 생성된 run_mcp.py를 편집하고, 로컬에서 실행하거나, GitHub URL을 푸시하여 Cursor에서 사용할 수 있는 호스팅 SSE 엔드포인트를 얻습니다. 저자는 이 흐름에 여전히 수동 단계가 있다는 점을 솔직히 밝히고 있으며, 완성된 제품을 주장하기보다는 피드백을 요청하고 있습니다. 에이전트별/도구별 서버 분리는 출시된 기능이 아니라 향후 방향으로 설명됩니다.
Worth knowing
프레임워크 지원은 나열된 통합(CrewAI, LangGraph, Llama Index, OpenAI Agents SDK, Pydantic AI, mcp-agent)으로 제한되며, 더 많은 통합이 예고되어 있습니다. 생성된 run_mcp.py는 수동 편집이 필요하므로 제로 구성 변환이 아닙니다. 원클릭 배포 플랫폼은 데모로 설명되어 있으므로 호스팅, 인증, 영속성은 검증되지 않은 것으로 봐야 합니다. 에이전트를 원격 SSE 엔드포인트로 노출하는 것은 자격 증명, 도구 권한, 그리고 누가 서버를 호출할 수 있는지에 대한 실질적인 문제를 제기하지만, 게시물에서는 이 중 어느 것도 다루지 않습니다.
Wiring
작업 순서: (1) 기존 에이전트 프로젝트는 선택한 프레임워크(CrewAI, LangGraph, Llama Index, OpenAI Agents SDK, Pydantic AI 또는 mcp-agent) 그대로 유지한다. (2) 해당 프로젝트에 automcp를 의존성으로 추가한다. (3) automcp CLI를 실행하면 프로젝트 루트에 run_mcp.py가 생성된다. (4) run_mcp.py를 편집하여 올바른 에이전트/오케스트레이터를 가리키도록 하고 무엇을 노출할지 선언한다. (5) run_mcp.py를 실행하여 로컬에서 MCP 서버를 시작한다. (6) 선택적으로 리포지토리를 GitHub에 푸시하고 Naptha labs 배포 플랫폼을 사용하여 호스팅된 SSE 엔드포인트를 빌드한다. (7) Cursor와 같은 MCP 클라이언트를 로컬 서버 또는 호스팅된 SSE URL로 지정한다. run_mcp.py는 Procfile이나 IaC 파일에 비견되는 단일 구성 표면이므로, 코드 리뷰에서 검토해야 할 파일이며 버전 관리에 유지해야 할 파일이다.
Try it yourself
I can't complete this task as specified. Here's why, and what I can do instead.
**What I can't do:**
- I don't have access to your repository, filesystem, or terminal in this conversation. I can't inspect your code to identify the framework, run `pip install automcp`, execute its CLI, read the generated `run_mcp.py`, start a server, or verify it boots.
- I can't run commands or produce a verified local endpoint URL — anything I wrote would be a guess, not a verification.
**What I can do — a concrete plan you can execute:**
**1. Identify the framework**
Look for these signals in your repo:
- `crewai` in `pyproject.toml`/`requirements.txt`, `from crewai import Agent, Crew` → CrewAI. Entrypoint usually a `Crew(...).kickoff()` call.
- `langgraph` + `StateGraph`, `from langgraph.graph import ...` → LangGraph. Entrypoint is the compiled graph's `.invoke()`.
- `openai-agents` + `from agents import Agent, Runner` → OpenAI Agents SDK. Entrypoint is `Runner.run(agent, ...)`.
- `pydantic-ai` + `from pydantic_ai import Agent` → Pydantic AI. Entrypoint is `agent.run(...)` or `agent.run_sync(...)`.
**2. Add automcp and generate the scaffold**
```bash
pip install automcp
automcp init # or: python -m automcp init
```
This creates `run_mcp.py` at the repo root. (Check `automcp --help` — the exact subcommand varies by version.)
**3. Fill in `run_mcp.py`**
The generated file has placeholders for: the agent object, the server name, and the tool function. You'll wire it to your existing entrypoint — e.g. for a LangGraph graph:
```python
from mcp.server.fastmcp import FastMCP
from your_module import graph # your existing compiled graph
mcp = FastMCP("my-agent")
@mcp.tool()
def run_agent(query: str) -> str:
result = graph.invoke({"messages": [("user", query)]})
return result["messages"][-1].content
if __name__ == "__main__":
mcp.run()
```
Adapt the import and the `.invoke`/`.run` call to match your actual entrypoint. Don't touch your agent logic — only the wrapper.
**4. Run and verify**
```bash
python run_mcp.py
```
Default FastMCP transport is stdio (no URL). If you want an HTTP endpoint, use `mcp.run(transport="streamable-http")` — typically `http://127.0.0.1:8000/mcp`. Confirm the actual port from the startup log; don't trust my default.
**5. README section (draft)**
```markdown
## MCP server
This repo exposes the agent as an MCP server via `run_mcp.py`.
### Run locally
pip install -r requirements.txt
python run_mcp.py
### Connect from Cursor
Add to `~/.cursor/mcp.json`:
{
"mcpServers": {
"my-agent": { "command": "python", "args": ["/abs/path/to/run_mcp.py"] }
}
}
Restart Cursor. The `run_agent` tool will appear in the MCP panel.
### Still manual
- Choosing the transport (stdio vs HTTP) and port.
- Mapping your agent's input/output schema to the tool signature.
- Auth, if you expose it beyond localhost.
```
If you paste your `pyproject.toml`/`requirements.txt` and the file containing your agent entrypoint, I can tell you exactly which framework it is and write the precise `run_mcp.py` edits for your code.