Any OpenAPI MCP server

Integrates with any OpenAPI-compliant service using dynamic tool generation and vector-based semantic search for efficient API operation discovery and interaction.
Back to servers
Setup instructions
Provider
Bary Huang
Release date
Feb 09, 2025
Language
Python
Stats
56 stars

The MCP Server is a tool that simplifies accessing OpenAPI endpoints through semantic search. It allows Claude to discover and interact with API endpoints using natural language queries, even with large API specifications that would normally be too complex to process directly.

Installation Options

Using Docker (Recommended)

Pull the pre-built image from Docker Hub:

docker pull buryhuang/mcp-server-any-openapi:latest

Run the container with your API configuration:

docker run -e OPENAPI_JSON_DOCS_URL=https://api.example.com/openapi.json -e MCP_API_PREFIX=myapi buryhuang/mcp-server-any-openapi:latest

Using pip

Install directly from PyPI:

pip install mcp-server-any-openapi

Run the server:

python -m mcp_server_any_openapi

Installing via Smithery

Automatically install for Claude Desktop using Smithery:

npx -y @smithery/cli install @baryhuang/mcp-server-any-openapi --client claude

Configuration

Customize behavior through environment variables:

Essential Configuration

  • OPENAPI_JSON_DOCS_URL: URL to the OpenAPI specification JSON (defaults to https://api.staging.readymojo.com/openapi.json)
  • MCP_API_PREFIX: Customizable tool namespace (default "any_openapi")
  • GLOBAL_TOOL_PROMPT: Optional text to prepend to all tool descriptions (important for accurate tool selection)

Example Configuration

docker run \
  -e OPENAPI_JSON_DOCS_URL=https://api.finance.com/openapi.json \
  -e MCP_API_PREFIX=finance \
  -e GLOBAL_TOOL_PROMPT="Access to insights apis for ACME Financial Services abc.com ." \
  buryhuang/mcp-server-any-openapi:latest

Integration with Claude Desktop

Configure in your Claude Desktop settings by adding to the multi-instance configuration:

{
  "mcpServers": {
    "any_openapi": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "OPENAPI_JSON_DOCS_URL=https://api.example.com/openapi.json",
        "-e",
        "MCP_API_PREFIX=finance",
        "-e",
        "GLOBAL_TOOL_PROMPT=Access to insights apis for ACME Financial Services abc.com .",
        "buryhuang/mcp-server-any-openapi:latest"
      ]
    }
  }
}

Available Tools

The server provides two main tools (where {prefix} is determined by MCP_API_PREFIX):

{prefix}_api_request_schema

Discovers API endpoints based on natural language queries.

Input Schema:

{
    "query": {
        "type": "string",
        "description": "Describe what you want to do with the API (e.g., 'Get user profile information', 'Create a new job posting')"
    }
}

{prefix}_make_request

Executes API requests with proper parameters.

Input Schema:

{
    "method": {
        "type": "string",
        "description": "HTTP method (GET, POST, PUT, DELETE, PATCH)",
        "enum": ["GET", "POST", "PUT", "DELETE", "PATCH"]
    },
    "url": {
        "type": "string",
        "description": "Fully qualified API URL (e.g., https://api.example.com/users/123)"
    },
    "headers": {
        "type": "object",
        "description": "Request headers (optional)",
        "additionalProperties": {
            "type": "string"
        }
    },
    "query_params": {
        "type": "object",
        "description": "Query parameters (optional)",
        "additionalProperties": {
            "type": "string"
        }
    },
    "body": {
        "type": "object",
        "description": "Request body for POST, PUT, PATCH (optional)"
    }
}

Multi-Instance Configuration Example

Configure multiple API integrations in one Claude Desktop setup:

{
  "mcpServers": {
    "finance_openapi": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "OPENAPI_JSON_DOCS_URL=https://api.finance.com/openapi.json",
        "-e",
        "MCP_API_PREFIX=finance",
        "-e",
        "GLOBAL_TOOL_PROMPT=Access to insights apis for ACME Financial Services abc.com .",
        "buryhuang/mcp-server-any-openapi:latest"
      ]
    },
    "healthcare_openapi": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "OPENAPI_JSON_DOCS_URL=https://api.healthcare.com/openapi.json",
        "-e",
        "MCP_API_PREFIX=healthcare",
        "-e",
        "GLOBAL_TOOL_PROMPT=Access to insights apis for Healthcare API services efg.com .",
        "buryhuang/mcp-server-any-openapi:latest"
      ]
    }
  }
}

You can override the base URL from the OpenAPI specification using:

-e API_REQUEST_BASE_URL=https://api.finance.staging.com

Usage Example

In Claude Desktop, add this to your project prompt:

You should get the api spec details from tools financial_api_request_schema

Your task is use financial_make_request tool to make the requests to get response. You should follow the api spec to add authorization header:
Authorization: Bearer <xxxxxxxxx>

Note: The base URL will be returned in the api_request_schema response, you don't need to specify it manually.

Then in the conversation, you can ask natural language questions like:

Get prices for all stocks

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "finance_openapi" '{"command":"docker","args":["run","-i","--rm","-e","OPENAPI_JSON_DOCS_URL=https://api.finance.com/openapi.json","-e","MCP_API_PREFIX=finance","-e","GLOBAL_TOOL_PROMPT='Access to insights apis for ACME Financial Services abc.com .'","buryhuang/mcp-server-any-openapi:latest"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "finance_openapi": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "-e",
                "OPENAPI_JSON_DOCS_URL=https://api.finance.com/openapi.json",
                "-e",
                "MCP_API_PREFIX=finance",
                "-e",
                "GLOBAL_TOOL_PROMPT='Access to insights apis for ACME Financial Services abc.com .'",
                "buryhuang/mcp-server-any-openapi:latest"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "finance_openapi": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "-e",
                "OPENAPI_JSON_DOCS_URL=https://api.finance.com/openapi.json",
                "-e",
                "MCP_API_PREFIX=finance",
                "-e",
                "GLOBAL_TOOL_PROMPT='Access to insights apis for ACME Financial Services abc.com .'",
                "buryhuang/mcp-server-any-openapi:latest"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later