mcp-routing-gateway
MCP Routing Gateway
MCP Routing Gateway 是一个无状态路由器和纯代理,旨在解决“LLM 选择用户非预期工具”的问题,这是当前主流 AI 智能体(如 Claude Desktop、Cline)面临的常见问题。
🌟 为什么选择 MCP Routing Gateway?
当多个 MCP 服务器直接注册到标准 AI 智能体时,LLM 可以自由浏览并执行所有工具,这带来了触发意外破坏性操作或不必要工具调用的风险。
本项目位于 AI 智能体与实际 MCP 服务器组之间,通过中介通信提供了一个控制层,“仅向 LLM 展示经过安全管理(过滤和虚拟化)的工具”。
Related MCP server: cordon
🏗️ 架构
本项目在内部集成了“MCP 服务器”和“MCP 客户端”功能。
AI Agent (MCP Client) → | [MCP Server] Gateway [MCP Client] | → Backend MCP Servers前端(MCP 服务器): 作为 AI 智能体的“单一安全 MCP 服务器”,通过标准输入/输出 (
stdio) 接受连接。后端(MCP 客户端): 读取
mcp_config.json并自动启动和管理其中定义的多个 MCP 服务器(通过stdio派生进程)。
🎯 设计理念
本项目建立在严格的**“路由器与纯代理”**理念之上。
零负载干扰(透传): 它不会干扰请求 ID 或参数等负载。它完全专注于中继通信,充当纯粹的管道。
外观模式(过滤与工具覆盖): 网关仅干预
tools/list(展示工具列表)和tools/call(工具调用)的路由。根据配置文件,它会隐藏危险工具或将其替换为安全的虚拟工具。
⚙️ 配置
所有配置均完全以 JSON 格式管理。默认情况下,网关会在工作目录 ~/.mcp-gateway 中查找这些文件。您可以使用 --work-dir 命令行选项更改此目录。
mcp_config.json(后端定义): MCP 客户端的标准配置文件格式。它定义了网关连接并在后台启动的 MCP 服务器组。gateway_config.json(路由与过滤定义): 网关特有的规则配置文件。它定义了“要隐藏哪些工具(被阻止的工具)”以及“要虚拟化哪些工具(虚拟工具)”。
有关详细用法和命令行选项,请参阅 用户手册。
Maintenance
Related MCP Connectors
Security & DLP proxy for MCP: tool-poisoning scans, PII redaction on tool args/results. Beta.
Find, vet, and run MCP tools through a secure audited gateway with prompt-injection risk scoring
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Security firewall for AI agents — scans MCP calls for injection, secrets, and risks.
Related MCP Servers
AlicenseNot gradedqualityAmaintenanceOpen-source MCP proxy that enforces security policies, content scanning, and audit logging between AI agents and tool servers25AGPL 3.0- AlicenseNot gradedqualityAmaintenanceSecurity gateway for MCP tool calls. Sits between your LLM client and MCP servers, enforcing per-tool policies (allow/block/approve/read-only), logging every call, and pausing dangerous operations for human approval in terminal or Slack.4 npm1MIT
- AlicenseNot gradedqualityDmaintenanceA drop-in proxy that guards MCP servers with policy enforcement, secret redaction, prompt-injection screening, rug-pull detection, rate limiting, and audit logging.8 npmApache 2.0
- FlicenseNot gradedqualityBmaintenanceRuntime security gateway and FastMCP server that protects MCP clients from tool poisoning, prompt injection, and unauthorized tool schema changes through policy enforcement, fail-closed scanning, and human approval gates.-