openapi-mcp-generator weekly downloads statistics
By harsha-iiiv · npm · MCP servers
Generates MCP server code from OpenAPI specifications
openapi-mcp-generator has 30,460 recorded weekly downloads on npm, an increase of 67.9% over the past 30 days, ranking #923 of 3,247 tracked listings.
About openapi-mcp-generator
OpenAPI to MCP Generator (openapi-mcp-generator)
openapi-mcp-generator is a free, MIT-licensed CLI and library that turns an OpenAPI 3.x specification into a ready-to-run Model Context Protocol (MCP) server for stdio, SSE, Streamable HTTP or Cloudflare Workers. You own the generated TypeScript code, and tool inputs are validated against JSON Schema before any request reaches your API.
Docs · Quickstart · Browser playground · Changelog
npx openapi-mcp-generator --input ./openapi.json --output ./my-mcp
✨ Features
- 🔧 OpenAPI 3.x Support: Converts any OpenAPI 3.0 or 3.1 spec into an MCP-compatible server (convert Swagger 2.0 first).
- 🔁 Proxy Behavior: Proxies calls to your original REST API while validating request structure and security.
- 🔐 Authentication Support: API keys, Bearer tokens, Basic auth, and OAuth2 supported via environment variables; calls fail closed when required credentials are missing.
- 🧪 JSON Schema Validation: Arguments are validated against each tool's JSON Schema 2020-12 input schema (no code generation, no
eval). - 🏷️ Annotations and Structured Output: Tools carry titles and read-only/destructive/idempotent hints, and JSON object responses come back as
structuredContent(optionally with a declaredoutputSchema). - ⚙️ Typed Server: Fully typed, maintainable TypeScript code output.
- 🔌 Multiple Transports: Communicate over stdio, SSE via Hono, StreamableHTTP, or a deployable Cloudflare Worker.
- 🧰 Project Scaffold: Generates a complete Node.js project with
tsconfig.json,package.json, and entry point. - 🧪 Built-in HTML Test Clients: Test API interactions visually in your browser (for web-based transports).
🚀 Installation
npm install -g openapi-mcp-generator
You can also use
yarn global add openapi-mcp-generatororpnpm add -g openapi-mcp-generator
⬆️ Upgrading to 5.0
5.0 generates servers on the MCP TypeScript SDK v2 and supports MCP 2026-07-28 alongside 2025-era clients. Generated projects change, so upgrade deliberately:
- Commit your generated project, then regenerate with the same flags:
npx openapi-mcp-generator@5 -i ./openapi.json -o ./my-mcp --force.--forceoverwrites generated files, including your edits. - Use Node.js 22.19 or later to run the generator (generated projects need Node.js 22 or later), then run
npm install.@modelcontextprotocol/sdkis replaced by@modelcontextprotocol/server(^2.4.0), andzod,json-schema-to-zod,dotenvanduuidby@cfworker/json-schema. - Update customized code to import from
@modelcontextprotocol/server(stdio helpers from@modelcontextprotocol/server/stdio). - Streamable HTTP and Worker servers are stateless: no
mcp-session-id, andGETandDELETEon/mcpreturn405. Tool calls overPOSTare unaffected. - Missing upstream credentials now fail closed with an error naming the variables to set;
MCP_ALLOW_MISSING_CREDENTIALS=truerestores the old behavior. - An unknown tool name is now a JSON-RPC
-32602error. Integers stay integers,readOnlyproperties leave request inputs, and schema defaults are no longer injected. - Swagger 2.0 specs are refused: convert them with
npx swagger2openapi swagger.json -o openapi.json. - Credential variables, Worker secret names,
--inbound-auth,--header-passthroughandMCP_ALLOWED_ORIGINSare unchanged.
Not ready yet? Stay on 4.x with npx openapi-mcp-generator@4. Full notes: CHANGELOG.md.
🛠 Usage
# Generate an MCP server (stdio)
openapi-mcp-generator --input path/to/openapi.json --output path/to/output/dir
# Generate an MCP web server with SSE
openapi-mcp-generator --input path/to/openapi.json --output path/to/output/dir --transport=web --port=3000
# Generate an MCP StreamableHTTP server
openapi-mcp-generator --input path/to/openapi.json --output path/to/output/dir --transport=streamable-http --port=3000
# Generate a deployable Cloudflare Worker MCP server
openapi-mcp-generator --input path/to/openapi.json --output path/to/output/dir --transport=cloudflare-worker
The examples/ folder holds the Swagger Petstore generated with 5.0 for stdio
(petstore-mcp), web (pet-store-sse) and StreamableHTTP (pet-store-streamable-http).
CLI Options…
Description from the npm listing.
- openapi
- mcp
- model-context-protocol
- generator
- llm
- ai
- api
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (592)Similar npm MCP servers plugins
All 20 openapi-mcp-generator alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/openapi-mcp-generator. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.