OpenAPI MCP
A generic MCP server that dynamically exposes any OpenAPI-documented REST API to LLMs by auto-discovering endpoints. It provides tools for exploring API capabilities and making authenticated requests directly through natural language interfaces.
What is OpenAPI MCP?
OpenAPI MCP is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to generic mcp server that dynamically exposes any openapi-documented rest api to llms by auto-discovering endpoints. it provides tools for exploring api capabilities and making authenticated requests di...
A generic MCP server that dynamically exposes any OpenAPI-documented REST API to LLMs by auto-discovering endpoints. It provides tools for exploring API capabilities and making authenticated requests directly through natural language interfaces.
This server falls under the APIs and Developer Tools categories on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A generic MCP server that dynamically exposes any OpenAPI-do
Use Cases
Maintainer
Works with
Installation
NPM
npx -y @ivotoby/openapi-mcp-serverManual Installation
npx -y @ivotoby/openapi-mcp-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use OpenAPI MCP
The OpenAPI MCP Server is a generic bridge that dynamically converts any OpenAPI-documented REST API into MCP tools accessible to LLMs, without writing custom integration code. It reads an OpenAPI specification (local file or remote URL), auto-generates callable tools from each endpoint, and handles authentication headers and TLS configuration transparently. Teams use it to give AI assistants direct, authenticated access to internal or third-party APIs described by an OpenAPI spec — turning natural language requests into real API calls instantly.
Prerequisites
- Node.js 18 or later installed
- An OpenAPI 3.x or Swagger 2.x specification file (URL or local path) for the API you want to expose
- API authentication credentials (e.g., Bearer token, API key) if the target API requires auth
- An MCP-compatible client such as Claude Desktop or Claude Code
Run the server via npx (no install required)
The simplest way to start the OpenAPI MCP server is with npx, pointing it at your API's base URL and OpenAPI spec. No global install is needed.
npx @ivotoby/openapi-mcp-server \
--api-base-url https://api.example.com \
--openapi-spec https://api.example.com/openapi.json \
--headers "Authorization:Bearer YOUR_TOKEN"Choose a tools mode
Set `--tools` to control how endpoints become tools. Use `all` (default) to expose every endpoint as a separate tool, `dynamic` to expose three meta-tools for exploring and invoking endpoints on demand, or `explicit` to whitelist specific tools.
# Dynamic mode — exposes list-api-endpoints, get-api-endpoint-schema, invoke-api-endpoint
npx @ivotoby/openapi-mcp-server \
--api-base-url https://api.example.com \
--openapi-spec https://api.example.com/openapi.json \
--tools dynamicConfigure authentication headers
Pass authentication headers as comma-separated `key:value` pairs using `--headers`. Multiple headers can be included in a single flag.
npx @ivotoby/openapi-mcp-server \
--api-base-url https://api.example.com \
--openapi-spec ./openapi.json \
--headers "Authorization:Bearer token123,X-Api-Version:2024-01"Add the server to your MCP client config
Register the OpenAPI MCP server in your `claude_desktop_config.json`. Pass the API base URL, spec path, and any auth headers as environment variables or arguments.
Test with HTTP transport (optional)
For remote or shared deployments, switch to HTTP transport. The server will listen on the specified port and accept MCP connections over HTTP instead of stdio.
npx @ivotoby/openapi-mcp-server \
--api-base-url https://api.example.com \
--openapi-spec https://api.example.com/openapi.json \
--transport http \
--port 3000OpenAPI MCP Examples
Client configuration
Add the OpenAPI MCP server to claude_desktop_config.json. Set API_BASE_URL, OPENAPI_SPEC_PATH, and API_HEADERS as environment variables for a clean config.
{
"mcpServers": {
"openapi": {
"command": "npx",
"args": ["-y", "@ivotoby/openapi-mcp-server"],
"env": {
"API_BASE_URL": "https://api.example.com",
"OPENAPI_SPEC_PATH": "https://api.example.com/openapi.json",
"API_HEADERS": "Authorization:Bearer YOUR_TOKEN",
"TOOLS_MODE": "all"
}
}
}
}Prompts to try
Once configured, use these prompts to interact with your API through natural language.
- "List all available endpoints in this API"
- "Get the schema for the POST /users endpoint"
- "Create a new user with name 'Alice' and email '[email protected]'"
- "Fetch the details for order ID 12345"
- "What authentication methods does this API support?"Troubleshooting OpenAPI MCP
The server fails to start with 'Cannot read OpenAPI spec'
Verify that OPENAPI_SPEC_PATH points to a valid, accessible OpenAPI 3.x or Swagger 2.x JSON/YAML file. If using a remote URL, ensure it is publicly accessible or that any required auth headers are passed with --headers. Try downloading the spec locally first.
API calls return 401 Unauthorized
Check that the API_HEADERS environment variable (or --headers flag) includes the correct authentication header in `key:value` format, e.g. `Authorization:Bearer YOUR_TOKEN`. For mTLS-protected APIs, also set CLIENT_CERT_PATH and CLIENT_KEY_PATH.
Too many tools are generated and the LLM context is overloaded
Switch to dynamic mode by setting TOOLS_MODE=dynamic (or --tools dynamic). This exposes only three meta-tools — list-api-endpoints, get-api-endpoint-schema, invoke-api-endpoint — letting the LLM discover and call endpoints on demand without loading all tool definitions at once.
Frequently Asked Questions about OpenAPI MCP
What is OpenAPI MCP?
OpenAPI MCP is a Model Context Protocol (MCP) server that generic mcp server that dynamically exposes any openapi-documented rest api to llms by auto-discovering endpoints. it provides tools for exploring api capabilities and making authenticated requests directly through natural language interfaces. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install OpenAPI MCP?
Install via npm with the command: npx -y @ivotoby/openapi-mcp-server. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).
Which AI clients work with OpenAPI MCP?
OpenAPI MCP works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is OpenAPI MCP free to use?
Yes, OpenAPI MCP is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
OpenAPI MCP Alternatives — Similar APIs Servers
Looking for alternatives to OpenAPI MCP? Here are other popular apis servers you can use with Claude, Cursor, and VS Code.
Kong
★ 43.4k🦍 The API and AI Gateway
API Mega List
★ 5.4kThis GitHub repo is a powerhouse collection of APIs you can start using immediately to build everything from simple automations to full-scale applications. One of the most valuable API lists on GitHub—period. 💪
Fetch
★ 5.4kFetch web content and convert to markdown for AI consumption
Fusio
★ 2.1kSelf-Hosted API Management for Builders
Korean Law
★ 1.8k국가법령정보MCP v4.0 | 법제처 41개 API → 17개 MCP 도구. 법령·판례·조례 검색 + LLM 환각 방지 인용검증 + 조문 영향 그래프(impact_map) + 시점 비교 자동 diff(time_travel) + 시민 5단계 실행 가이드(action_plan) | 41 Korean legal APIs → 17 MCP tools
RuleGo
★ 1.5k⛓️RuleGo is a lightweight, high-performance, embedded, next-generation component orchestration rule engine framework for Go.
Browse More APIs MCP Servers
Explore all apis servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up OpenAPI 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 MCP?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.