What is OpenAPI to Model Context Protocol (MCP)?
OpenAPI to Model Context Protocol (MCP) is a proxy server that dynamically translates OpenAPI specifications into standardized MCP tools, resources, and prompts. It bridges the gap between AI agents and external APIs, eliminating the need for custom API wrappers. Built with FastMCP, it supports stdio, SSE, and streamable HTTP transports.
How to use OpenAPI to Model Context Protocol (MCP)?
Install using uvx openapi-mcp-proxy (recommended), pip install openapi-mcp-proxy, or from source. Set environment variables such as OPENAPI_URL and SERVER_NAME, then run the server. It can be configured for Claude Desktop, Cursor, or Windsurf using provided JSON configurations for HTTP or stdio transport.
Key features of OpenAPI to Model Context Protocol (MCP)
- Dynamically converts OpenAPI operations into callable MCP tools.
- Supports OAuth2 Client Credentials and username/password authentication.
- Offers stdio, SSE, and streamable HTTP transports.
- Automatically registers OpenAPI component schemas as MCP resources.
- Generates contextual prompts to guide LLMs in API usage.
- Provides robust error handling and structured logging.
Use cases of OpenAPI to Model Context Protocol (MCP)
- Expose a public weather API (e.g., MET Norway) as MCP tools for Claude Desktop.
- Run multiple OpenAPI services (e.g., weather and petstore) simultaneously for multi-tool AI agents.
- Secure internal APIs behind authentication (OAuth2 or username/password) and make them accessible to LLM orchestrators.
- Enable local OpenAPI specs with custom headers for development or private APIs.
- Deploy as a Docker service for production-ready MCP integration.
Comments