OpenAPI MCP Generator

v3.3.0Developer Toolsstable

A tool that converts OpenAPI specifications to MCP server

openapimcpmodel-context-protocolgeneratorllm
Share:
590
Stars
0
Downloads
0
Weekly
0/5

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

Convert OpenAPI specifications into MCP servers automatically.
Expose REST APIs to AI agents through generated MCP interfaces.
harsha-iiiv

Maintainer

LicenseMIT
Languagetypescript
Versionv3.3.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y openapi-mcp-generator

Manual Installation

npx -y openapi-mcp-generator

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

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

Generate 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-server
3

Install 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 build
4

Set 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"
5

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"
      }
    }
  }
}
6

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 MCP

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

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

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

Read the full setup guide →

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.

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