Python gateway that turns any OpenAPI/Swagger spec or FastAPI app into a Model Context Protocol (MCP) server. Multi-spec in one process, per-user OAuth2 with token relay, route-level @mcp_tool decorator, and dynamic meta-tools for large APIs. Works with Claude Desktop, Cursor, Cline, Codex.
README
Mount any OpenAPI (Swagger) spec as a Model Context Protocol (MCP) server, or expose an existing FastAPI app the same way. Multiple APIs in one process, each with its own mount path and auth.
<p align="center"> <img src="architecture.png" alt="OpenAPI MCP Gateway architecture: MCP clients (Claude Desktop, Cursor, AI agents) connect over stdio / SSE / streamable-http to the gateway, which at startup ingests OpenAPI specs or FastAPI apps and exposes them as MCP tools, meta-tools, and resources, then per call authorizes with bearer / API key / OAuth2 and emits MCP-native output, calling upstream REST APIs over HTTP or an in-process FastAPI app over ASGI." width="100%"> </p>uvx openapi-mcp-gateway --spec https://petstore3.swagger.io/api/v3/openapi.json
# Server live at http://127.0.0.1:8000/api/mcp
@mcp_tool to expose them in-process over ASGI, no extra hop and no second spec to maintain.list → get → call meta-tools instead of hundreds of schemas, so it never blows the LLM's context window.