Mcpgen
Transforms any OpenAPI-specified API into a fully functional Model Context Protocol server.
Mcpgen converts existing APIs, defined by an OpenAPI 3.x specification, into a Model Context Protocol (MCP) server. It operates as a single Go binary with zero configuration, streamlining the process of making any API accessible via MCP. The tool parses your OpenAPI spec, maps each API endpoint to a uniquely named MCP tool (e.g., `get_v1_users`), and serves these tools over standard I/O or Server-Sent Events (SSE). When an MCP tool is invoked, Mcpgen transparently makes the corresponding HTTP request to the original API and returns the response, effectively bridging the gap between traditional REST APIs and the Model Context Protocol.
主要功能
010 GitHub stars
02Converts OpenAPI 3.x specifications (JSON/YAML) into MCP tools
03Supports both standard I/O (stdio) and Server-Sent Events (SSE) transports
04Configurable authentication with static tokens or environment variables
05Filters API endpoints by path or HTTP method for selective exposure
06Generates standalone MCP server projects from OpenAPI specifications
使用案例
01Exposing existing REST APIs as MCP servers for AI agents or MCP-compatible clients
02Integrating any OpenAPI-defined API with tools like Claude Desktop
03Rapidly prototyping and testing API interactions through a standardized MCP interface