openapi-to-mcpserver
1
This project converts an OpenAPI specification file into an MCP server, enabling AI agents and clients to interact with web APIs. It supports advanced features like automatic conversion, modern and legacy transport options, and detailed logging.
OpenAPI to MCP
Converts an OpenAPI specification file into an MCP server that can be used to interact with existing web APIs described by OpenAPI specifications.
Features
- 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
- Graceful shutdown handling
- Detailed logging for debugging
Prerequisites
- Node.js (v16 or later recommended)
Usage
Start the server using the start
script, providing the path to your OpenAPI specification file. The server will parse the file, adapt the API operations to MCP functions, and start listening.