mcp-agent-mesh
mcp-agent-mesh
面向 MCP 的网格网关 — 让一个 MCP 客户端能够访问 N 个 MCP 服务器,具备前缀路由、健康检查、熔断器故障转移,以及同时基于 stdio 和 Streamable HTTP 的统一端点。
它能做什么
mcp-agent-mesh 将多个上游 MCP 服务器聚合在单个逻辑 MCP 服务器之后。每个上游工具都以 server_name.tool_name 前缀暴露,因此连接到网格的客户端会看到一个单一的 tools/list,其中包含来自所有健康上游的工具。
当工具调用失败且该服务器的熔断器打开时,网格会在向客户端返回错误之前,自动故障转移到配置的副本服务器。
Related MCP server: mcp-0ne
功能
功能 | 描述 |
聚合 |
|
前缀路由 | 调用 |
熔断器 | 每服务器熔断器,支持可配置的阈值与超时 |
健康轮询 | 后台 ping 循环可提前发现上游故障 |
故障转移 | 可配置的故障转移组让别名接管故障服务器 |
双传输 | 同时作为 stdio MCP 服务器 和 Streamable HTTP 服务器运行 |
超时与重试 | 每次上游调用都包装在 |
架构
┌─────────────────────┐
MCP client ───────►│ MeshGateway │
│ (stdio / HTTP) │
└────────┬───────────┘
│ tools/list
│ tools/call
┌─────────┼─────────────┐
▼ ▼ ▼
┌────────┐ ┌─────────┐ ┌─────────┐
│ Server │ │ Server │ │ Server │
│ "A" │ │ "B" │ │ "C" │ (upstream MCP servers)
└────────┘ └─────────┘ └─────────┘模块
模块 | 职责 |
| YAML 配置解析 — |
| 每服务器的 |
| 前缀路由( |
|
|
安装
pip install -e ".[dev]"使用
CLI(stdio 模式)
mcp-agent-mesh --config examples/mesh.yaml --transport stdioHTTP 模式
mcp-agent-mesh --config examples/mesh.yaml --transport http --host 0.0.0.0 --port 8000作为客户端配置(Claude Code / Codex / OpenCode)
{
"mcpServers": {
"mesh": {
"command": "mcp-agent-mesh",
"args": ["--config", "/path/to/mesh.yaml", "--transport", "stdio"]
}
}
}{
"mcpServers": {
"mesh": {
"url": "http://127.0.0.1:8000/mcp"
}
}
}配置
完整示例请参见 examples/mesh.yaml。关键字段:
servers:
- name: math # tool-name prefix
transport: stdio # "stdio" or "http"
command: python # stdio: how to spawn
args: ["-m", "..."]
url: http://... # http: endpoint URL
timeout: 30.0
circuit_breaker_threshold: 3
circuit_breaker_timeout: 300.0
failover_groups:
math: [math_backup] # failover aliases for the "math" server测试
pytest tests/ -v测试套件使用内存中的模拟 MCP 服务器(无需真实子进程),涵盖配置解析、熔断器逻辑、前缀路由、工具聚合、故障转移以及网关的端到端行为。
许可证
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceGateway MCP Server - Route MCP requests intelligently to multiple backend servers.3MIT
- AlicenseNot gradedqualityCmaintenanceA standalone MCP gateway that multiplexes multiple backend MCP servers behind a single endpoint, supporting both HTTP and stdio transports. It allows users to dynamically manage backends at runtime and organizes tools using a configurable namespace prefix.MIT
- AlicenseNot gradedqualityDmaintenanceMCP Gateway that aggregates multiple upstream MCP servers into a single endpoint with persistent connections, tool registry, and authentication.452MIT
- AlicenseNot gradedqualityBmaintenanceA universal MCP gateway that aggregates multiple MCP servers into a single endpoint, providing features like hot-reload, auto-healing, and a hook system for request/response mutation.1MIT
Related MCP Connectors
MCP server for interacting with the Supabase platform
An MCP server for Arcjet - the runtime security platform that ships with your AI code.
MCP server for Appcircle mobile CI/CD platform.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/itsPremkumar/mcp-agent-mesh'
If you have feedback or need assistance with the MCP directory API, please join our Discord server