mcp-lazy-router
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mcp-lazy-router
Dynamic Lazy-Loading MCP Router & Tool-Description Optimizer (TDQS)
mcp-lazy-router eliminates upfront MCP context-window bloat ("context tax") across Claude Desktop, Claude Code, Cursor, VS Code, and Antigravity. Instead of injecting dozens or hundreds of raw upstream tool schemas at session startup, it exposes 4 high-scoring meta-tools (search_tools, get_tool_schema, call_tool, router_status) and loads schemas and downstream connections strictly on demand.
Zero external dependencies — runs on pure Python 3.10+ stdlib.
Architecture
flowchart LR
C["AI Client (Claude / Cursor / Antigravity)"] <-->|"4 Meta-Tools (Stdio JSON-RPC)"| R["mcp-lazy-router"]
R -->|"Persistent Fingerprint Cache"| K[(".mcp_lazy_cache.json")]
R -->|"BM25 + Synonym Index + TDQS Audit"| I["Search & Normalizer"]
R -->|"Pre-flight Schema + Safety Guardrails"| V["Validator & Policy"]
V -->|"Lazy Stdio Spawn"| S1["Downstream Stdio MCPs"]
V -->|"Lazy Streamable HTTP + SSE"| S2["Downstream Remote MCPs"]
V -->|"Oversized Output Spill"| F[(".mcp_lazy_spills/*.txt")]Core Capabilities
Zero-Tax Progressive Disclosure: Exposes only 4 meta-tools upfront (
tools/list), cutting initial prompt token consumption dramatically as upstream servers scale.True Lazy Connections + Persistent Cache: Warm cache loads from
.mcp_lazy_cache.jsonin milliseconds with 0 downstream processes spawned untilcall_toolexecutes.TDQS Auditor & Auto-Normalizer: Evaluates every upstream tool on a 0–100 rubric across 6 dimensions (
purpose_clarity,usage_guidance,boundary_guidance,parameter_docs,safety_annotations,output_contract) and enriches vague or missing descriptions deterministically without hallucination.Hybrid BM25 + Synonym Search: Field-weighted Okapi BM25 over
camelCase/snake_case-split names, servers, tags, descriptions, and parameters, with built-in synonym expansion (pr/pull,db/sql,issue/ticket, etc.).Pre-Flight Validation & Safety Guardrails: Pure-Python JSON Schema validation prevents wasted downstream calls;
read_onlymode, allow/block globs, andconfirm_destructiveguardrails protect mutating endpoints.Oversized Response Spilling & Crash Recovery: Truncates huge tool outputs cleanly to
max_response_chars, writes full results to disk under.mcp_lazy_spills/, and safely retries crashed read-only/idempotent calls once.
Related MCP server: Bifrost-MCP Gateway
Quick Setup (Antigravity / Claude Desktop / Cursor)
Import your existing MCP config (automatically strips any self-referential
mcp-lazy-routerentry):
python scripts/run_router.py import-config path/to/claude_desktop_config.json --out router_config.jsonPoint your MCP client (
mcp_config.json/claude_desktop_config.json) at the router:
{
"mcpServers": {
"mcp-lazy-router": {
"command": "python",
"args": [
"scripts/run_router.py",
"serve",
"--config",
"router_config.json"
]
}
}
}Or drop this repository directly into your plugins folder (plugin.json + skills/mcp-lazy-router/SKILL.md included).
CLI Reference
Command | Purpose |
| Run the MCP stdio server |
| Refresh and persist downstream tool indexes |
| Run TDQS quality audit across indexed tools |
| Test BM25 + synonym search from CLI |
| Inspect normalized schema and TDQS breakdown |
| Convert existing |
| Measure upfront context token savings |
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
The OpenRouter for tools. One MCP connection gives any AI agent 254 hosted tools, pay per call.
MCP gateway: one connection for your AI apps, with tool policies, PII redaction and audit logs.
An MCP gateway for teams deploying AI tools at scale to employee-facing and headless agents.
Find, vet, and run MCP tools through a secure audited gateway with prompt-injection risk scoring
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceA drop-in MCP proxy that aggregates multiple backend servers into two meta-tools for efficient tool discovery and execution. It enables AI clients to access hundreds of tools while minimizing context window usage through searchable indexing.1 npm-
- AlicenseNot gradedqualityDmaintenanceEnterprise-grade dynamic MCP proxy that eliminates token bloat by lazy-loading tool schemas based on semantic intent, enabling efficient orchestration of multiple backend tools from a single endpoint.MIT
- FlicenseNot gradedqualityBmaintenanceA single MCP endpoint for AI agents to browse, inspect, and call tools from multiple upstream MCP servers without loading all schemas upfront, reducing context overhead.-
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to connect to multiple upstream MCP servers while dynamically returning only semantically relevant tools, with lazy schema loading, session-aware boosting, and rule-based gating to reduce token bloat and improve performance.MIT