High-level overview of Super-MCP's component architecture and request flow.
- README.md – Quick start and configuration guide
- docs/plans/251208_architecture_improvement_plan.md – Internal refactoring notes
- src/server.ts – MCP server and routing
- src/registry.ts – Config and client management
- src/catalog.ts – Tool caching
┌─────────────────────────────────────────────────────────────┐
│ Super-MCP Router │
├─────────────────────────────────────────────────────────────┤
│ server.ts │ Meta-tools: list_tool_packages, │
│ (MCP Server) │ list_tools, use_tool, get_help, │
│ │ authenticate, health_check_all │
├─────────────────────┼───────────────────────────────────────┤
│ registry.ts │ Config loading, package management, │
│ (PackageRegistry) │ client lifecycle, connection caching │
├─────────────────────┼───────────────────────────────────────┤
│ catalog.ts │ Tool discovery, schema caching, │
│ (Catalog) │ pagination, ETags │
├─────────────────────┼───────────────────────────────────────┤
│ security.ts │ Layered allowlist/blocklist, │
│ (SecurityPolicy) │ pattern matching, hot-reload │
├─────────────────────┼───────────────────────────────────────┤
│ clients/ │ StdioMcpClient, HttpMcpClient │
│ │ Transport-specific implementations │
└─────────────────────┴───────────────────────────────────────┘
| Component | File | Purpose |
|---|---|---|
| MCP Server | server.ts |
Exposes meta-tools to Claude, routes requests to handlers |
| PackageRegistry | registry.ts |
Loads config files, manages MCP client instances, handles connection lifecycle |
| Catalog | catalog.ts |
Discovers tools from connected MCPs, caches schemas, tracks catalog changes via ETags |
| SecurityPolicy | security.ts |
Enforces allowlist/blocklist rules, supports regex patterns, hot-reloads on config changes |
| MCP Clients | clients/ |
Transport-specific implementations for STDIO and HTTP connections |
When Claude calls use_tool(package_id, tool_id, args), the following flow occurs:
┌─────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌────────┐
│ Claude │────▶│ server.ts│────▶│ security │────▶│ registry │────▶│ client │
│ │ │ │ │ │ │ │ │ │
│ │◀────│ │◀────│ │◀────│ │◀────│ │
└─────────┘ └──────────┘ └──────────┘ └──────────┘ └────────┘
1 2 3 4 5-7
- Claude calls meta-tool –
use_tool(package_id, tool_id, args) - server.ts routes request – Dispatches to
handlers/useTool.ts - Security policy check – Verifies tool is not blocked by allowlist/blocklist rules
- Registry provides client – Returns cached client or creates new connection
- Catalog validates tool – Confirms tool exists, provides schema for validation
- Client executes tool – Sends request via transport (STDIO or HTTP) through request queue
- Result returned – Response with telemetry flows back to Claude
Super-MCP uses request queues to manage concurrent tool calls and prevent race conditions:
| Transport | Concurrency | Rationale |
|---|---|---|
| STDIO | 1 (serialized) | STDIO servers typically cannot handle concurrent requests |
| HTTP | 5 (parallel) | HTTP servers handle concurrent connections well |
The request queue ensures:
- STDIO servers receive one request at a time
- HTTP servers aren't overwhelmed by burst traffic
- Responses are correctly matched to requests
- Tool schemas are cached per-package after first discovery
- Cache invalidated via ETag changes from MCP servers
- Reduces round-trips for repeated tool calls
- Packages returning auth errors are marked with retry delay
- Retry after 60 seconds to allow user authentication
- Prevents continuous failed connection attempts
- Global ETag tracks overall catalog state
- Clients can check if tool list has changed
- Enables efficient polling for catalog updates
| Decision | Rationale |
|---|---|
| Single interface for multiple MCPs | Claude sees one unified tool surface instead of managing multiple MCP connections |
| Transport abstraction | STDIO and HTTP clients share common interface, making transport choice transparent |
| Lazy client initialization | Clients connect on first use, not at startup—faster boot and lower resource usage |
| Security policy as separate concern | Policy rules can be hot-reloaded without restarting server or reconnecting clients |
| Meta-tool approach | use_tool indirection allows dynamic tool discovery without pre-registering every tool |
Update this document when:
- Major architectural components are added or removed
- Request flow changes significantly
- Concurrency model is modified
- New caching strategies are introduced
Last updated: 2025-12-12