Skip to content

Introduction

openapi-mcp-generator turns OpenAPI 3.x specifications into MCP servers. Learn what it generates and which transport to choose.

By Updated

openapi-mcp-generator is an MIT-licensed CLI and library that turns an OpenAPI 3.0 or 3.1 specification into a Model Context Protocol (MCP) server. The generated server proxies tool calls to your existing REST API, so AI agents and other MCP clients can use your API without you writing glue code.

These docs describe version 5.0.0. Upgrading from 4.x? See Upgrading to 5.0.

What you get#

Point the generator at a spec (a local file or a URL, JSON or YAML) and it writes a complete Node.js project:

text
<output_directory>/
├── .gitignore
├── package.json
├── tsconfig.json
├── .env.example
├── src/
│   ├── index.ts
│   └── [transport-specific-files]
└── public/          # web and streamable-http: the browser playground
    ├── index.html, playground.js, playground.css, mcp-client.js
    └── playground.config.json
  • One tool per operation. Each OpenAPI operation becomes an MCP tool. Choose operations with the x-mcp extension or the tag and operation filters.
  • MCP 2026-07-28. Generated servers use the MCP TypeScript SDK v2 (@modelcontextprotocol/server) and also serve 2025-era clients that open with initialize.
  • JSON Schema validation. Arguments are validated against each tool's JSON Schema 2020-12 input schema with @cfworker/json-schema, with no code generation and no eval.
  • Annotations and structured output. Tools carry titles and read-only, destructive and idempotent hints, and JSON object responses also come back as structuredContent.
  • Authentication. API keys, bearer tokens, HTTP basic, OpenID Connect and OAuth2 client credentials, read from environment variables. Calls fail closed when required credentials are missing.
  • Four transports. stdio, web (SSE), streamable-http and cloudflare-worker.
  • Browser playground. HTTP servers serve a page at / that lists and runs tools. The same page is hosted at /playground/ for deployed servers.

Choose a starting point#

Requirements#

  • Node.js 22.19 or later to run the generator.
  • Node.js 22 or later for generated projects (Node 20 reached end of life in April 2026).

Open source and MCP Cloud#

The generator is free and open source, and it always will be. MCP Cloud is a separate hosted option that is currently in private beta and not live. If you would rather not operate the server yourself, you can join the waitlist.