Skip to main content

openapi-mcp-gateway. Point one YAML file at your OpenAPI specs, and each API gets its own MCP endpoint and auth.

CI PyPI version PyPI Downloads Python Version License: MIT

Mount any OpenAPI (Swagger) spec as a Model Context Protocol (MCP) server from one YAML file, with no code to write. Per-user OAuth and per-operation scopes give fine-grained access control, and tool shaping and dynamic exposure give context efficiency on large APIs. One process runs several APIs, each with its own endpoint and auth.

With uv installed, one command serves the Petstore API:

uvx openapi-mcp-gateway serve --spec https://petstore3.swagger.io/api/v3/openapi.json --name petstore

Then connect any MCP client, such as Claude Code, Cursor or VS Code, to http://127.0.0.1:8000/petstore/mcp. Getting Started continues from there to a config file with several APIs.

Highlights

Five things set it apart from a server generated once from a spec.

  • One Gateway for Many APIs: one YAML file serves several OpenAPI specs, each at its own MCP endpoint with its own auth.
  • Per-User OAuth: users sign in to the API through the gateway, or bring a token from your identity provider for the gateway to exchange.
  • Fine-Grained Access Control: scopes assigned per operation decide which tools each client can list and call.
  • Tool Shaping: rename operations, hide or fix parameters, and rewrite requests and responses with JSONata.
  • Dynamic Exposure: an API with 1,000+ operations is served as three tools that search, describe and call them.

Architecture

Each tool call is authorized, shaped and sent upstream, and its response is reshaped on the way back.

openapi-mcp-gateway architecture. An MCP client calls an MCP endpoint, one per API, which config.yml builds at startup. Each call is authorized first, by its token and then by the scopes the operation needs, getting an upstream token from the API's authorization server or your identity provider when the mode calls for one. The request is shaped by params and JSONata and sent with the upstream credential, over HTTP to a REST API or over ASGI to a FastAPI app in the same process. The response comes back reshaped by JSONata. openapi-mcp-gateway architecture, as described above.

Documentation

See the documentation for the full guides, concepts and reference.

  • Getting Started covers installation, a connected client and a config file
  • Guides covers AI authoring, exposure, tool shaping, authorization, scopes, identity providers, deployment and Python
  • Concepts covers the request path, security, context efficiency, the scope model, token lifecycles and dynamic exposure
  • Reference lists every config field and CLI flag
  • Evaluation shows how the gateway is measured and what it gains

License

MIT

Metadata

Release files for openapi-mcp-gateway 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openapi-mcp-gateway 1.0.0
File Size Uploaded Provenance Actions
openapi_mcp_gateway-1.0.0.tar.gz 1.2 MB With provenance Details for openapi_mcp_gateway-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for openapi-mcp-gateway 1.0.0
File Interpreter ABI Platform Actions
openapi_mcp_gateway-1.0.0-py3-none-any.whl Python 3 none any Details for openapi_mcp_gateway-1.0.0-py3-none-any.whl

Total release size: 1.4 MB

Release files / openapi_mcp_gateway-1.0.0.tar.gz

Download URL openapi_mcp_gateway-1.0.0.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
fe41f3da5eb5d1329f7b4b14185400e5551a4e6022619e2285ae96e6eaa54a25
BLAKE2b-256 checksum
How to use checksums
473acc75d9a751ebe729466b0c0a96d7e661a957846e68d4c4ef630d5bb01031
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / openapi_mcp_gateway-1.0.0-py3-none-any.whl

Download URL openapi_mcp_gateway-1.0.0-py3-none-any.whl
Size 209.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b124d675f59817f1d32458c5833a16a585e29f7a9f75ed25f664274b48654a6
BLAKE2b-256 checksum
How to use checksums
e43c8d2e1cc270c9ac335bda9e489682d1f2943dba0f6da6af1c0d119d6ac6cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for openapi-mcp-gateway 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for openapi_mcp_gateway-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page