Wrap a giant REST API (200+ endpoints) as an MCP without blowing the context
Quand l'utiliser : Your company's API has 300 endpoints and a naive MCP dumps all of them into the system prompt, wrecking latency and hit rate.
Prérequis
- Python 3.9+ — pyenv / uv
- OpenAPI spec or endpoint catalog — Your API gateway / Swagger
Déroulement
-
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.✓ Copié→ Boilerplate code + search handler
-
Define workflow stagesGroup the endpoints into 3 workflows: 'read operations', 'create operations', 'admin'. Each workflow exposes only its own tools.✓ Copié→ 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.✓ Copié→ Claude sees ~10 tools, not 300
Résultat : A large API surface usable by an LLM without collapsing on system prompt length.
Pièges
- Semantic search returns the wrong tool when descriptions are too similar — Write distinctive one-line tool descriptions; test search with held-out queries