OpenAPI to MCP

v1.0.0APIsstable

A tool&lib that can automatically convert OpenAPI documents into Higress remote MCP server configurations.

openapi-to-mcpservermcpai-integration
Share:
265
Stars
0
Downloads
0
Weekly
0/5

What is OpenAPI to MCP?

OpenAPI to MCP is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to tool&lib that can automatically convert openapi documents into higress remote mcp server configurations.

A tool&lib that can automatically convert OpenAPI documents into Higress remote MCP server configurations.

This server falls under the APIs and Developer Tools categories on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A tool&lib that can automatically convert OpenAPI documents

Use Cases

Automatically convert OpenAPI documents into MCP server configs.
Transform API specifications into Higress remote MCP servers.
Streamline integration of REST APIs with MCP.
higress-group

Maintainer

LicenseApache-2.0
Languagego
Versionv1.0.0
UpdatedMay 19, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx openapi-to-mcpserver

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

openapi-to-mcpserver is a Go CLI tool and library that automatically converts OpenAPI 3.0 specification files (JSON or YAML) into Higress REST-to-MCP server configuration files, allowing any REST API with an OpenAPI spec to be exposed as an MCP server without manual configuration. It maps each API operation to a named MCP tool, preserves parameter descriptions and types, and supports YAML or JSON output with optional template patching and spec validation. API platform engineers and developers working with the Higress API gateway use it to rapidly make existing REST services queryable by AI assistants through the MCP protocol.

Prerequisites

  • Go 1.20 or higher installed for building from source (or use the pre-built binary)
  • An OpenAPI 3.0 specification file for the API you want to expose (JSON or YAML format)
  • Higress API gateway deployed if you plan to host the resulting MCP server configuration
  • Claude Desktop or another MCP-compatible client
1

Install the openapi-to-mcp CLI tool

Install the CLI using go install. This downloads and compiles the binary from the Higress group repository.

go install github.com/higress-group/openapi-to-mcpserver/cmd/openapi-to-mcp@latest
2

Prepare your OpenAPI specification file

Ensure your OpenAPI 3.0 spec is in JSON or YAML format. The tool reads operationId, parameter names, descriptions, and schema types from the spec to generate tool definitions.

3

Convert the OpenAPI spec to MCP configuration

Run the openapi-to-mcp command with your input spec file and desired output path. Use --server-name to set the MCP server name.

openapi-to-mcp \
  --input petstore.json \
  --output petstore-mcp.yaml \
  --server-name petstore
4

Review the generated MCP configuration

Open the output YAML file and verify that each API operation has been correctly mapped to an MCP tool with the right name, description, and parameter schema.

5

Deploy to Higress or configure as a remote MCP server

Apply the generated configuration to your Higress gateway to expose the REST API as a remote MCP server accessible to AI clients.

# Apply the MCP config to Higress
higress apply -f petstore-mcp.yaml
6

Validate your spec before conversion (optional)

Use the --validate flag to check the OpenAPI spec for errors before converting. Use --format json for JSON output instead of the default YAML.

openapi-to-mcp \
  --input myapi.yaml \
  --output myapi-mcp.yaml \
  --server-name my-api \
  --validate \
  --tool-prefix myapi_

OpenAPI to MCP Examples

Client configuration

After deploying the generated config to Higress, connect Claude Desktop to the remote MCP endpoint.

{
  "mcpServers": {
    "petstore": {
      "type": "http",
      "url": "http://your-higress-gateway/mcp/petstore"
    }
  }
}

Prompts to try

Once your REST API is exposed as an MCP server, these prompts exercise the converted tools.

- "List all pets available in the petstore with a limit of 10"
- "Show me the details for pet with ID 42"
- "Create a new pet named 'Buddy' with tag 'dog' in the petstore"
- "Convert my payments API OpenAPI spec to an MCP config with the prefix payments_"
- "What tools are available from the petstore MCP server?"

Troubleshooting OpenAPI to MCP

go install fails with module not found error

Ensure Go 1.20+ is installed and GOPATH/bin is in your PATH. Run 'go version' to check. If the module path has changed, check the GitHub repository for the latest install command.

Generated MCP config has missing tool descriptions

The tool pulls descriptions from the 'description' and 'summary' fields in your OpenAPI spec. Add or improve these fields in your spec file before converting — operationId is also required for tool naming.

Higress rejects the generated configuration file

Run openapi-to-mcp with --validate to catch spec errors before conversion. Also verify your Higress version supports the REST-to-MCP plugin. Check the Higress documentation for the minimum required version.

Frequently Asked Questions about OpenAPI to MCP

What is OpenAPI to MCP?

OpenAPI to MCP is a Model Context Protocol (MCP) server that tool&lib that can automatically convert openapi documents into higress remote mcp server configurations. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install OpenAPI to MCP?

Follow the installation instructions on the OpenAPI to MCP GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with OpenAPI to MCP?

OpenAPI to MCP 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 free to use?

Yes, OpenAPI to MCP is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.

Browse More APIs MCP Servers

Explore all apis servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "openapi-to-mcpserver": { "command": "npx", "args": ["-y", "openapi-to-mcpserver"] } } }

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

Read the full setup guide →

Ready to use OpenAPI to MCP?

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