OpenAPI MCP Generator
A tool that converts OpenAPI specifications to MCP server
What is OpenAPI MCP Generator?
OpenAPI MCP Generator is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to tool that converts openapi specifications to mcp server
A tool that converts OpenAPI specifications to MCP server
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A tool that converts OpenAPI specifications to MCP server
Use Cases
Maintainer
Works with
Installation
NPM
npx -y openapi-mcp-generatorManual Installation
npx -y openapi-mcp-generatorConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use OpenAPI MCP Generator
OpenAPI MCP Generator is a CLI tool that converts OpenAPI 2.0/3.x specifications into fully functional MCP servers, making any REST API instantly accessible to AI agents without manual tool definitions. It reads your OpenAPI spec (from a local file or URL), generates typed TypeScript code with Zod runtime validation, and outputs a ready-to-run MCP server that exposes each API endpoint as an MCP tool. Teams use it to rapidly give AI assistants like Claude access to internal APIs, third-party services, or any OpenAPI-documented backend.
Prerequisites
- Node.js 18+ and npm installed
- An OpenAPI 2.0 or 3.x specification file (JSON or YAML) or accessible URL
- API credentials for the target API (key, bearer token, or OAuth2 client credentials as required)
- An MCP-compatible client such as Claude Desktop
Install the OpenAPI MCP Generator
Install the generator globally via npm to make the openapi-mcp-generator command available, or use npx to run it without installing.
npm install -g openapi-mcp-generatorGenerate an MCP server from your OpenAPI spec
Run the generator pointing at your OpenAPI specification file or URL. Specify an output directory where the generated TypeScript MCP server will be written.
openapi-mcp-generator --input path/to/openapi.json --output ./my-mcp-serverInstall dependencies and build the generated server
Navigate into the generated server directory, install its npm dependencies, and compile the TypeScript to JavaScript.
cd my-mcp-server
npm install
npm run buildSet authentication environment variables
Export the credentials your API requires. The variable naming pattern depends on the auth scheme name in your OpenAPI spec. Replace SCHEME_NAME with the actual security scheme name.
# API Key auth:
export API_KEY_SCHEME_NAME="your-api-key"
# Bearer token auth:
export BEARER_TOKEN_SCHEME_NAME="your-bearer-token"
# Basic auth:
export BASIC_USERNAME_SCHEME_NAME="user"
export BASIC_PASSWORD_SCHEME_NAME="pass"Configure Claude Desktop
Add the generated MCP server to Claude Desktop's configuration file. Pass the required auth credentials as environment variables.
{
"mcpServers": {
"my-api": {
"command": "node",
"args": ["/absolute/path/to/my-mcp-server/dist/index.js"],
"env": {
"API_KEY_MYSCHEME": "your-api-key-here"
}
}
}
}Filter endpoints with x-mcp extension (optional)
To include or exclude specific API endpoints from the generated MCP server, add the x-mcp boolean extension to your OpenAPI spec at the root, path, or operation level. Set to false to exclude an endpoint.
# In your OpenAPI spec YAML:
paths:
/admin/internal:
x-mcp: false
get:
summary: Internal endpoint excluded from MCPOpenAPI MCP Generator Examples
Client configuration
Claude Desktop config for a generated MCP server from a Petstore-style API with an API key auth scheme named 'apiKey'.
{
"mcpServers": {
"petstore-api": {
"command": "node",
"args": ["/Users/yourname/petstore-mcp-server/dist/index.js"],
"env": {
"API_KEY_APIKEY": "your-petstore-api-key"
}
}
}
}Prompts to try
Once the generated MCP server is running, Claude can call any endpoint in your API by name.
- "List all available pets from the Petstore API."
- "Create a new user with username 'johndoe' and email '[email protected]'."
- "Get the order status for order ID 12345."
- "What endpoints does this API expose?"Troubleshooting OpenAPI MCP Generator
Generator fails to parse the OpenAPI spec
Validate your spec first using a tool like 'npx swagger-parser validate openapi.json'. Ensure it is valid OpenAPI 2.0 or 3.x. The generator accepts both JSON and YAML formats.
Authentication errors when the MCP server calls the API
Check that your environment variable names match the security scheme names in your spec (case-sensitive). The pattern is API_KEY_<SCHEME_NAME> where SCHEME_NAME is the exact key from the OpenAPI securitySchemes section, uppercased.
TypeScript compilation errors in the generated code
Ensure Node.js 18+ is installed and that you ran 'npm install' before 'npm run build'. If errors persist, check that the openapi-mcp-generator version is up to date: npm install -g openapi-mcp-generator@latest.
Frequently Asked Questions about OpenAPI MCP Generator
What is OpenAPI MCP Generator?
OpenAPI MCP Generator is a Model Context Protocol (MCP) server that tool that converts openapi specifications to mcp server It connects AI assistants to external tools and data sources through a standardized interface.
How do I install OpenAPI MCP Generator?
Install via npm with the command: npx -y openapi-mcp-generator. 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 Generator?
OpenAPI MCP Generator works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is OpenAPI MCP Generator free to use?
Yes, OpenAPI MCP Generator is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
OpenAPI MCP Generator Alternatives — Similar Developer Tools Servers
Looking for alternatives to OpenAPI MCP Generator? 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 MCP Generator 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 Generator?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.