Expand description
MCP Tool-Catalog Gateway (#210).
Turns lean-ctx into a gateway in front of any number of downstream MCP servers. Instead of injecting every downstream tool schema into the system prompt (the “more tools → less adoption” tax), the gateway:
- aggregates the downstream catalogs (
catalog) behind a TTL cache, - ranks them per query with BM25 (
router) into a top-N ChoiceCard shortlist, and - proxies the actual call to the owning server (
client).
Net effect: unlimited downstream tools at (roughly) constant context cost.
Fully no-op until gateway.enabled = true.
Re-exports§
pub use catalog::Catalog;pub use config::GatewayConfig;pub use config::GatewayServer;pub use config::ResolvedTransport;pub use config::TransportKind;pub use router::ScoredTool;
Modules§
- adapters
- L4 typed adapters (deeper addon integration, #1096–#1101).
- catalog
- Aggregated downstream tool catalog (#210) with a TTL cache.
- client
- Downstream MCP client (#210).
- config
- Gateway configuration (#210): downstream MCP servers + routing knobs.
- pool
- Persistent downstream MCP session pool (#1078).
- postprocess
- Gateway output post-processor (deeper addon integration).
- router
- Query router (#210): rank the aggregated catalog against a query.
Structs§
- Find
Outcome - Outcome of a
findquery: the ranked shortlist plus catalog context.
Functions§
- find
- Rank the downstream catalog against
queryand return the top-N shortlist. - proxy
- Proxy a
server::toolcall to its owning downstream server. - render_
cards - Render a
FindOutcomeas compact ChoiceCards for the model. - servers_
overview - Per-server tool counts (for
ctx_tools list).