
openapi-mcp-gateway
Updated 3d agoby mroops0111
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.
uvx openapi-mcp-gateway --spec https://petstore3.swagger.io/api/v3/openapi.json
# Server live at http://127.0.0.1:8000/api/mcp
- Multi-Spec, Multi-Auth. Mount GitHub, an OAuth2 SaaS, and your internal API side by side, each with its own bearer / API key / OAuth2 auth and token namespace.
- FastAPI-Native. Decorate routes with
@mcp_toolto expose them in-process over ASGI, no extra hop and no second spec to maintain. - Dynamic Exposure. Front a huge spec with three
list → get → callmeta-tools instead of hundreds of schemas, so it never blows the LLM's context window. - Resource Auto-Promotion. Set
mode: autoand eligible GETs register as MCP resources instead of tools, keeping the tool list small while reads stay addressable by URI. - Spec-Compliant Authorization. Audience-bound tokens with no silent passthrough to upstreams, plus protocol-native
annotationsandstructuredContenton every tool. - Tool Name and Description Overrides. Rewrite ugly
operationIds and empty descriptions in YAML, no fork required. - Pluggable Token Store. Memory by default, switch to Redis to share OAuth credential state across replicas. It holds OAuth tokens and client registrations, never MCP protocol sessions, so single-replica or non-OAuth deployments do not need it.
- Every Transport. Streamable HTTP and stdio on the same binary, from Claude Desktop and Cursor to any other MCP client. SSE still works but is deprecated in the 2026-07-28 spec, so new deployments should choose streamable HTTP.
Installation
Add the gateway to your project with uv:
uv add openapi-mcp-gateway
Optional extras:
uv add "openapi-mcp-gateway[redis]" # Redis token store, used for auth memoization
Requires Python 3.11+.
Quick Start
1. Public API, No Auth
# `uv run` assumes you ran `uv add openapi-mcp-gateway` (see Installation above).
# To skip the install, swap in `uvx openapi-mcp-gateway` to run the published package directly.
uv run openapi-mcp-gateway --spec https://petstore3.swagger.io/api/v3/openapi.json --name petstore
Connect an MCP client to http://127.0.0.1:8000/petstore/mcp.
2. Bearer Token
export GITHUB_TOKEN="ghp_..."
uv run openapi-mcp-gateway \
--spec https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json \
--name github \
--auth-type bearer \
--auth-token '${GITHUB_TOKEN}'
For an API-key header, use config so the header name is explicit:
Related servers

n8n
Updated todayby n8n-io
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

mcp-server-fetch
OfficialUpdated 14d agoA Model Context Protocol server providing tools to fetch and convert web content for usage by LLMs

@modelcontextprotocol/server-everything
OfficialUpdated 14d agoMCP server that exercises all the features of the MCP protocol