Logo de MCP服务器:可扩展的OpenAPI端点发现与API请求工具

MCP服务器:可扩展的OpenAPI端点发现与API请求工具

Comunidade
baryhuang

A MCP server that enables Claude to discover and call any API endpoint through semantic search. Intelligently chunks OpenAPI specifications to handle large API documentation, with built-in request execution capabilities. Perfect for integrating private APIs with Claude Desktop.

Publicado porbaryhuang
Repositóriomcp-server-any-openapi
IdiomaPython
Forks
19
Estrelas
82
Ferramentas disponíveis
0
Tipo de transportestdio
Categorias
LicençaMIT
Links
  • Conecte ferramentas a fluxos de trabalho de IA

    MCP服务器:可扩展的OpenAPI端点发现与API请求工具 disponibiliza recursos MCP que podem ser usados por clientes e agentes de IA compatíveis.

  • 0 ferramentas disponíveis

    Confira abaixo as ações que podem ser chamadas, incluindo nomes e descrições quando fornecidos pelo servidor.

  • Configuração pronta para copiar

    Use os exemplos de instalação para configurar este servidor no seu cliente MCP preferido.

  • Indicadores da comunidade de código aberto

    82 estrelas e 19 forks no repositório vinculado.

MCP Server: Scalable OpenAPI Endpoint Discovery and API Request Tool

Docker Hub License: MIT

TODO

  • 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.

Configuration

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
    # Creates tools: custom_api_request_schema and custom_make_request
    docker run -e MCP_API_PREFIX=finance ...
  • GLOBAL_TOOL_PROMPT: Optional text to prepend to all tool descriptions. This is crucial to make the Claude select and not select your tool accurately.
    bash
    # 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 ." ...

TL'DR

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 the full 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

Technical highlights:

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

Features

  • 🧠 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

Limitations

  • 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.

Multi-instance config example

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

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

In this example:

  • The server will automatically extract base URLs from the OpenAPI docs:
    • https://api.finance.com for finance APIs
    • https://api.healthcare.com for healthcare APIs
  • You can optionally override the base URL using API_REQUEST_BASE_URL environment variable:
json
{
  "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"
      ]
    }
  }
}

Claude Desktop Usage Example

Claude Desktop Project Prompt:

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.

In chat, you can do:

Get prices for all stocks

Installation

Installing via Smithery

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

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

Using pip

bash
pip install mcp-server-any-openapi

Available Tools

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

{prefix}_api_request_schema

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

Input Schema:

json
{
    "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:

json
{
    "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:

json
{
    "status_code": 200,
    "headers": {
        "content-type": "application/json",
        ...
    },
    "body": {
        // Response data
    }
}

Docker Support

Multi-Architecture Builds

Official images support 3 platforms:

bash
# 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 .

Flexible Tool Naming

Control tool names through MCP_API_PREFIX:

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

Supported Platforms

  • linux/amd64
  • linux/arm64

Option 1: Use Prebuilt Image (Docker Hub)

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

Option 2: Local Development Build

bash
docker build -t mcp-server-any-openapi .

Running the Container

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

Key Components

  1. EndpointSearcher: Core class that handles:

    • OpenAPI specification parsing
    • Semantic search index creation
    • Endpoint documentation formatting
    • Natural language query processing
  2. Server Implementation:

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

Running from Source

bash
python -m mcp_server_any_openapi

Integration with Claude Desktop

Configure the MCP server in your Claude Desktop settings:

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

Contributing

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

License

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

Implementation Notes

  • 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
  • Optimized Spec Handling: Processes OpenAPI specs up to 10MB (~5,000 endpoints) through:
    • Lazy loading of schema components
    • Parallel parsing of path items
    • Selective embedding generation (omits redundant descriptions)

Instalação

TypingMind
{
  "mcpServers": {
    "mcp-server-any-openapi": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "OPENAPI_JSON_DOCS_URL={{config.OPENAPI_JSON_DOCS_URL}}",
        "-e",
        "MCP_API_PREFIX={{config.MCP_API_PREFIX}}",
        "-e",
        "GLOBAL_TOOL_PROMPT={{config.GLOBAL_TOOL_PROMPT}}",
        "buryhuang/mcp-server-any-openapi:latest"
      ],
      "env": {
        "OPENAPI_JSON_DOCS_URL": "<OPENAPI_JSON_DOCS_URL>",
        "MCP_API_PREFIX": "<MCP_API_PREFIX>"
      }
    }
  }
}

Use o MCP de MCP服务器:可扩展的OpenAPI端点发现与API请求工具 com vários modelos de IA

O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho. Assim, após conectar MCP服务器:可扩展的OpenAPI端点发现与API请求工具, é possível usá-lo com diferentes modelos de IA no TypingMind, em vez de configurá-lo separadamente para cada modelo. Este MCP é executado localmente no seu dispositivo por meio do conector MCP do TypingMind.

Guia de configuração para usar o conector local

Use esta opção quando o servidor MCP precisar acessar arquivos locais, aplicativos ou recursos privados no seu computador.

1

Abra as configurações de MCP

No TypingMind, vá até Configurações, Configurações avançadas e depois Model Context Protocol e selecione Configurar conector.

  1. Abra o TypingMind no navegador.
  2. Clique no ícone de Ajustes.
  3. Acesse Configurações avançadas.
  4. Abra a seção Model Context Protocol.
  5. Clique em Configurar conector e selecione Este dispositivo.
