Get the FREE Ultimate OpenClaw Setup Guide →

open_api_to_mcp_server

MCP server from Luctran12/open_api_to_mcp_server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. Clone the repository and navigate to the project directory: git clone <repository-url> && cd open_api_to_mcp_server
  2. Build the server binary (example uses Windows executable as per the README): go build -o open_api_to_mcp_server.exe main.go
  3. Run the server: ./open_api_to_mcp_server.exe
  4. Verify the server is running by visiting http://localhost:8080 or by checking logs for startup confirmation.

Usage after install:

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

Sponsor this space

Reach thousands of developers