Any OpenAPI

by baryhuang

28 stars
423 downloads
Not rated
GitHub

About

Integrates with any OpenAPI-compliant service using dynamic tool generation and vector-based semantic search for efficient API operation discovery and interaction.

Details

Author
baryhuang
Repository
baryhuang/mcp-server-any-openapi
GitHub stars
28
Downloads
423
License
MIT License
Categories
Developer Tools, API, AI, Design, Search, Frontend
Tags
#integration

- 🧠 Remote OpenAPI JSON as source – no local file updates needed
- 🔍 Semantic search with optimized MiniLM‑L3 model (43 MB)
- ⚡ In‑memory FAISS vector search for instant endpoint discovery
- 🧠 Endpoint‑based chunking handles 100 KB+ OpenAPI specs losslessly
- 🚀 Async FastAPI server with MCP protocol support
- 🐳 Multi‑architecture Docker images (linux/amd64, linux/arm64)

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Any OpenAPI
    Command (node, npx, python, etc.) docker
    Arguments
    • Argument 1 run
    • Argument 2 -i
    • Argument 3 --rm
    • Argument 4 -e
    • Argument 5 OPENAPI_JSON_DOCS_URL=https://api.finance.com/openapi.json
    • Argument 6 -e
    • Argument 7 MCP_API_PREFIX=finance
    • Argument 8 -e
    • Argument 9 GLOBAL_TOOL_PROMPT='Access to insights apis for ACME Financial Services abc.com .'
    • Argument 10 buryhuang/mcp-server-any-openapi:latest

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Customize through environment variables. GLOBAL_TOOL_PROMPT is IMPORTANT!

