OpenAPI to MCP

v1.0.0Developer Toolsstable

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

api-proxydockermcpmodel-context-protocolnodejs
Share:
16
Stars
0
Downloads
0
Weekly
0/5

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

Transform REST APIs into MCP servers
Automate API integration with AI agents
EvilFreelancer

Maintainer

LicenseMIT License
Languagetypescript
Versionv1.0.0
UpdatedApr 13, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx openapi-to-mcp

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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 .env
2

Configure 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=myapi
3

Build 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 start
4

Verify with MCP Inspector

Test the generated MCP tools using the MCP Inspector before connecting your AI client.

npx @modelcontextprotocol/inspector
5

Configure 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:latest

Prompts 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.

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.

Quick Config Preview

{ "mcpServers": { "openapi-to-mcp": { "command": "npx", "args": ["-y", "openapi-to-mcp"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides