mcp-gway
MCP Gateway
Una puerta de enlace CLI independiente que agrega múltiples servidores MCP (Model Context Protocol) detrás de un único endpoint HTTP/SSE con Code Mode — reduciendo el uso de tokens de entrada del LLM hasta en un 92% al usar múltiples servidores MCP.
Características
Agregación de múltiples servidores — Conéctese a múltiples servidores MCP (HTTP, SSE, Stdio, Streamable HTTP) y expóngalos a través de un único endpoint
Code Mode — 4 meta-herramientas que permiten a los LLM descubrir y usar herramientas dinámicamente sin cargar todos los esquemas de antemano
Soporte OAuth 2.0 — Flujo OAuth integrado con registro dinámico de clientes (RFC 7591) y almacenamiento de tokens
Sandbox hermético — Sandbox basado en Starlark para la ejecución segura de código
Compatible con el protocolo MCP — Funciona con Claude Desktop, Cursor y cualquier cliente compatible con MCP
Related MCP server: ToolMux
Instalación
pip install mcp-gwayO con mise:
mise install
uv syncInicio rápido
# Add an MCP server
mcp-gway add youtube --type http --url http://localhost:3001/mcp
# Add a stdio server
mcp-gway add filesystem --type stdio --command npx --args '["-y", "@anthropic/mcp-filesystem"]'
# Add a server requiring OAuth
mcp-gway add supabase --type streamable-http --url https://mcp.supabase.com/mcp
# List all servers
mcp-gway list
# Start the gateway
mcp-gway serve --port 8080Conectar desde Claude Desktop
Agregue a su configuración de Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"gateway": {
"url": "http://localhost:8080/mcp"
}
}
}Comandos
Comando | Descripción |
| Agregar un servidor MCP y generar stub |
| Eliminar un servidor MCP |
| Actualizar herramientas para un servidor |
| Listar todos los servidores conectados |
| Mostrar firmas de herramientas para un servidor |
| Refrescar la conexión y redescubrir herramientas |
| Iniciar el servidor de puerta de enlace |
Code Mode
Cuando está conectado, la puerta de enlace expone 4 meta-herramientas:
Herramienta | Descripción |
| Listar todos los archivos stub |
| Leer firmas de funciones de un stub |
| Obtener documentación detallada de una herramienta |
| Ejecutar código en un intérprete Starlark en sandbox |
Autenticación OAuth
Para servidores que requieren OAuth (por ejemplo, Supabase):
# Trigger OAuth flow
mcp-gway refresh supabase --auth
# Or store token manually
mkdir -p ~/.config/mcp-gway/tokens
echo '{"access_token": "YOUR_TOKEN"}' > ~/.config/mcp-gway/tokens/supabase.jsonDesarrollo
# Install dependencies
mise install
uv sync
# Run tests
uv run pytest -v
# Lint and format
uv run ruff check src/ tests/
uv run ruff format src/ tests/Arquitectura
┌─────────────────────────────────────────────────────────┐
│ MCP Gateway │
├─────────────────────────────────────────────────────────┤
│ CLI (click) │ HTTP/SSE Server (Starlette) │
│ - add │ - POST /mcp (JSON-RPC) │
│ - remove │ - GET /mcp (SSE stream) │
│ - list │ - POST /mcp/messages │
│ - refresh │ │
├─────────────────────────────────────────────────────────┤
│ Code Mode (4 meta-tools) │ Starlark Sandbox │
│ - listToolFiles │ - Hermetic execution │
│ - readToolFile │ - Server injection │
│ - getToolDocs │ │
│ - executeToolCode │ │
├─────────────────────────────────────────────────────────┤
│ Registry (.pyi files) │ OAuth2 (RFC 7591) │
│ - servers/*.pyi │ - Dynamic registration│
│ - Tool signatures │ - Token storage │
└─────────────────────────────────────────────────────────┘
│ │ │
┌────┴────┐ ┌────┴────┐ ┌────┴────┐
│ Server1 │ │ Server2 │ │ Server3 │
│ (HTTP) │ │ (SSE) │ │ (Stdio) │
└─────────┘ └─────────┘ └─────────┘Licencia
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Self-hosted federated MCP gateway: one OAuth 2.1 MCP server in front of N apps, user-level scopes.
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
Hosted MCP server with managed OAuth for 15+ toolkits: Google Workspace, Fitbit, Oura, Kalshi, etc.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAggregates multiple MCP servers into a single endpoint, enabling LLM clients to access tools, resources, and prompts from various backends through one connection.9 npmMIT
- AlicenseBqualityCmaintenanceAggregates multiple MCP servers via a single interface with token optimization and multiple operating modes (Gateway, Meta, Proxy, Search, Code).78MIT
- AlicenseNot gradedqualityAmaintenanceCentralizes management and routing of multiple MCP servers, exposing them to AI clients via HTTP/SSE endpoints with configurable visibility, sharing, and smart routing.1,706 npmApache 2.0
- AlicenseNot gradedqualityBmaintenanceCentralized management and routing of multiple MCP servers via unified Streamable HTTP/SSE endpoints, with granular group visibility, smart routing, and authentication.1,706 npmApache 2.0