Skip to main content
Glama

mcp-agent-mesh

Una puerta de enlace de malla para MCP — permite que un cliente MCP llegue a N servidores MCP con enrutamiento basado en prefijos, comprobaciones de salud, conmutación por error con interruptor de circuito y un endpoint unificado sobre stdio y Streamable HTTP.

Qué hace

mcp-agent-mesh agrega múltiples servidores MCP upstream detrás de un único servidor MCP lógico. Cada herramienta upstream se expone bajo un prefijo server_name.tool_name, por lo que un cliente que se conecta a la malla ve una única tools/list que contiene las herramientas de todos los servidores upstream saludables.

Cuando una llamada a una herramienta falla y el interruptor de circuito del servidor se abre, la malla conmuta automáticamente a los servidores réplica configurados antes de devolver un error al cliente.

Related MCP server: mcp-0ne

Características

Feature

Description

Agregación

tools/list fusiona las herramientas de cada servidor upstream en una única lista plana

Enrutamiento por prefijos

Llama a math.add y la malla enruta al servidor math

Interruptor de circuito

Interruptor de circuito por servidor con umbral y tiempo de espera configurables

Sondeo de salud

Un bucle de ping en segundo plano detecta fallos tempranos de los servidores upstream

Conmutación por error

Los grupos de conmutación configurables permiten que los alias tomen el control de un servidor con fallos

Transporte dual

Se ejecuta como servidor MCP stdio y como servidor Streamable HTTP

Tiempos de espera y reintentos

Cada llamada upstream está envuelta en asyncio.wait_for

Arquitectura

                     ┌─────────────────────┐
  MCP client ───────►│   MeshGateway       │
                     │   (stdio / HTTP)    │
                     └────────┬───────────┘
                              │ tools/list
                              │ tools/call
                    ┌─────────┼─────────────┐
                    ▼         ▼             ▼
               ┌────────┐ ┌─────────┐ ┌─────────┐
               │ Server │ │ Server  │ │ Server  │
               │  "A"   │ │  "B"   │ │  "C"   │   (upstream MCP servers)
               └────────┘ └─────────┘ └─────────┘

Módulos

Module

Responsibility

config.py

Análisis de configuración YAML — ServerConfig, MeshConfig

health.py

CircuitBreaker por servidor + ServerHealthMonitor (ping en segundo plano)

router.py

Enrutamiento por prefijos (server.tool), resolución de grupos de conmutación, registro de herramientas

gateway.py

MeshGateway — se conecta a los servidores upstream, agrega listados de herramientas, enruta llamadas, sirve MCP sobre stdio + HTTP

Instalación

pip install -e ".[dev]"

Uso

CLI (modo stdio)

mcp-agent-mesh --config examples/mesh.yaml --transport stdio

Modo HTTP

mcp-agent-mesh --config examples/mesh.yaml --transport http --host 0.0.0.0 --port 8000

Como configuración de cliente (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"
    }
  }
}

Configuración

Consulta examples/mesh.yaml para ver un ejemplo completo. Campos clave:

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

Pruebas

pytest tests/ -v

La suite de pruebas utiliza servidores MCP falsos en memoria (no requiere subprocesos reales) y cubre el análisis de configuración, la lógica del interruptor de circuito, el enrutamiento por prefijos, la agregación de herramientas, la conmutación por error y el comportamiento de extremo a extremo de la puerta de enlace.

Licencia

MIT

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • A
    license
    Not graded
    quality
    C
    maintenance
    A 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
  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP Gateway that aggregates multiple upstream MCP servers into a single endpoint with persistent connections, tool registry, and authentication.
    45
    2
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    A 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.
    1
    MIT

View all related MCP servers

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.

View all MCP Connectors

Latest Blog Posts

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