Wrap a giant REST API (200+ endpoints) as an MCP without blowing the context
Wann einsetzen: Your company's API has 300 endpoints and a naive MCP dumps all of them into the system prompt, wrecking latency and hit rate.
Voraussetzungen
- Python 3.9+ — pyenv / uv
- OpenAPI spec or endpoint catalog — Your API gateway / Swagger
Ablauf
-
Scaffold with concierge-sdkUsing concierge-sdk, scaffold an MCP server that wraps my OpenAPI spec at ./openapi.yaml. Make it use semantic search rather than listing all tools up front.✓ Kopiert→ Boilerplate code + search handler
-
Define workflow stagesGroup the endpoints into 3 workflows: 'read operations', 'create operations', 'admin'. Each workflow exposes only its own tools.✓ Kopiert→ Workflow definitions with tool allowlists
-
Test with ClaudeConnect Claude Desktop to this server and verify that listing tools only shows the search tool + current workflow tools — not all 300.✓ Kopiert→ Claude sees ~10 tools, not 300
Ergebnis: A large API surface usable by an LLM without collapsing on system prompt length.
Fallstricke
- Semantic search returns the wrong tool when descriptions are too similar — Write distinctive one-line tool descriptions; test search with held-out queries