OpenAPI to MCP Generator (openapi-mcp-generator)
About
A tool that converts OpenAPI specifications to MCP server
Details
- Author
- harsha-iiiv
- GitHub stars
- 614
- Downloads
- 907
- Categories
- Developer Tools
Jump to
- Converts OpenAPI 3.0+ specs into MCP-compatible servers
- Proxies calls to the original REST API with validation and auth
- Supports API key, Bearer, Basic, and OAuth2 authentication
- Generates Zod schemas for runtime input validation
- Outputs a complete, typed TypeScript project with dependencies
- Offers three transport modes: stdio, SSE (web), and StreamableHTTP
- Includes a browser-based test client for web transports
Install globally via npm (npm install -g openapi-mcp-generator), then run the CLI with --input (path/URL to an OpenAPI spec) and --output (target directory). Optionally specify transport (--transport=stdio|web|streamable-http), port, and other flags. The generated project can be run with npm start (stdio), npm run start:web, or npm run start:http.
OpenAPI to MCP Generator (openapi-mcp-generator)
Generate Model Context Protocol (MCP) servers from OpenAPI specifications.
This CLI tool automates the generation of MCP-compatible servers that proxy requests to existing REST APIs—enabling AI agents and other MCP clients to seamlessly interact with your APIs using your choice of transport methods.
---
✨ Features
- 🔧 OpenAPI 3.0 Support: Converts any OpenAPI 3.0+ spec into an MCP-compatible server.
- 🔁 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.
- 🧪 Zod Validation: Automatically generates Zod schemas from OpenAPI definitions for runtime input validation.
- ⚙️ Typed Server: Fully typed, maintainable TypeScript code output.
- 🔌 Multiple Transports: Communicate over stdio, SSE via Hono, or StreamableHTTP.
- 🧰 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-generator or pnpm add -g openapi-mcp-generator
---
🛠 Usage
```bash
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





