Overview
What is OpenAPI to MCP?
OpenAPI to MCP converts an OpenAPI specification file into an MCP server that allows AI agents or other MCP-compatible clients to interact with existing web APIs described by OpenAPI specifications.
How to use OpenAPI to MCP?
Install Node.js (v16+), clone the repository, run npm install, then npm run build to compile TypeScript. Start the server with npm start -- serve -f ./path/to/your/openapi.json (options include --port and --host). Connect as an MCP client using the modern Streamable HTTP transport or the legacy SSE endpoint.
Key features of OpenAPI to MCP
- Automatic conversion of OpenAPI operations to MCP tools
- Support for both modern Streamable HTTP and legacy SSE transports
- Automatic API base URL detection from OpenAPI specs
- Support for OpenAPI/Swagger 2.0 and OpenAPI 3.x
- Binary response handling and graceful shutdown
- Detailed logging for debugging
Use cases of OpenAPI to MCP
- Expose any OpenAPI-described REST API as MCP tools for AI assistants
- Enable legacy SSE clients to interact with APIs via MCP
- Quickly prototype MCP servers without manual tool definitions
- Integrate multiple existing web APIs into a single MCP-enabled workflow
FAQ from OpenAPI to MCP
What runtime does OpenAPI to MCP require?
Node.js v16 or later is required. The server is written in TypeScript and compiled to JavaScript.
Does OpenAPI to MCP handle authentication?
No, authentication is not implemented in the current version.
What transports does OpenAPI to MCP support?
It supports both modern Streamable HTTP transport (recommended) and legacy SSE transport for backwards compatibility.
Are there any schema validation limitations?
Basic schema validation is in place, but some complex OpenAPI schema features like discriminators and complex compositions may not be fully supported.
Where can I find the source code and contribute?
The repository is available at the location from which the README is taken; contributions are welcome via Pull Requests.