{"slug": "mcpgen-turn-any-openapi-spec-into-an-mcp-server-in-seconds", "title": "mcpgen: Turn any OpenAPI spec into an MCP server in seconds", "summary": "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.", "body_md": "I got tired of manually writing MCP tools for every REST endpoint I wanted\n\nto expose to an LLM. So I automated it.\n\n**mcpgen** reads an OpenAPI JSON or YAML file and generates a complete,\n\nready‑to‑run MCP server in Python.\n\n`snake_case`\n\nnames)`mcp`\n\nand `httpx`\n\n```\nbash\npip install mcpgen\nmcpgen my-api.json -o my-mcp-server\npython my-mcp-server/server.py\nThe generated server runs over stdio – ready to plug into Claude Desktop\nor any MCP client.\n\n🧪 Real‑world test\nRecently a contributor added an OpenAPI 3.1 fixture (Xquik API) with\nlookupTweet and getUser endpoints. The tool generated the correct\ntools, including path parameters and x-api-key auth, on the first try.\n\nAll 18 tests pass. It works.\n\n🤔 Why you might want it\nIf you’re building LLM agents that need to interact with APIs,\nmcpgen eliminates the boilerplate. You don’t have to write a single\n@app.tool() decorator by hand.\n\nIt also makes it dead simple to experiment – change your API spec,\nregenerate the server, and you’re done.\n\n📦 Links\nGitHub: JnanaSrota/mcpgen\n\nPyPI: pip install mcpgen\n\nMIT licensed, open to contributions\n\n🙏 Feedback\nIf you try it with your own API spec and something breaks (or works\nbeautifully), I’d love to hear about it. Drop a comment or open an issue.\n\nThanks for reading!\n```\n\n", "url": "https://wpnews.pro/news/mcpgen-turn-any-openapi-spec-into-an-mcp-server-in-seconds", "canonical_source": "https://dev.to/56_princepal_a4d5346a99d/mcpgen-turn-any-openapi-spec-into-an-mcp-server-in-seconds-5cd7", "published_at": "2026-06-30 18:11:49+00:00", "updated_at": "2026-06-30 18:48:56.953265+00:00", "lang": "en", "topics": ["developer-tools", "large-language-models", "ai-agents"], "entities": ["mcpgen", "OpenAPI", "MCP", "Claude Desktop", "Python", "httpx", "Xquik API", "GitHub"], "alternates": {"html": "https://wpnews.pro/news/mcpgen-turn-any-openapi-spec-into-an-mcp-server-in-seconds", "markdown": "https://wpnews.pro/news/mcpgen-turn-any-openapi-spec-into-an-mcp-server-in-seconds.md", "text": "https://wpnews.pro/news/mcpgen-turn-any-openapi-spec-into-an-mcp-server-in-seconds.txt", "jsonld": "https://wpnews.pro/news/mcpgen-turn-any-openapi-spec-into-an-mcp-server-in-seconds.jsonld"}}