OpenAPI to MCP Tools

v1.0.0Developer Toolsstable

OpenAPI specifications => MCP (Model Context Protocol) tools

mcpmcp-servermcp-toolsmodelcontextprotocolopenapi
Share:
19
Stars
0
Downloads
0
Weekly
0/5

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

Convert OpenAPI specifications into MCP-compatible tools automatically. Generate MCP tools from any OpenAPI-documented API. Enable AI agents to interact with REST APIs through OpenAPI definitions.
2013xile

Maintainer

LicenseMIT
Languagetypescript
Versionv1.0.0
UpdatedOct 23, 2025
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx openapi2mcptools

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 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
1

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 install
2

Build the project

Compile the TypeScript source to JavaScript.

npm run build
3

Point 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();
4

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);
});
5

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.

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": { "openapi2mcptools": { "command": "npx", "args": ["-y", "openapi2mcptools"] } } }

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

Read the full setup guide →

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.

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