drio
Open app

OpenAPI to MCP Generator (openapi-mcp-generator)

Source

A tool that converts OpenAPI specifications to MCP server

Catalog onlyCatalog onlySTDIO

Overview

OpenAPI to MCP Generator is a command-line tool that converts OpenAPI specifications into Model Context Protocol (MCP) server code, facilitating the integration of Large Language Models (LLMs) with APIs.

To use the tool, install it globally via npm, yarn, or pnpm, and then run the command with the path to your OpenAPI specification and desired output directory.

  • Automatic generation of MCP tools from OpenAPI endpoints - Support for multiple transport methods: stdio, WebSocket, and HTTP - Complete project setup with all necessary files for running an MCP server - TypeScript support with definitions and configuration - Easy environment-based configuration for the generated server
  1. Quickly setting up an MCP server for an existing API.
  2. Bridging LLMs with various APIs for enhanced functionality.
  3. Automating the generation of server code from OpenAPI specifications.

Add to your AI client

Use these steps to connect OpenAPI to MCP Generator (openapi-mcp-generator) in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.

Cursor

Add this to your .cursor/mcp.json file in your project root, then restart Cursor.

.cursor/mcp.json

{
  "mcpServers": {
    "openapi-mcp-generator-harsha-iiiv": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-openapi-mcp-generator-harsha-iiiv"
      ]
    }
  }
}

Claude Desktop

Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.

~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)

{
  "mcpServers": {
    "openapi-mcp-generator-harsha-iiiv": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-openapi-mcp-generator-harsha-iiiv"
      ]
    }
  }
}

Claude Code

Add this to your project's .mcp.json file. Claude Code will detect it automatically.

.mcp.json (project root)

{
  "mcpServers": {
    "openapi-mcp-generator-harsha-iiiv": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-openapi-mcp-generator-harsha-iiiv"
      ]
    }
  }
}

VS Code (Copilot)

Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.

.vscode/mcp.json

{
  "servers": {
    "openapi-mcp-generator-harsha-iiiv": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-openapi-mcp-generator-harsha-iiiv"
      ]
    }
  }
}

Windsurf

Add this to your Windsurf MCP config file, then restart Windsurf.

~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "openapi-mcp-generator-harsha-iiiv": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-openapi-mcp-generator-harsha-iiiv"
      ]
    }
  }
}

Cline

Open Cline settings, navigate to MCP Servers, and add this server configuration.

Cline MCP Settings (via UI)

{
  "mcpServers": {
    "openapi-mcp-generator-harsha-iiiv": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-openapi-mcp-generator-harsha-iiiv"
      ]
    }
  }
}

FAQ

**What are the requirements for using this tool?**

Node.js 16.x or higher and npm 7.x or higher are required.

**Can I customize the generated server?**

Yes! You can edit the generated files and environment variables to suit your needs.

**Is there support for TypeScript?**

Yes, the tool includes TypeScript definitions and configuration.