openapi-go-mcp
Generate Go MCP servers from OpenAPI 3.x and Swagger 2.0 specifications, turning API operations into agent tools.
Problem
Existing APIs often already describe their operations and schemas, but making them usable by agents still requires repetitive MCP integration work.
Approach
Use the OpenAPI contract as the source of truth and generate a Go MCP layer that delegates to typed HTTP clients.
Architecture
- 01OpenAPI specification
- 02openapi-go-mcp generator
- 03MCP server and tool registry
- 04Agent or MCP host
Why I built it
I wanted the MCP layer to be a consequence of a maintained API contract, not another hand-written integration to keep in sync.
Key decisions
- ▸Keep generated code compatible with different MCP runtimes through a small server interface.
- ▸Preserve schema fidelity and give spec authors an explicit x-mcp control over tool exposure.
- ▸Support both standalone proxy generation and embedding into an existing Go service.
Related writing
- Model Context Protocol: The "USB-C" for AI →
Anthropic's Model Context Protocol gives LLMs a plug-and-play standard for tools and data — what it is, how it works, and why it ends the N×M integration problem.
- From OpenAPI to MCP Server: Bridging REST APIs and AI Agents with Go →
Every REST API already carries the schema an MCP server needs. openapi-go-mcp turns that spec into a working Model Context Protocol server in minutes, not days.