cd /news/developer-tools/mcpgen-turn-any-openapi-spec-into-an… · home topics developer-tools article
[ARTICLE · art-45363] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

mcpgen: Turn any OpenAPI spec into an MCP server in seconds

A developer created mcpgen, a tool that converts any OpenAPI specification into a ready-to-run MCP server in seconds. The generated server runs over stdio and can be plugged into Claude Desktop or any MCP client. The tool eliminates manual boilerplate for exposing REST endpoints to LLM agents.

read1 min views50 publishedJun 30, 2026

I got tired of manually writing MCP tools for every REST endpoint I wanted

to expose to an LLM. So I automated it.

mcpgen reads an OpenAPI JSON or YAML file and generates a complete,

ready‑to‑run MCP server in Python.

snake_case

names)mcp

and httpx

bash
pip install mcpgen
mcpgen my-api.json -o my-mcp-server
python my-mcp-server/server.py
The generated server runs over stdio – ready to plug into Claude Desktop
or any MCP client.

🧪 Real‑world test
Recently a contributor added an OpenAPI 3.1 fixture (Xquik API) with
lookupTweet and getUser endpoints. The tool generated the correct
tools, including path parameters and x-api-key auth, on the first try.

All 18 tests pass. It works.

🤔 Why you might want it
If you’re building LLM agents that need to interact with APIs,
mcpgen eliminates the boilerplate. You don’t have to write a single
@app.tool() decorator by hand.

It also makes it dead simple to experiment – change your API spec,
regenerate the server, and you’re done.

📦 Links
GitHub: JnanaSrota/mcpgen

PyPI: pip install mcpgen

MIT licensed, open to contributions

🙏 Feedback
If you try it with your own API spec and something breaks (or works
beautifully), I’d love to hear about it. Drop a comment or open an issue.

Thanks for reading!
── more in #developer-tools 4 stories · sorted by recency
── more on @mcpgen 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/mcpgen-turn-any-open…] indexed:0 read:1min 2026-06-30 ·