MCP Server: Scalable OpenAPI Endpoint Discovery and API Request Tool logo

MCP Server: Scalable OpenAPI Endpoint Discovery and API Request Tool

by baryhuang

MCP Server is a tool designed to serve private APIs with large OpenAPI specifications. It uses in-memory semantic search to find relevant API endpoints by natural language and returns complete endpoint documentation, enabling Claude to understand and call the APIs effectively.

View on GitHub

Last updated: N/A

What is MCP Server: Scalable OpenAPI Endpoint Discovery and API Request Tool?

MCP Server is a FastAPI-based server that provides a scalable solution for discovering and using APIs described by OpenAPI specifications, especially when dealing with large or complex API definitions. It leverages semantic search to identify relevant endpoints based on natural language queries and provides the necessary tools for making API requests.

How to use MCP Server: Scalable OpenAPI Endpoint Discovery and API Request Tool?

  1. Deploy the MCP Server using Docker or by running from source.
  2. Configure the OPENAPI_JSON_DOCS_URL environment variable to point to your OpenAPI specification.
  3. Set the MCP_API_PREFIX to customize the tool namespace.
  4. Optionally, use GLOBAL_TOOL_PROMPT to provide context for Claude.
  5. Integrate the server with Claude Desktop by configuring the MCP server settings.
  6. Use natural language queries in Claude to interact with the API through the provided tools.

Key features of MCP Server: Scalable OpenAPI Endpoint Discovery and API Request Tool

  • Remote OpenAPI JSON source: No local file system access or updates required for API changes.

  • Semantic search: Uses optimized MiniLM-L3 model for efficient endpoint discovery.

  • FastAPI-based server: Asynchronous support for high performance.

  • Endpoint-based chunking: Handles large OpenAPI specs by chunking into individual endpoints.

  • In-memory FAISS vector search: Enables instant endpoint discovery.

Use cases of MCP Server: Scalable OpenAPI Endpoint Discovery and API Request Tool

  • Integrating private APIs with Claude Desktop.

  • Providing natural language access to complex APIs.

  • Enabling Claude to discover and use APIs with large OpenAPI specifications.

  • Creating a scalable API endpoint discovery service.

FAQ from MCP Server: Scalable OpenAPI Endpoint Discovery and API Request Tool

What is the purpose of the GLOBAL_TOOL_PROMPT?

The GLOBAL_TOOL_PROMPT is used to prepend text to all tool descriptions, which helps Claude select and not select your tool accurately by providing additional context.

How does MCP Server handle large OpenAPI specifications?

MCP Server uses endpoint-based chunking to process large OpenAPI specs, indexing individual endpoints with their path, method, and parameters for efficient semantic search.

What is the role of the MiniLM-L3 model?

The MiniLM-L3 model is used for semantic search, allowing the server to find relevant API endpoints based on natural language queries.

How do I customize the tool names?

You can customize the tool names by setting the MCP_API_PREFIX environment variable. This will prefix the tool names with the specified value.

What if huggingface is down?

The latest docker image is embedding pre-downloaded models, so there is no dependency over huggingface.