OpenAPI to MCP
A standalone proxy that transforms any OpenAPI or Swagger-described REST API into an MCP server by mapping API operations to executable MCP tools. It enables AI clients to interact with existing web services through automated HTTP requests based on t
What is OpenAPI to MCP?
OpenAPI to MCP is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to standalone proxy that transforms any openapi or swagger-described rest api into an mcp server by mapping api operations to executable mcp tools. it enables ai clients to interact with existing web ser...
A standalone proxy that transforms any OpenAPI or Swagger-described REST API into an MCP server by mapping API operations to executable MCP tools. It enables AI clients to interact with existing web services through automated HTTP requests based on t
This server falls under the Developer Tools and APIs categories on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A standalone proxy that transforms any OpenAPI or Swagger-de
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx openapi-to-mcpConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use OpenAPI to MCP
openapi-to-mcp is a standalone TypeScript proxy that reads any OpenAPI or Swagger specification and automatically generates one MCP tool per API operation, mapping HTTP endpoints to executable MCP tools that AI clients can call. It supports both URL-based and file-based specs, handles authentication via Bearer tokens or Basic Auth, and can filter which endpoints are exposed using include/exclude lists. Developers who already have REST APIs described by OpenAPI can use this server to instantly make those APIs accessible to AI agents without writing any custom MCP code.
Prerequisites
- Node.js 18+ installed
- Docker (optional, for containerized deployment)
- An existing REST API with an OpenAPI 3.x or Swagger 2.x specification
- An MCP client such as Claude Desktop or Cursor
Clone the repository
Clone the openapi-to-mcp repository and copy the example environment file.
git clone https://github.com/EvilFreelancer/openapi-to-mcp
cd openapi-to-mcp
cp .env.example .envConfigure environment variables
Edit the .env file to set the URL of your OpenAPI specification and the base URL of your API. These are the two required variables.
# .env
MCP_OPENAPI_SPEC=http://localhost:3000/openapi.json
MCP_API_BASE_URL=http://localhost:3000
# Optional auth:
MCP_API_BEARER_TOKEN=your_token_here
# Optional filtering:
MCP_INCLUDE_ENDPOINTS=GET:/pets,POST:/pets
MCP_TOOL_PREFIX=myapiBuild and start the server
Install dependencies, build the TypeScript project, and start the MCP proxy server. It will listen on port 3100 by default.
npm ci && npm run build && npm run startVerify with MCP Inspector
Test the generated MCP tools using the MCP Inspector before connecting your AI client.
npx @modelcontextprotocol/inspectorConfigure Claude Desktop
Add the openapi-to-mcp server to your Claude Desktop configuration using the streamable-http transport pointing to the running server.
{
"mcpServers": {
"openapi-to-mcp": {
"type": "http",
"url": "http://localhost:3100/mcp"
}
}
}OpenAPI to MCP Examples
Client configuration
Claude Desktop configuration connecting to the openapi-to-mcp proxy running on localhost. Alternatively, use Docker for isolated deployment.
{
"mcpServers": {
"openapi-to-mcp": {
"type": "http",
"url": "http://localhost:3100/mcp"
}
}
}Docker deployment
Run the proxy as a Docker container, pointing it at an OpenAPI spec and API base URL via environment variables.
docker run --rm -p 3100:3100 \
-e MCP_OPENAPI_SPEC=http://host.docker.internal:3000/openapi.json \
-e MCP_API_BASE_URL=http://host.docker.internal:3000 \
evilfreelancer/openapi-to-mcp:latestPrompts to try
Example prompts for interacting with an API exposed through openapi-to-mcp.
- "List all available tools that come from my API"
- "Call the GET /pets endpoint and show me the results"
- "Create a new pet named 'Buddy' using the POST /pets tool"
- "What operations does my API support?"Troubleshooting OpenAPI to MCP
Server fails to start with 'cannot fetch spec' error
Verify that MCP_OPENAPI_SPEC points to a reachable URL or valid local file path. If your API requires authentication to serve the spec, ensure the URL is publicly accessible or use a local file path instead.
Tool names conflict or are ambiguous for APIs with many endpoints
Set MCP_TOOL_PREFIX in your .env file to namespace all generated tool names, and use MCP_INCLUDE_ENDPOINTS to limit exposure to only the endpoints your AI agent needs.
Frequently Asked Questions about OpenAPI to MCP
What is OpenAPI to MCP?
OpenAPI to MCP is a Model Context Protocol (MCP) server that standalone proxy that transforms any openapi or swagger-described rest api into an mcp server by mapping api operations to executable mcp tools. it enables ai clients to interact with existing web services through automated http requests based on t It connects AI assistants to external tools and data sources through a standardized interface.
How do I install OpenAPI to MCP?
Follow the installation instructions on the OpenAPI to MCP GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with OpenAPI to MCP?
OpenAPI to MCP works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is OpenAPI to MCP free to use?
Yes, OpenAPI to MCP is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
OpenAPI to MCP Alternatives — Similar Developer Tools Servers
Looking for alternatives to OpenAPI to MCP? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up OpenAPI to MCP in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use OpenAPI to MCP?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.