MCP ToolGate
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.
English · 简体中文
Why MCP ToolGate?
Modern AI coding & reverse-engineering agents (DSH, Claude Code, Codex, Antigravity, Cursor, Cline, Windsurf, OpenCode) suffer from severe MCP context bloat: attaching large toolboxes like rea (207 tools ≈ 45K tokens), ppt-mcp (156 tools), agent-desktop (75 tools), ida (65 tools), or android-root-mcp (57 tools) injects 100K–250K tokens of tool schemas into every single turn and spawns heavy JVM/Python/Node processes at startup — even when 98% of those tools aren't needed.
MCP ToolGate solves this for any MCP-compatible agent with a single ultra-lightweight gateway:
Metric (Real 22-Server Benchmark) | Raw Direct MCPs | Via MCP ToolGate |
Tools injected at startup | 828 tools | 6 meta-tools |
Startup context overhead | ~134,744 tokens (498 KB) | ~1,145 tokens ( |
Backend processes spawned at boot | All 22 servers | 0 (lazy-spawn + idle reaper) |
Active task (1–4 domain tools open) | 134,744 tokens | ~1.2K–1.8K tokens ( |
Related MCP server: MCP-Lens
How It Works
flowchart LR
A[Task Start] --> B[tool_search / tool_catalog<br/>Offline CN+EN BM25 <5ms]
B --> C[Analyze Minimal Tool Set]
C --> D["tool_open(replace=true)<br/>Open ONLY needed tools<br/>Close all others"]
D --> E[Execute Native Tools<br/>or tool_call Fallback]
E -->|Progress Stuck / New Layer| F[tool_search Blocker Keywords]
F --> G["tool_open(replace=false)<br/>Incrementally Add Tools"]
G --> E
E -->|Task Done / Topic Switch| H["tool_close(all=true)<br/>Reclaim Tokens & RAM"]Key Highlights
Universal & Zero-Dependency: Pure Node.js ESM (
>= 18) standard MCP stdio gateway supporting both Stdio and Streamable HTTP backends. Works out of the box with DSH, Claude Code, Codex, Antigravity, Cursor, Cline, and any custom MCP host.Dual Mode (
dynamic+proxy):dynamic(default — best for DSH, Claude Code, Cursor, Cline): emits MCPnotifications/tools/list_changedontool_open/tool_closeso hosts dynamically hot-swap native tools, while keepingtool_callas a universal fallback.proxy(best for KV-cache lock, Antigravity, Codex):tools/listnever mutates (always only 6 meta-tools = 100% KV-cache hit rate); opened tools run cleanly throughtool_call.
Smart Auto-Grouping & Bilingual Search: Automatically splits giant 200-tool servers (like
rea,ida,burpsuite,android_root,agent_desktop,x64dbg) into small 5–20 tool capability groups (rea/native-static,rea/android-static,rea/frida-dynamic, etc.) with offline Chinese + English BM25 + synonym expansion (< 5ms).Automatic Prerequisite Injection: Stops blind-call failure loops (e.g., opening
rea:procedure_pseudo_codeautomatically pullsrea:open_binary&rea:binary_session;dexkitpullsdexkit_open;dexsqlpullsopen_dataset;idapullsidb_open).Built-in Provider Schema Sanitizer: Automatically strips lone-surrogate regexes (such as
^[^\uD800-\uDFFF]*$that trigger DeepSeek API400 Invalid Schema) and flattens nullableanyOf/oneOfunions from FastMCP/Pydantic servers.One-Click Auto-Import, Safe Backup & Local Web UI: Discovers existing MCP servers across DSH, Antigravity, Codex, Claude, and Cursor; includes a built-in zero-dependency Web Dashboard (
toolgate ui) to inspect token savings, test search, and watch live sessions.
The 6 Meta-Tools
Tool | Purpose |
| Browse servers, capability groups, tool counts, token costs, and currently open tools. |
| Bilingual (CN + EN) offline BM25 search with domain synonyms & prerequisite hints. |
| Open specific |
| Close specific tools/groups/servers or |
| Inspect full sanitized JSON schemas & prerequisites of specific tools without opening a whole server. |
| Direct invocation proxy ( |
Quick Start
git clone https://github.com/ldxm666/mcp-tool-gate.git
cd mcp-tool-gate
# 1. Auto-import existing MCP configs (read-only) from DSH / Antigravity / Codex / Claude / Cursor
node bin/toolgate.mjs import all
# 2. Index all tool schemas offline into data/state/catalog.json
node bin/toolgate.mjs sync
node bin/toolgate.mjs stats
# 3. Test bilingual search offline
node bin/toolgate.mjs search "decompile binary pseudocode xrefs"
node bin/toolgate.mjs search "逆向安卓 APK 查类"
# 4. Launch local Web Dashboard (http://127.0.0.1:18923)
node bin/toolgate.mjs uiOr manually create
data/config/servers.jsonfromexamples/servers.example.json.
Connect to Any Agent
Print ready-to-paste snippets for every agent (plus a portable AGENTS.md / CLAUDE.md rule):
node bin/toolgate.mjs install --agent allInstall the portable toolgate-router/SKILL.md across your agents so models automatically follow the Search → Minimal Open → Re-Search When Stuck loop:
node bin/toolgate.mjs install --skillApply automatically with timestamped backup (and rollback anytime via restore):
# DSH (DeepSeek Harness) — Solo mode disables raw direct MCP servers & keeps ToolGate active
node bin/toolgate.mjs install --agent dsh-web --apply --solo --skill
# Antigravity / Codex (recommended with --mode proxy for 100% KV-cache stability)
node bin/toolgate.mjs install --agent antigravity --apply --solo --mode proxy
node bin/toolgate.mjs install --agent codex --apply --mode proxySingle-Server Wrapper Mode (wrap just one huge MCP server such as rea):
node bin/toolgate.mjs serve --wrap reaCLI Reference
Command | Description |
| Run the MCP stdio gateway server. |
| Import backend MCP servers into |
| Probe backends, sanitize schemas, auto-group, and cache |
| Show per-server tool counts, schema KB, token footprint & savings. |
| Test bilingual search and prerequisite resolution in CLI. |
| Print or safely apply agent configs + install portable Skill. |
| Roll back any modified host config from |
| Start the local interactive Web Dashboard. |
| Verify runtime, catalog freshness, and server health. |
Development & Tests
npm testLicense
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 server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
MCP federation gateway: route, govern and observe agent tools across clouds and MCP servers.
Search, vet & assemble MCP servers from your agent: verified tools, risk labels, and trust scores.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP proxy that reduces context usage through semantic tool routing, enabling on-demand discovery and routing of relevant tools.MIT
- AlicenseNot gradedqualityDmaintenanceActs as a proxy/router for multiple downstream MCP servers, exposing only meta-tools to the host to reduce token usage, enabling efficient search and invocation of tools from a fleet of servers.7 npmMIT
- AlicenseNot gradedqualityBmaintenanceProvides a single local MCP endpoint that groups MCP servers into profiles, so each AI client only sees the tools it should. It starts servers on demand, caches tool catalogs, and can compress large tool sets into search/execute tools or a single sandboxed code-mode tool to cut context use.2Apache 2.0
- AlicenseNot gradedqualityFmaintenanceActs as a gateway between AI agents and multiple upstream MCP servers, enabling progressive tool discovery through search, inspect, call, and list tools instead of loading every schema upfront. This drastically cuts context token usage while still forwarding resources and prompts from upstream servers.MIT