
ajbmachon/tool-gating-mcp
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
Implements a tool gating and discovery system to preserve LLM context and focus while having access to many MCP servers
Обзор
An intelligent proxy/router for Model Context Protocol (MCP) that enables Claude Desktop and other MCP clients to dynamically discover and use tools from multiple MCP servers while maintaining a single connection point. This system prevents context bloat by intelligently selecting only the most relevant tools for each task. MCP clients like Claude Desktop must load all servers at startup and cannot dynamically add servers during conversations. When using multiple MCP servers: - : 7 search tools (web, research papers, Twitter, companies, etc.) - : Browser automation tools - : Documentation search tools - : 18+ desktop automation tools Loading all servers directly leads to: - 🚨 : 100+ tools consuming most of the context window - 🔒 : Cannot add servers without restarting Claude - 💸 : More tokens consumed per request - 🎯 : AI struggles to choose from too many options Tool Gating MCP acts as an intelligent proxy that: 1. : Claude Desktop connects only to Tool Gating 2.
README
Показан фрагмент оригинального README. Открыть оригинал.
Tool Gating MCP
An intelligent proxy/router for Model Context Protocol (MCP) that enables Claude Desktop and other MCP clients to dynamically discover and use tools from multiple MCP servers while maintaining a single connection point. This system prevents context bloat by intelligently selecting only the most relevant tools for each task.
🎯 The Problem
MCP clients like Claude Desktop must load all servers at startup and cannot dynamically add servers during conversations. When using multiple MCP servers:
- Exa server: 7 search tools (web, research papers, Twitter, companies, etc.)
- Puppeteer: Browser automation tools
- Context7: Documentation search tools
- Desktop Commander: 18+ desktop automation tools
Loading all servers directly leads to:
- 🚨 Context bloat: 100+ tools consuming most of the context window
- 🔒 Static configuration: Cannot add servers without restarting Claude
- 💸 Increased costs: More tokens consumed per request
- 🎯 Poor tool selection: AI struggles to choose from too many options
💡 The Solution
Tool Gating MCP acts as an intelligent proxy that:
- Single Connection: Claude Desktop connects only to Tool Gating
- Backend Management: Maintains connections to multiple MCP servers
- Smart Discovery: Finds relevant tools across all servers using semantic search
- Dynamic Provisioning: Loads only needed tools within token budgets
- Transparent Routing: Executes tools on appropriate backend servers
Example: Instead of configuring 10 MCP servers with 100+ tools, configure just Tool Gating. Then dynamically discover and use only the 2-3 tools you need.
🚀 Features
- Proxy Architecture: Single MCP server that routes to multiple backend servers
- Dynamic Tool Discovery: Find tools across all servers without manual configuration
- Semantic Search: Natural language queries to find the right tools
- Smart Provisioning: Load only relevant tools within token budgets
- Transparent Execution: Route tool calls to appropriate backend servers
- Native MCP Server: Direct integration with Claude Desktop via mcp-proxy
- Cross-Server Intelligence: Unified view of tools from Puppeteer, Exa, Context7, etc.
- Token Optimization: 90%+ reduction in context usage vs. loading all servers
- Zero Configuration: Claude Desktop needs only Tool Gating configuration
📋 Prerequisites
- Python 3.12+
- uv package manager
🔧 Installation
- Clone the repository:
git clone https://github.com/yourusername/tool-gating-mcp.git
cd tool-gating-mcp
- Create and activate virtual environment:
uv venv
source .venv/bin/activate # On Unix/macOS
# .venv\Scripts\activate # On Windows
- Install dependencies:
uv sync
- Install package in development mode:
uv pip install -e .
🏃 Running the Server
As HTTP API Server
# Start the server
tool-gating-mcp
Установка
npx @slack/mcp-serverКонфигурация
{
"mcpServers": {
"tool-gating": {
"command": "/Users/YOUR_USERNAME/.local/bin/mcp-proxy",
"args": ["http://localhost:8000/mcp"]
}
}
}