mcp-gateway
by MikkoParkkola·★ 25·综合分 46
通用MCP网关,通过Meta-MCP实现工具复用,节省95%的上下文token。
概述
MCP Gateway是一个复杂的工具复用器,位于AI客户端和后端服务器之间。它不将所有工具定义加载到每个请求中,而是提供一个仅包含14-17个工具的紧凑Meta-MCP接口,按需发现正确的后端工具。这种方法显著减少了上下文窗口开销,将100个工具的~15,000个token降至~1,600个,节省约89%的token成本,并能实现无上下文压力的无限工具连接。
试试问 AI
装完之后,这里有 6 个你可以让 AI 做的事:
什么时候选它
当你有多个 MCP 服务器并希望减少上下文开销,或者需要连接 REST API 而无需构建自定义 MCP 服务器时,选择 MCP Gateway。
什么时候不要选它
如果你的工具和服务器数量很少,或者需要直接、低延迟地连接到各个后端服务而不需要网关层,请不要选择 MCP Gateway。
此 server 暴露的工具
从 README 抽取出 12 个工具gateway_list_serversList all backend MCP servers connected to the gateway
gateway_list_toolsList all tools available across all connected backend servers
gateway_search_toolsSearch for tools across all backends by name or description
gateway_invokeInvoke a specific tool from any connected backend server
gateway_statsGet usage statistics and performance metrics for the gateway
gateway_cost_reportGenerate a cost report showing token and financial savings
gateway_playbooksShow available playbooks for configuring and managing the gateway
gateway_profile_controlsAccess profile controls for managing tool usage and capabilities
gateway_reloadReload the gateway configuration without restarting the session
gateway_webhook_statusCheck the status of configured webhook endpoints
gateway_disabled_capabilitiesList any disabled capabilities or tools
gateway_doctorRun diagnostic checks on the gateway and its backends
可对比工具
安装
安装方法
**Homebrew (macOS/Linux,推荐)**
brew install MikkoParkkola/tap/mcp-gateway**Cargo**
cargo install mcp-gateway**直接二进制下载**
# macOS Apple Silicon
curl -L https://github.com/MikkoParkkola/mcp-gateway/releases/latest/download/mcp-gateway-darwin-arm64 -o mcp-gateway && chmod +x mcp-gateway**Docker**
docker run -v $(pwd)/gateway.yaml:/config.yaml ghcr.io/mikkoparkkola/mcp-gateway:latest --config /config.yaml设置
mcp-gateway setup wizard --configure-client
mcp-gateway serve
mcp-gateway doctorFAQ
- MCP Gateway如何节省token?
- 它不将每个工具定义加载到每个请求中,而是使用仅包含14-17个工具的紧凑Meta-MCP接口,与直接MCP连接相比减少约89%的token开销。
- 我能否将它与现有的MCP服务器一起使用?
- 可以,网关可以导入并将流量路由到您现有的MCP服务器,而无需对它们进行更改。
- 它如何处理安全问题?
- 网关包含工具毒药验证器、SHA-256能力哈希固定、拉检测,并为所有能力提供集中审计表面。
mcp-gateway 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。