openapi-to-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@openapi-to-mcpimport the OpenAPI spec from https://api.example.com/openapi.json"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
OpenAPI to MCP
Turn any OpenAPI/Swagger or REST API into an MCP server for Claude, ChatGPT and Copilot. Powered by AnythingMCP.
OpenAPI to MCP turns any REST API with an OpenAPI or Swagger spec into MCP tools that Claude, ChatGPT, Copilot and Cursor can call, without code. Import the spec and every operation becomes a tool with its parameters and auth. This repository runs the whole chain locally against a demo orders API.
Last verified: 2026-09-26 against the bundled demo orders API (OpenAPI 3.0.3, API-key auth) (docker compose up + scripts/smoke.mjs: spec import, tools/list, GET with query and path parameters, POST with a JSON body).
Adapter synced: 2026-09-26
Maintained by helpcode.ai, the team that builds and maintains AnythingMCP.
Try it in five minutes
Needs Docker 24+, openssl and Node 18+.
git clone https://github.com/HelpCode-ai/openapi-to-mcp.git
cd openapi-to-mcp
./scripts/install.sh
npm install && node scripts/smoke.mjsinstall.sh starts AnythingMCP and a small REST API (examples/api-demo: customers and sales orders, protected by an API key), creates a REST connector with that key, imports openapi.json and creates an MCP API key. smoke.mjs lists the tools and asks for the open orders.
OpenAPI operation | MCP tool | Changes data |
|
| no |
|
| no |
|
| no |
|
| no |
|
| yes |
Tool names are the operationId in lower case (or <method>_<path> without one); descriptions come from summary and description. The API key lives in the connector and never reaches the model.
Related MCP server: Any API MCP Server
Use your own API
In the AnythingMCP UI, Connectors → New connector → REST: base URL and auth (API key, bearer, Basic, OAuth 2.0, HMAC…).
Import → OpenAPI with the spec URL, a Swagger UI page URL, or the spec pasted as JSON or YAML. OpenAPI 3.0, 3.1 and Swagger 2.0 work.
Rename tools with cryptic
operationIds and rewrite descriptions in the words your users ask with.Assign the connector to an MCP server whose role whitelists the operations the AI may call.
Through the API:
curl -s http://localhost:4000/api/connectors/$ID/import -H "Authorization: Bearer $TOKEN" -H "content-type: application/json" \
-d '{"source":"openapi","url":"https://api.example.com/openapi.json"}'Re-importing updates changed operations, adds new ones and disables the ones that disappeared. Roles, response mappings and tools you disabled survive; names and descriptions are refreshed from the spec, so put wording you want to keep into the spec itself.
Connect Claude, ChatGPT, Copilot or Cursor
Claude (claude.ai, Desktop, mobile): Customize → Connectors → Add custom connector, paste your MCP server URL and sign in. Claude connects from Anthropic's cloud, so the URL must be public HTTPS: your AnythingMCP Cloud URL, or your own instance behind TLS.
Claude Code:
claude mcp add --transport http openapi-to-mcp http://localhost:4000/mcp --header "X-API-Key: <MCP_API_KEY>"Cursor (
.cursor/mcp.json) and VS Code / GitHub Copilot (.vscode/mcp.json, keyserversinstead ofmcpServers, plus"type": "http"):{ "mcpServers": { "openapi-to-mcp": { "url": "http://localhost:4000/mcp", "headers": { "X-API-Key": "<MCP_API_KEY>" } } } }ChatGPT: add the public HTTPS URL as a connector (app) in ChatGPT's settings. A
localhostURL does not work there.
Example prompts
Which sales orders are still open, and when did we promise them?
Show customer 2 and all of their orders.
Which customers are in Switzerland?
What is the total value of the open orders?
Add a note to order SO-24044: "Customer asked for delivery before 10 am." (a write tool)
Which tickets were opened today in our helpdesk API?
More in examples/prompts.md.
Security
Credentials stay in the connector, encrypted with AES-256-GCM; the model never sees them.
Roles decide which operations each MCP server exposes. Start with the GET operations.
Response mapping trims large or sensitive responses per tool before they reach the model.
Audit log: every call with input, output, duration and status.
FAQ
How do I turn an OpenAPI spec into an MCP server?
Create a REST connector in AnythingMCP, import the spec (URL, Swagger UI page or pasted JSON/YAML), and add the MCP server URL to your AI client. Each operation becomes a tool; no code.
Which spec versions work?
OpenAPI 3.0, OpenAPI 3.1 and Swagger 2.0.
What if my API has no spec?
Import a Postman collection or cURL commands instead, or define the tools by hand in the visual editor.
Where do the API credentials go?
Into the connector, encrypted with AES-256-GCM. They are added to each request by AnythingMCP; the model never sees them.
Can I stop the AI from calling operations that change data?
Yes. Give the MCP server a role that whitelists only the GET operations; the others are invisible to that client.
What happens when the API changes?
Re-import the spec. Changed operations are updated, new ones added, and removed ones disabled instead of failing at call time.
Troubleshooting
Problem | Fix |
The import finds no operations | Point it at the JSON/YAML spec, or at the Swagger UI page: AnythingMCP looks for the spec behind it. |
Tool names are unreadable | The spec has no |
| The connector auth is missing or wrong. Check header name and key on the connector. |
"SSRF" or "blocked host" error | The API is on a private network. Add its hostname to |
Related
soap-to-mcp: Turn any SOAP/WSDL web service into MCP tools for Claude & ChatGPT. Legacy SOAP APIs as AI tools, no code, self-hosted.
AnythingMCP: the open-source MCP server and gateway this repository is built on.
License
AGPL-3.0-only. The adapter definition in adapter/ comes from AnythingMCP (AGPL-3.0).
This server cannot be deployed
Maintenance
Related MCP Connectors
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
The OpenRouter for tools. One MCP connection gives any AI agent 254 hosted tools, pay per call.
One MCP endpoint for Claude, GPT & Gemini: 100+ tools + no-code connectors + agent workers.
Discover and call 10,000+ production APIs from one MCP server. Pay-per-call billing for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAutomatically converts any OpenAPI specification or Postman Collection into an MCP server, enabling AI assistants like Claude to directly interact with REST APIs without writing any code.Apache 2.0
- FlicenseNot gradedqualityDmaintenanceDynamically converts any API with an OpenAPI v3 specification into MCP tools for AI assistants. It supports multiple authentication methods including OAuth2, Bearer tokens, and API keys for flexible integration.-
- AlicenseNot gradedqualityDmaintenanceConverts any REST API into MCP-compatible tools instantly by providing an OpenAPI/Swagger spec, enabling seamless integration with AI agents.MIT
- AlicenseNot gradedqualityBmaintenanceTurns any OpenAPI/Swagger API into MCP tools, enabling AI assistants to call REST API endpoints directly.2MIT