Expose multiple OpenAPI specs or FastAPI routes as MCP tools, resources, and meta-tools from one gateway process.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent ā or use 1-click editor setup below.
We ran the install command below but it didn't respond within our test window ā this can mean a slow first-time install rather than a real problem.
uvx openapi-mcp-gatewayNo response to initialize.
This is an experimental automated check and can have false negatives ā missing environment variables, a slow cold install, etc. It doesnāt necessarily mean somethingās wrong. Last checked 1mo ago.
š” Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Openapi MCP Gateway.
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.
operationIds, hide knobs the model should never touch, and rewrite requests and responses with JSONata, all in YAML with no fork required.list ā get ā call meta-tools, so connecting to it does not spend the LLM's whole context window on tool schemas.@mcp_tool to expose them in-process over ASGI, no extra hop and no second spec to maintain.Requires Python 3.11+. To skip the install entirely, uvx openapi-mcp-gateway runs the published package directly.
Every example below uses uv run, which assumes the install above.
Connect an MCP client to http://127.0.0.1:8000/petstore/mcp.
Use a config file so the header name is explicit:
Rather than asking you to paste an upstream token into config, the gateway obtains one per caller. authorization_code runs the gateway as the authorization server and mints each end-user their own upstream token. client_credentials shares a single service token across every client. token_exchange hands issuance to an identity provider you already run. See Authorization for how each pairs a check on the MCP endpoint with a credential for the API.
For the service-token flow, add --auth-flow client_credentials. Those two are what the CLI reaches. token_exchange needs an issuer and an audience, so it is configured per server under auth: in YAML, described in Authorization.
Mix public, bearer, and OAuth2 services in a single config. Each server is mounted at /{name}/mcp:
That one file serves 13 tools with 3 concrete resources and 3 resource templates at /petstore/mcp, three meta-tools fronting ~1,200 endpoints at /github/mcp, and per-user OAuth2 against Asana's IdP at /asana/mcp. No spec edits anywhere. Run it with uv run openapi-mcp-gateway --config servers.yml.
For Claude Desktop, IDE integrations, or any MCP client that prefers stdio:
Runnable configs for every scenario above live in examples/, each with its prerequisites documented at the top.
Every request crosses two boundaries, and one auth: block settles both of them. One is who may call the MCP endpoint, the other is what credential reaches the API behind it. Setting auth.type, plus auth.flow under oauth2, picks a pairing of the two. Everything the gateway sends upstream lives under auth.upstream, so the indentation separates the two directions.
auth.type / auth.flow | MCP Endpoint | Credential Sent Upstream |
|---|---|---|
none | open | none |
bearer, api_key | open | a fixed one from config, shared by every caller |
passthrough | open | the caller's own header, forwarded unchanged |
oauth2 + client_credentials | open | one service token, shared by every caller |
oauth2 + authorization_code | the gateway is the authorization server | a per-user token the gateway obtained on their behalf |
oauth2 + token_exchange | an external issuer is the authorization server | a per-user token exchanged from the caller's |
Only the last two put a check in front of the MCP endpoint. The others suit a gateway on localhost or inside a private network, and leave it open to anyone who can reach the port.
token_exchange verifies JWT signatures, so it needs the oidc extra. Run the gateway as uvx --from "openapi-mcp-gateway[oidc]" openapi-mcp-gateway. Without it the gateway refuses to start and says so.
The MCP spec requires a server to accept only tokens minted for itself, and forbids relaying one to an upstream API. So under both protected flows the upstream is reached with a second, separately obtained credential rather than the one the caller presented. See Access Token Privilege Restriction.
passthrough is the one exception, and it exists for the FastAPI integration, where the gateway runs in-process as part of the app it exposes. There is no separate upstream to be confused about. Setting it against a genuinely separate API is the confused-deputy pattern the spec forbids, which is why nothing selects it automatically.
An API with no authorization server of its own, which accepts tokens from a provider the deployment already runs, needs the gateway to say which API its upstream token is for. Point the OAuth URLs at that provider and name the API:
Factual signals from GitHub, npm, and our automated checks ā not a rating.
No reviews yet ā be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/mroops0111-openapi-mcp-gateway)<a href="https://allmcps.com/mcp/mroops0111-openapi-mcp-gateway"><img src="https://allmcps.com/api/badge/mroops0111-openapi-mcp-gateway?style=directory" alt="Openapi MCP Gateway on AllMCPs" /></a>