Wrap a giant REST API (200+ endpoints) as an MCP without blowing the context
Когда использовать: Your company's API has 300 endpoints and a naive MCP dumps all of them into the system prompt, wrecking latency and hit rate.
Предварительные требования
- Python 3.9+ — pyenv / uv
- OpenAPI spec or endpoint catalog — Your API gateway / Swagger
Поток
-
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.✓ Скопировано→ Boilerplate code + search handler
-
Define workflow stagesGroup the endpoints into 3 workflows: 'read operations', 'create operations', 'admin'. Each workflow exposes only its own tools.✓ Скопировано→ 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.✓ Скопировано→ Claude sees ~10 tools, not 300
Итог: A large API surface usable by an LLM without collapsing on system prompt length.
Подводные камни
- Semantic search returns the wrong tool when descriptions are too similar — Write distinctive one-line tool descriptions; test search with held-out queries