OpenAPI MCP Gateway

<p align="center">
<a href="https://github.com/mroops0111/openapi-mcp-gateway/actions/workflows/ci.yml"><img src="https://github.com/mroops0111/openapi-mcp-gateway/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
<a href="https://pypi.org/project/openapi-mcp-gateway/"><img src="https://img.shields.io/pypi/v/openapi-mcp-gateway.svg?v=1" alt="PyPI version"></a>
<a href="https://pepy.tech/projects/openapi-mcp-gateway"><img src="https://static.pepy.tech/badge/openapi-mcp-gateway/month" alt="PyPI Downloads"></a>
<a href="https://pypi.org/project/openapi-mcp-gateway/"><img src="https://img.shields.io/pypi/pyversions/openapi-mcp-gateway.svg?v=1" alt="Python Version"></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
</p>
Mount any OpenAPI spec as a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server from one YAML file, with no code to write. Fine-grained access control decides who may call each operation and which values the model may send, and dynamic exposure keeps an API of any size within the model's context. One process runs several APIs, each with its own endpoint and auth.
With [uv](https://docs.astral.sh/uv/getting-started/installation/) installed, one command serves PokéAPI:
```bash
uvx openapi-mcp-gateway serve --spec https://pokeapi.co/openapi.yml --name pokeapi
```
Then connect any MCP client, such as Claude Code, Cursor or VS Code, to `http://127.0.0.1:8000/pokeapi/mcp`. [Getting Started](https://mroops0111.github.io/openapi-mcp-gateway/getting-started/) continues from there to a config file with several APIs.
## Highlights
Most OpenAPI-to-MCP tools turn every operation into a tool. The gateway also decides what the model sees, what it may send and who may call it.
- **Context Efficiency**: dynamic exposure serves an API of any size as three tools that search, describe and call its operations, instead of one tool per operation loaded into the model's context.
- **Deterministic Guardrails**: pinned, hidden and enum-limited parameters bound which resources the model can reach, enforced by the gateway rather than the prompt.
- **Fine-Grained Access Control**: per-user OAuth and per-operation scopes decide which tools each client can list and call.
- **One Gateway for Many APIs**: one YAML file serves several OpenAPI specs, each at its own MCP endpoint with its own auth.
## Architecture
Each tool call is authorized, shaped and sent upstream, and its response is reshaped on the way back.
 
## Documentation
See the [documentation](https://mroops0111.github.io/openapi-mcp-gateway/) for the guides, concepts, reference and evaluation.
## License
[MIT](LICENSE)
TDQS
Scored across 19 tools
Tools are generally distinct per resource and action, but update_pet and update_pet_with_form could confuse agents expecting a single update path. Similarly, create_user vs create_users_with_list_input are similar in purpose though descriptions clarify the difference.
All tool names follow a consistent snake_case verb_noun pattern (e.g., get_pet_by_id, delete_order, create_user). There is minor variation in verbs like add vs create, but the pattern remains predictable throughout.
19 tools is well-scoped for a pet store API covering pets, users, and orders. Each tool serves a clear purpose without redundancy, and the count is within the typical range for a domain-specific server.
The toolset provides solid CRUD coverage for pets, users, and orders, including listing/filtering and file upload. Minor gaps exist—for example, no update order and no way to list all users or all pets generically—but core workflows are covered.