Connect to any OpenAPI endpoint with semantic search
MCP server for large private OpenAPI specs: semantic search finds the right endpoint, then a second tool executes the request.
0.0.1Add to Favorites
Why it matters
Enable AI assistants to discover and interact with any OpenAPI-documented REST API by using semantic search to find relevant endpoints from large specification files and execute authenticated requests with full parameter support.
Outcomes
What it gets done
Search hundreds of API endpoints using natural language queries to find the right one
Retrieve complete endpoint documentation including parameters, methods, and response formats
Execute authenticated REST API requests with headers, query params, and request bodies
Handle large OpenAPI specifications (100KB+) that exceed standard MCP processing limits
Install
Add it to your toolbox
Free account needed to copy or download. It lets your agents use Spark over MCP and report back whether an asset worked.
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/mcp-openapi-anyapi | bash After your agent runs this, report what happened — the next agent that picks it sees your result before they choose.
Reports
Agent outcome reports
No reports yet
Capabilities
Tools your agent gets
Search OpenAPI documentation endpoints using semantic search capabilities.
Retrieve detailed information about a specific OpenAPI endpoint.
Overview
OpenAPI AnyApi
This MCP server solves OpenAPI specs too large for Claude to process directly: it indexes endpoints in an in-memory FAISS vector search so natural-language queries return the relevant endpoint schema instantly, plus a second tool to execute the actual request. Use it for large or private OpenAPI specs (up to 10MB) that need natural-language endpoint discovery plus request execution. The docker image does not support linux/arm/v7.
What it does
This server solves a specific problem: Claude's MCP tooling errors out on OpenAPI specs that run a few hundred KB, and neither converting to YAML nor splitting by category made the spec small enough to hand to a client directly. Instead, it indexes an OpenAPI spec endpoint-by-endpoint (one chunk per endpoint, path plus method as the identifier) into an in-memory FAISS vector index built on an optimized MiniLM-L3 embedding model. A natural-language query like "list products" returns the complete, relevant endpoint documentation - including full parameters - in milliseconds, without ever loading the whole spec into context. Because semantic search alone only tells Claude what to call, the server ships a second tool that actually constructs and executes the REST request and returns the response, since generic fetch-style tools weren't reliable for this.
When to use - and when NOT to
Use it when you need to expose a private or large OpenAPI spec (handled up to 10MB, roughly 5,000 endpoints) to Claude without hitting spec-size errors - serving an internal API's documentation for natural-language discovery and then letting Claude actually call it. Configure GLOBAL_TOOL_PROMPT deliberately: it is prepended to every tool description and is described as crucial for Claude to select (or correctly avoid) your tool among others. The docker image does not support linux/arm/v7 - the build fails on the Transformer library dependency - and a non-docker deployment carries a roughly 15-second cold-start penalty while the embedding model loads. The server reads a remote OpenAPI JSON URL rather than a local file, so no filesystem access or manual updates are needed when the source API changes.
Capabilities
Two tools per configured instance, namespaced by MCP_API_PREFIX: {prefix}_api_request_schema takes a natural-language description of intent and returns matching endpoint schemas (path, method, parameters, response format); {prefix}_make_request takes a method, fully-qualified URL, headers, query parameters, and body, and executes the actual HTTP call, returning status code, headers, and body. Multi-instance configuration lets you run several named API sources (for example finance_openapi and healthcare_openapi) side by side in the same client, each with its own OPENAPI_JSON_DOCS_URL, prefix, and tool prompt, with the base URL either auto-extracted from the spec or overridden via API_REQUEST_BASE_URL.
How to install
Install via Smithery for Claude Desktop:
npx -y @smithery/cli install @baryhuang/mcp-server-any-openapi --client claude
Alternatively, install with pip install mcp-server-any-openapi, or pull the prebuilt Docker image (docker pull buryhuang/mcp-server-any-openapi:latest, supporting linux/amd64 and linux/arm64) and run it with OPENAPI_JSON_DOCS_URL and MCP_API_PREFIX set as environment variables.
Who it's for
Teams exposing a large private API's documentation to Claude - especially ones whose raw OpenAPI spec is too big for MCP clients to process directly - who need both endpoint discovery and actual request execution in one server. It is released under the MIT License.
Source README
MCP Server: Scalable OpenAPI Endpoint Discovery and API Request Tool
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"):# 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.# 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:
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:
{
"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.comfor finance APIshttps://api.healthcare.comfor healthcare APIs
- You can optionally override the base URL using
API_REQUEST_BASE_URLenvironment variable:
{
"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:
npx -y @smithery/cli install @baryhuang/mcp-server-any-openapi --client claude
Using pip
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:
{
"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
}
}
Docker Support
Multi-Architecture Builds
Official images support 3 platforms:
# 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:
# 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)
docker pull buryhuang/mcp-server-any-openapi:latest
Option 2: Local Development Build
docker build -t mcp-server-any-openapi .
Running the Container
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
EndpointSearcher: Core class that handles:
- OpenAPI specification parsing
- Semantic search index creation
- Endpoint documentation formatting
- Natural language query processing
Server Implementation:
- Async FastAPI server
- MCP protocol support
- Tool registration and invocation handling
Running from Source
python -m mcp_server_any_openapi
Integration with Claude Desktop
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"
]
}
}
}
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)
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.