- 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"):
```bash

{prefix}_api_request_schema

Get API endpoint schemas that match your intent. Returns endpoint details including path, method, parameters, and response formats. 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

Essential for reliable execution with complex APIs where simplified implementations fail. Provides: 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)' } } Response Format: { 'status_code': 200, 'headers': { 'content-type': 'application/json', ... }, 'body': { // Response data } }

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "any openapi": {
            "cwd": "",
            "env": {},
            "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"
            ],
            "shell": false,
            "command": "docker"
        }
    }
}

Linux

{
    "cwd": "",
    "env": [],
    "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"
    ],
    "shell": false,
    "command": "docker"
}

Macos

{
    "cwd": "",
    "env": [],
    "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"
    ],
    "shell": false,
    "command": "docker"
}

Windows

{
    "cwd": "",
    "env": [],
    "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"
    ],
    "shell": false,
    "command": "docker"
}

MCP Server: Scalable OpenAPI Endpoint Discovery and API Request Tool

- The docker image is 2GB without pre-downloaded models. Its 3.76GB with pre-downloaded models!! Too big, someone please help me to reduce the size.

Customize through environment variables.GLOBAL_TOOL_PROMPTisIMPORTANT!

- OPENAPI_JSON_DOCS_URL: URL to the OpenAPI specification JSON (defaults tohttps://api.staging.readymojo.com/openapi.json)
- MCP_API_PREFIX: Customizable tool namespace (default "any_openapi"):

# Creates tools: custom_api_request_schema and custom_make_request docker run -e MCP_API_PREFIX=finance ...
# Adds "Access to insights apis for ACME Financial Services abc.com . " to the beginning of all tool descriptions docker run -e GLOBAL_TOOL_PROMPT="Access to insights apis for ACME Financial Services abc.com ." ...

Why I create this: I want to serve my private API, whose swagger openapi docs is a few hundreds KB in size.

- Claude MCP simply error on processing these size of file
- I attempted convert the result to YAML, not small enough and a lot of errors. FAILED
- I attempted to provide a API category, then ask MCP Client (Claude Desktop) to get the api doc by group. Still too big, FAILED.

Eventually I came down to this solution:

- It uses in-memory semantic search to find relevant Api endpoints by natural language (such as list products)
- It returns the complete end-point docs (as I designed it to store one endpoint as one chunk) in millionseconds (as it's in memory)

Boom, Claude now knows what API to call, with thefull parameters!

Wait I have to create another tool in this server to make the actual restful request, because "fetch" server simply don't work, and I don't want to debug why.

https://github.com/user-attachments/assets/484790d2-b5a7-475d-a64d-157e839ad9b0

query -> [Embedding] -> FAISS TopK -> OpenAPI docs -> MCP Client (Claude Desktop) MCP Client -> Construct OpenAPI Request -> Execute Request -> Return Response

- 🧠 Use remote openapi json file as source, no local file system access, no updating required for API changes
- 🔍 Semantic search using optimized MiniLM-L3 model (43MB vs original 90MB)
- 🚀 FastAPI-based server with async support
- 🧠 Endpoint based chunking OpenAPI specs (handles 100KB+ documents), no loss of endpoint context
- ⚡ In-memory FAISS vector search for instant endpoint discovery

- Not supporting linux/arm/v7 (build fails on Transformer library)
- 🐢 Cold start penalty (~15s for model loading) if not using docker image
- [Obsolete] Current docker image disabled downloading models. You have a dependency over huggingface. When you load the Claude Desktop, it takes some time to download the model. If huggingface is down, your server will not start.
- The latest docker image is embedding pre-downloaded models. If there is issues, I would revert to the old one.

Here is the multi-instance config example. I design it so it can more flexibly used for multiple set of apis:

{ "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" ] } } }

- The server will automatically extract base URLs from the OpenAPI docs:

- https://api.finance.comfor finance APIs
- https://api.healthcare.comfor healthcare APIs

{ "mcpServers": { "finance_openapi": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "OPENAPI_JSON_DOCS_URL=https://api.finance.com/openapi.json", "-e", "API_REQUEST_BASE_URL=https://api.finance.staging.com", "-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" ] } } }
You should get the api spec details from tools financial_api_request_schema You 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.

To install Scalable OpenAPI Endpoint Discovery and API Request Tool for Claude Desktop automatically viaSmithery:

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

The server provides the following tools (where{prefix}is determined byMCP_API_PREFIX):

Get API endpoint schemas that match your intent. Returns endpoint details including path, method, parameters, and response formats.

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

Essential for reliable executionwith complex APIs where simplified implementations fail. Provides:

{ "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)" } }
{ "status_code": 200, "headers": { "content-type": "application/json", ... }, "body": { // Response data } }
# Build and push using buildx docker buildx create --use docker buildx build --platform linux/amd64,linux/arm64 \ -t buryhuang/mcp-server-any-openapi:latest \ --push .

Control tool names throughMCP_API_PREFIX:

# Produces tools with "finance_api" prefix: docker run -e MCP_API_PREFIX=finance_ ...

Option 1: Use Prebuilt Image (Docker Hub)

docker pull buryhuang/mcp-server-any-openapi:latest
docker build -t mcp-server-any-openapi .
docker run \ -e OPENAPI_JSON_DOCS_URL=https://api.example.com/openapi.json \ -e MCP_API_PREFIX=finance \ buryhuang/mcp-server-any-openapi:latest

-

EndpointSearcher: Core class that handles:

- OpenAPI specification parsing
- Semantic search index creation
- Endpoint documentation formatting
- Natural language query processing

- Async FastAPI server
- MCP protocol support
- Tool registration and invocation handling

Configure the MCP server in your Claude Desktop settings:

{ "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" ] } } }

- Fork the repository
- Create your feature branch (git checkout -b feature/amazing-feature)
- Commit your changes (git commit -m 'Add some amazing feature')
- Push to the branch (git push origin feature/amazing-feature)
- Open a Pull Request

This project is licensed under the terms included in the LICENSE file.

- Endpoint-Centric Processing: Unlike document-level analysis that struggles with large specs, we index individual endpoints with:

- Path + Method as unique identifiers
- Parameter-aware embeddings
- Response schema context

- Lazy loading of schema components
- Parallel parsing of path items
- Selective embedding generation (omits redundant descriptions)

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Turn any OpenAPI 3.0 spec into an MCP server with zero code — deploy to Cloudflare Workers, Node.js, Docker, or run locally via npx, with a built-in OAuth 2.1 server for MCP clients that require custom connector authentication.

An MCP server for any web application with an OpenAPI specification, connecting AI models to external tools and data services.

A zero-configuration tool to automatically expose FastAPI endpoints as MCP tools.

An MCP server that enables Large Language Models to make HTTP requests and interact with web APIs. It supports automatic tool generation from OpenAPI/Swagger specifications.

CLI tool that generates MCP servers from OpenAPI/Postman specs — pip install mcpgen-cli

A secure MCP-to-OpenAPI proxy server that converts MCP tools into OpenAPI compatible HTTP servers, with support for multiple server types and automatic API documentation.

Turn any OpenAPI/Swagger spec into Claude tools. Zero config, zero code.

Connect to any OpenAPI-based API with built-in OAuth2 authentication management.

Converts OpenAPI/Swagger specifications to Model Context Protocol (MCP) format, providing a modern Web UI and a backend service.

Converts OpenAPI specifications into MCP tools, enabling AI clients to interact with external APIs seamlessly.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.