OpenAPI to MCP Tools
OpenAPI specifications => MCP (Model Context Protocol) tools
What is OpenAPI to MCP Tools?
OpenAPI to MCP Tools is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to openapi specifications => mcp (model context protocol) tools
OpenAPI specifications => MCP (Model Context Protocol) tools
This server falls under the Developer Tools and APIs categories on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- OpenAPI specifications => MCP (Model Context Protocol) tools
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx openapi2mcptoolsConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use OpenAPI to MCP Tools
openapi2mcptools is a TypeScript library and MCP server that automatically converts OpenAPI specifications into Model Context Protocol tools, allowing AI agents to interact with any REST API that has an OpenAPI definition without writing custom integration code. It reads OpenAPI specs, generates typed tool definitions via getToolsList(), and executes API calls via getToolsCaller(), bridging the gap between standard API documentation and AI tool use. API developers and AI engineers use it to rapidly expose existing REST APIs to AI models by pointing it at an OpenAPI spec.
Prerequisites
- Node.js 18 or later installed
- npm or pnpm available in your PATH
- An OpenAPI specification file (JSON or YAML) for the API you want to expose
- An MCP-compatible client such as Claude Desktop or Cursor
Clone the repository
Clone the openapi2mcptools repository to get the source code and example configurations.
git clone https://github.com/2013xile/openapi2mcptools.git
cd openapi2mcptools
npm installBuild the project
Compile the TypeScript source to JavaScript.
npm run buildPoint the converter at your OpenAPI spec
In your server entry point, create a Converter instance with your API's baseURL and load your OpenAPI specification. The converter auto-generates MCP tools from all defined endpoints.
import { Converter } from 'openapi2mcptools';
const converter = new Converter({ baseURL: 'https://api.example.com' });
await converter.load({ /* your OpenAPI spec object */ });
const tools = converter.getToolsList();
const toolCaller = converter.getToolsCaller();Register tools with the MCP server
Wire the generated tools into your MCP server using ListToolsRequestSchema and CallToolRequestSchema handlers, then connect via StdioServerTransport.
server.setRequestHandler(ListToolsRequestSchema, async () => ({
tools: converter.getToolsList()
}));
server.setRequestHandler(CallToolRequestSchema, async (request) => {
const caller = converter.getToolsCaller();
return caller(request.params.name, request.params.arguments);
});Configure your MCP client
Add the built server to your claude_desktop_config.json.
{
"mcpServers": {
"openapi-tools": {
"command": "node",
"args": ["/absolute/path/to/openapi2mcptools/build/index.js"]
}
}
}OpenAPI to MCP Tools Examples
Client configuration
Claude Desktop configuration for the openapi2mcptools server pointing to a local build.
{
"mcpServers": {
"openapi-tools": {
"command": "node",
"args": ["/path/to/openapi2mcptools/build/index.js"]
}
}
}Prompts to try
Example prompts once an OpenAPI-backed MCP server is running.
- "List all available tools generated from the OpenAPI spec."
- "Call the createUser endpoint with name 'Alice' and email '[email protected]'."
- "Search for products using the searchProducts tool with query 'laptop'."
- "What endpoints are available in the loaded API spec?"
- "Execute the getPetById operation with id 42."Troubleshooting OpenAPI to MCP Tools
Converter.load() fails with schema validation errors
Ensure your OpenAPI spec is valid JSON or YAML conforming to OpenAPI 3.0 or 3.1. Validate your spec using the Swagger Editor at editor.swagger.io before loading it.
API calls return CORS or network errors
Set the baseURL in the Converter constructor to your API's correct base URL. For APIs requiring authentication, pass custom headers via the httpClient option when creating the Converter instance.
No tools generated despite a valid spec
Check that your OpenAPI spec's paths contain operationId fields, as openapi2mcptools uses these to name the generated tools. Add operationId to each endpoint if they are missing.
Frequently Asked Questions about OpenAPI to MCP Tools
What is OpenAPI to MCP Tools?
OpenAPI to MCP Tools is a Model Context Protocol (MCP) server that openapi specifications => mcp (model context protocol) tools It connects AI assistants to external tools and data sources through a standardized interface.
How do I install OpenAPI to MCP Tools?
Follow the installation instructions on the OpenAPI to MCP Tools GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with OpenAPI to MCP Tools?
OpenAPI to MCP Tools 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 Tools free to use?
Yes, OpenAPI to MCP Tools is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
OpenAPI to MCP Tools Alternatives — Similar Developer Tools Servers
Looking for alternatives to OpenAPI to MCP Tools? 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 Tools 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 Tools?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.