Production-grade solution for API spec analysis - An async FastAPI service that indexes and queries OpenAPI endpoints using endpoint-centric semantic search. Solves Claude MCP's silent failures with large specs (>100KB) through:
make_request tool handles complex API calls that break naive implementationsTechnical highlights:
query -> [Embedding] -> FAISS TopK -> OpenAPI docs -> MCP Client (Claude Desktop)
MCP Client -> Construct OpenAPI Request -> Execute Request -> Return Response
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>
The api base_url is https://api.example.com
In chat, you can do:
Get prices for all stocks
buryhuang/mcp-server-any-openapi)pip install)This server specifically solves:
Oversized OpenAPI Processing
Fixes Claude MCP's silent failures with API specs >100KB through:
Scalable Vector Search
In-memory indexing enables:
Initialization Delay
First startup requires:
Embedding Quality Tradeoff
Smaller model has:
pip install mcp-server-any-openapi
Customize through environment variables:
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 ...
The server provides the following tools (where {prefix} is determined by MCP_API_PREFIX):
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')"
}
}
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
}
}
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 .
Control tool names through MCP_API_PREFIX:
# Produces tools with "finance_api" prefix:
docker run -e MCP_API_PREFIX=finance_ ...
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:
Server Implementation:
python -m mcp_server_any_openapi
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",
"buryhuang/mcp-server-any-openapi:latest"
]
}
}
}
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)This project is licensed under the terms included in the LICENSE file.
Content type
Image
Digest
sha256:1e1af0d05…
Size
6.8 GB
Last updated
over 1 year ago
docker pull buryhuang/mcp-server-any-openapi