Convert & Ship
OpenAPI to MCP Conversion: Complete Guide for 2026
If you have an existing REST API with an OpenAPI spec, you can expose it as an MCP server in minutes — giving AI agents like Claude Code and Cursor direct access to your API capabilities without manual MCP tool definitions. In 2026, several tools automate OpenAPI-to-MCP conversion. Here is how to do it and which tools work best.
What it is
OpenAPI (formerly Swagger) is the standard format for documenting REST APIs — endpoints, parameters, schemas, and auth in a machine-readable file. MCP is the protocol AI agents use to call tools. Converting your OpenAPI spec to MCP means every endpoint becomes an MCP tool an agent can discover and call.
Why it matters
In 2026, OpenAPI-to-MCP conversion is one of the fastest ways to make any existing business API accessible to AI agents. Generate the MCP wrapper automatically from the spec you already have.
Step by step
1) Export your OpenAPI spec (FastAPI auto-generates at /openapi.json; Express/Swagger via swagger-jsdoc). 2) Run: openapi-mcp-generator --spec openapi.json --output ./mcp-server --language typescript. 3) Install and start: cd mcp-server && npm install && npm start. 4) Add to Claude Code: claude mcp add my-api node ./mcp-server/index.js. 5) Test by asking Claude Code to call your API endpoints in natural language.
Conversion approaches
openapi-mcp-generator (open source, npm): community CLI that takes an openapi.json/yaml and outputs a complete MCP server in TypeScript or Python. MCP Python SDK with FastAPI (official — pip install mcp): integrates directly with FastAPI; define @mcp.tool() wrappers around existing routes. Firecrawl MCP Pattern (open source reference): study how Firecrawl exposes web scraping as a remote HTTP MCP server — the architecture mirrors an OpenAPI-to-MCP conversion.
The Tools, Ranked
If your API uses Supabase, the Supabase MCP gives agents direct database access complementary to your API layer.
Once your MCP server is built, use GitHub MCP to commit it and open a PR — a complete code-to-deploy loop.
Study how Firecrawl exposes web scraping as a remote HTTP MCP server — the architecture mirrors an OpenAPI-to-MCP conversion.