Tela de configuração do conector MCP do TypingMind com a opção Este dispositivo selecionada
2

Execute o comando do conector

Selecione Este dispositivo, copie o comando do TypingMind e execute-o no Terminal. Mantenha o processo em execução enquanto usa o MCP.

  1. Copie o comando de configuração exibido pelo TypingMind.
  2. Abra o Terminal no macOS ou o Windows Terminal no Windows.
  3. Cole e execute o comando.
  4. Autorize a instalação do pacote se o Terminal pedir confirmação para continuar.
  5. Mantenha o processo em execução na janela do Terminal enquanto usa as ferramentas MCP.
3

Adicione MCP服务器:可扩展的OpenAPI端点发现与API请求工具 como servidor

Quando o status do conector for Pronto, clique em Editar e cole a configuração do servidor MCP.

  1. Aguarde até que o status do conector mostre Pronto.
  2. Clique em Editar.
  3. Cole a configuração do servidor MCP de MCP服务器:可扩展的OpenAPI端点发现与API请求工具.
  4. Salve a lista de servidores.
  5. Atualize para confirmar se o conector ainda está pronto para uso.
Configurações de MCP do TypingMind mostrando um servidor ativo e o botão Editar
{
  "mcpServers": {
    "mcp-server-any-openapi": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-any-openapi"
      ]
    }
  }
}
4

Use a conexão com diferentes modelos

Salve a lista de servidores, abra Plugins, ative as ferramentas MCP de MCP服务器:可扩展的OpenAPI端点发现与API请求工具, selecione qualquer modelo de IA compatível no TypingMind e use as ferramentas no chat ou atribua-as a um agente de IA.

  1. Abra a página Plugins no TypingMind.
  2. Ative as ferramentas MCP de MCP服务器:可扩展的OpenAPI端点发现与API请求工具.
  3. Inicie um chat e escolha o modelo de IA que deseja usar.
  4. Use as ferramentas MCP no chat ou atribua-as a um agente de IA.
  5. Mude para outro modelo de IA sempre que necessário, sem reconectar o MCP.
Chat do TypingMind usando ferramentas MCP ativadas com um modelo de IA selecionado
Pode usar MCP服务器:可扩展的OpenAPI端点发现与API请求工具 para me ajudar nesta tarefa?
MCP服务器:可扩展的OpenAPI端点发现与API请求工具
Claro. Já li.
Veja o que encontrei usando MCP服务器:可扩展的OpenAPI端点发现与API请求工具.

Perguntas frequentes

Para que serve o servidor MCP MCP服务器:可扩展的OpenAPI端点发现与API请求工具?

MCP服务器:可扩展的OpenAPI端点发现与API请求工具 é um servidor MCP que permite que aplicativos de IA compatíveis se conectem a ferramentas externas e informações de contexto. No TypingMind, basta adicionar esse servidor MCP uma vez para disponibilizar suas ferramentas no seu espaço de trabalho com IA.

Posso usar o MCP MCP服务器:可扩展的OpenAPI端点发现与API请求工具 com vários modelos de IA no TypingMind?

Sim. O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho, permitindo usar MCP服务器:可扩展的OpenAPI端点发现与API请求工具 com diferentes modelos de IA, como Claude, ChatGPT, Gemini ou outros modelos configurados no TypingMind, sem configurar o servidor MCP separadamente para cada modelo.

Por que usar o MCP MCP服务器:可扩展的OpenAPI端点发现与API请求工具 com o TypingMind?

O TypingMind é uma das melhores interfaces de chat com LLMs porque reúne vários modelos de IA, prompts, plugins, agentes de IA, chaves de API e ferramentas MCP em um só espaço de trabalho. Com MCP服务器:可扩展的OpenAPI端点发现与API请求工具 conectado, é possível usar suas ferramentas MCP nos seus modelos preferidos e manter seu fluxo de trabalho de chat organizado no TypingMind.

Como conecto o MCP MCP服务器:可扩展的OpenAPI端点发现与API请求工具 ao TypingMind?

MCP服务器:可扩展的OpenAPI端点发现与API请求工具 funciona por meio do conector MCP local do TypingMind. Essa é a melhor opção quando o servidor MCP precisa acessar arquivos locais, apps de desktop, ferramentas de linha de comando ou recursos privados no seu computador.

Quais ferramentas o MCP MCP服务器:可扩展的OpenAPI端点发现与API请求工具 oferece no TypingMind?

MCP服务器:可扩展的OpenAPI端点发现与API请求工具 disponibiliza recursos MCP que podem ser ativados na página Plugins do TypingMind e usados no chat ou atribuídos a agentes de IA.

Preciso compartilhar minhas chaves de API com o TypingMind para usar o MCP MCP服务器:可扩展的OpenAPI端点发现与API请求工具?

Não. O TypingMind prioriza o uso local e permite manter seus provedores de modelos, chaves de API, prompts e configuração MCP sob seu controle. Se MCP服务器:可扩展的OpenAPI端点发现与API请求工具 exigir autenticação, adicione os cabeçalhos, as configurações OAuth ou a configuração local exigidos por esse servidor MCP ao criar a conexão.

Servidores MCP relacionados

Ver todos

Crie seu próprio espaço de IA agora

Inscreva-se na nossa newsletter para receber novidades sobre recursos e futuros sorteios 👇