OpenAPI MCP Bridge
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
OpenAPI → MCP Bridge
Make your API usable by AI agents in one command. Point it at any OpenAPI 3.x spec and it serves every endpoint as a Model Context Protocol tool. Claude, Cursor, ChatGPT and any other MCP client can then call your API, with guardrails.
openapi-mcp --spec https://api.yourcompany.com/openapi.json --bearer-env YOUR_API_TOKEN --read-onlyWhy this matters
Customers increasingly want to use your product from inside their AI assistant. That means "create a ticket", "pull last week's invoices" or "find the customer with email X" straight from chat. If your SaaS has an OpenAPI spec, you're one step away. This bridge handles the mechanical part and the parts that are easy to get wrong:
Concern | How it's handled |
Tool generation | One tool per operation. Names come from |
Agent-friendly schemas | Path, query and header params plus a |
Least privilege |
|
Safety hints | MCP tool annotations: GETs are |
Credentials | Read from environment variables only. The model never sees or sets auth headers, and it can't override |
Injection | Path params are fully URL-encoded, so |
Context-window hygiene | JSON responses are pretty-printed and truncated past a limit. Non-2xx responses come back as tool errors with the status code. |
Related MCP server: MCP OpenAPI Bridge
Quick start
pip install -e ".[dev]"
pytest # 6 tests incl. a full MCP client↔server round trip
openapi-mcp --spec examples/taskboard.yaml --list # preview the generated toolslist_projects GET /projects [read]
create_project POST /projects [write]
get_project GET /projects/{projectId} [read]
delete_project DELETE /projects/{projectId} [DESTRUCTIVE]
get_projects_tasks_by_project_id GET /projects/{projectId}/tasks [read]
create_task POST /projects/{projectId}/tasks [write]
6 toolsUse it from Claude Desktop, Cursor or any MCP client
{
"mcpServers": {
"my-api": {
"command": "openapi-mcp",
"args": ["--spec", "https://api.example.com/openapi.json", "--bearer-env", "MY_API_TOKEN", "--exclude-tags", "admin"],
"env": { "MY_API_TOKEN": "..." }
}
}
}Options
Flag | Purpose |
| Path or URL to an OpenAPI 3.x spec (JSON or YAML) |
| API base URL (defaults to the spec's first |
| Env var holding a bearer token |
| API-key auth, for example |
| Expose GET operations only |
| Comma-separated tag filters |
| Print the generated tools and exit |
Use as a library
from openapi_mcp.spec import load_spec, parse_operations
from openapi_mcp.executor import Executor, AuthConfig
from openapi_mcp.server import build_server
ops = parse_operations(load_spec("openapi.yaml"), exclude_tags={"admin"})
server = build_server(ops, Executor("https://api.example.com", AuthConfig(bearer_env="TOKEN")))Going to production (what I'd add for a real rollout)
Curated tools: large APIs (100+ endpoints) overwhelm agents. Group endpoints into a smaller set of task-level tools, such as
find_customerorrefund_order, with descriptions written for the model.Per-user auth: OAuth on the MCP server (Streamable HTTP transport) so each user acts with their own permissions.
Confirmation flows: require confirmation for write and destructive tools, rate-limit them per user, and keep an audit log.
Evals: a test suite of natural-language tasks, checking that the agent picks the right tool with the right arguments.
Need an MCP server or AI integration for your product?
I'm Naman Kaushik, a backend and applied-AI engineer with 15 years of experience. I built an internal MCP tooling directory covering roughly 4,250 tools across 162 servers, plus production RAG, semantic search and multi-provider LLM pipelines. I can make your product usable from Claude, ChatGPT and Cursor, safely.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
The OpenRouter for tools. One MCP connection gives any AI agent 254 hosted tools, pay per call.
Discover and call 10,000+ production APIs from one MCP server. Pay-per-call billing for AI agents.
Pay-per-use tool marketplace for AI agents. Search, price-check, and call APIs via MCP.
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables MCP clients to call any OpenAPI-defined API by automatically converting its operations into tools, with built-in support for authentication, rate limiting, and response handling.7Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables users to turn any OpenAPI 3.x spec into callable MCP tools at runtime, letting agents inspect and invoke API operations directly from JSON or YAML specifications without code generation or build steps.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to discover and invoke tools generated from existing OpenAPI-described REST APIs through a governed MCP gateway with centralized authentication, policy-based access control, rate limiting, PII redaction, auditing, and token-efficient progressive discovery.MIT
- AlicenseNot gradedqualityCmaintenanceTurns OpenAPI 3.x REST APIs into MCP tools, enabling AI agents to call API operations without hand-written integration code.MIT