open_api_to_mcp_server
MCP server from Luctran12/open_api_to_mcp_server
claude mcp add --transport stdio luctran12-open_api_to_mcp_server ./open_api_to_mcp_server.exe
How to use
This MCP server dynamically exposes an OpenAPI specification as MCP tools. After starting the server, you can upload your OpenAPI JSON file to generate tool definitions based on the operationId values in your spec. The server provides two communication modalities: HTTP for standard API interactions and a MCP stdio endpoint for integration with compatible AI agents. Once the spec is uploaded, you can invoke individual endpoints by their operationId through MCP tool calls, allowing agents to discover and use API endpoints as discrete tools. Authentication is optional and can be configured via Bearer token or API key if your API requires it. You can then point your LLM client to the MCP server and reference the generated tool names to perform actions such as listing resources, querying data, or triggering API operations, all mediated through the MCP protocol.
How to install
Prerequisites:
- Go installed (to build the server): https://golang.org/dl/
- A compatible OpenAPI (Swagger) specification to upload after starting the server
Installation and setup:
- Clone the repository and navigate to the project directory: git clone <repository-url> && cd open_api_to_mcp_server
- Build the server binary (example uses Windows executable as per the README): go build -o open_api_to_mcp_server.exe main.go
- Run the server: ./open_api_to_mcp_server.exe
- Verify the server is running by visiting http://localhost:8080 or by checking logs for startup confirmation.
Usage after install:
- Upload your OpenAPI spec via POST to http://localhost:8080/upload with form data spec=@path/to/openapi.json
- Call MCP-enabled endpoints via POST to http://localhost:8080/mcp with the appropriate tool name (operationId) and arguments
Additional notes
Tips and notes:
- If your API requires authentication, set the environment variables BEARER_TOKEN or API_KEY before making requests:
- BEARER_TOKEN: your Bearer token
- API_KEY: your API key
- The generated MCP tools are based on the operationId values from your OpenAPI spec; ensure your spec includes operationIds for each endpoint you want to expose.
- The server supports both HTTP and MCP stdio; for stdio, configure your MCP client to connect to the provided stdio endpoint as per MCP documentation.
- If you modify the OpenAPI spec, re-upload to refresh the generated tools.
- Ensure CORS or network policies allow access to http://localhost:8080 if you are testing from a different host.
Related MCP Servers
trpc-agent-go
trpc-agent-go is a powerful Go framework for building intelligent agent systems using large language models (LLMs) and tools.
station
Station is our open-source runtime that lets teams deploy agents on their own infrastructure with full control.
tiger-cli
Tiger CLI is the command-line interface for Tiger Cloud. It includes an MCP server for helping coding agents write production-level Postgres code.
gopls
MCP server for golang projects development: Expand AI Code Agent ability boundary to have a semantic understanding and determinisic information for golang projects.
kubernetes
A Model Context Protocol (MCP) server for the Kubernetes API.
gcp-cost
💰 An MCP server that enables AI assistants to estimate Google Cloud costs, powered by Cloud Billing Catalog API and built with Genkit for Go