/ Directorio / Playground / mcp-gateway
● Comunidad lasso-security ⚡ Instantáneo

mcp-gateway

por lasso-security · lasso-security/mcp-gateway

Put a security gateway in front of your MCP servers — mask secrets, redact PII, block prompt injection, and log every tool call.

Lasso's mcp-gateway is a Python-based orchestrator for multiple MCP servers with a plugin system for guardrails: Basic secret masking, Presidio PII redaction, Lasso's LLM-aware prompt-injection detection, Xetrack tracing, and server-reputation scanning.

Por qué usarlo

Características clave

Demo en vivo

Cómo se ve en la práctica

gateway.replay ▶ listo
0/0

Instalar

Elige tu cliente

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "gateway": {
      "command": "uvx",
      "args": [
        "mcp-gateway"
      ],
      "_inferred": true
    }
  }
}

Abre Claude Desktop → Settings → Developer → Edit Config. Reinicia después de guardar.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "gateway": {
      "command": "uvx",
      "args": [
        "mcp-gateway"
      ],
      "_inferred": true
    }
  }
}

Cursor usa el mismo esquema mcpServers que Claude Desktop. La configuración del proyecto prevalece sobre la global.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "gateway": {
      "command": "uvx",
      "args": [
        "mcp-gateway"
      ],
      "_inferred": true
    }
  }
}

Haz clic en el icono MCP Servers de la barra lateral de Cline y luego en "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "gateway": {
      "command": "uvx",
      "args": [
        "mcp-gateway"
      ],
      "_inferred": true
    }
  }
}

Mismo formato que Claude Desktop. Reinicia Windsurf para aplicar.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "gateway",
      "command": "uvx",
      "args": [
        "mcp-gateway"
      ]
    }
  ]
}

Continue usa un array de objetos de servidor en lugar de un mapa.

~/.config/zed/settings.json
{
  "context_servers": {
    "gateway": {
      "command": {
        "path": "uvx",
        "args": [
          "mcp-gateway"
        ]
      }
    }
  }
}

Añádelo a context_servers. Zed recarga en caliente al guardar.

claude mcp add gateway -- uvx mcp-gateway

Un solo comando. Verifica con claude mcp list. Quita con claude mcp remove.

Casos de uso

Usos del mundo real: mcp-gateway

Expose internal MCPs to Claude without leaking PII

👤 Enterprise security, platform teams ⏱ ~45 min advanced

Cuándo usarlo: Your internal tools (postgres, CRM) would leak customer names / emails / SSNs into LLM context if used directly.

Requisitos previos
  • pip install mcp-gateway[presidio] — presidio extra pulls spaCy models
Flujo
  1. Wire upstream MCPs through gateway
    Configure mcp-gateway with upstream postgres MCP; enable the Presidio plugin with redaction for EMAIL, PHONE, US_SSN.✓ Copiado
    → Config file with plugin chain
  2. Test redaction
    Run a query returning customer emails; confirm the gateway replaces them with <EMAIL> placeholders before reaching the LLM.✓ Copiado
    → Claude sees only placeholders

Resultado: LLM-usable tool access without raw PII crossing the boundary.

Errores comunes
  • Over-redaction breaks downstream joins — Use consistent pseudonyms (Presidio supports hash-based) so the LLM can still reason across redacted fields
Combinar con: postgres

Block prompt injection attacks from tool outputs

👤 Security-aware agent builders ⏱ ~30 min advanced

Cuándo usarlo: Your agent uses fetch/web-browsing MCPs — tool outputs can contain 'ignore previous instructions' payloads.

Requisitos previos
  • Lasso API key — lasso.security signup
Flujo
  1. Enable Lasso plugin
    Turn on the Lasso plugin in gateway config with LASSO_API_KEY set. Put fetch MCP behind it.✓ Copiado
    → Plugin active; outputs scanned
  2. Test
    Have Claude fetch a URL containing known prompt-injection test string; verify it's neutralized before reaching the model.✓ Copiado
    → Injection blocked or flagged

Resultado: Defense against tool-output injection.

Errores comunes
  • False positives block legit content — Start with 'warn' mode, review logs before switching to 'block'
Combinar con: fetch · firecrawl

Log every MCP tool call for compliance audit

👤 Compliance / security audit teams ⏱ ~20 min intermediate

Cuándo usarlo: You need SOC2-style evidence of what the LLM asked tools to do.

Flujo
  1. Enable Xetrack plugin
    Turn on Xetrack with SQLite destination. Route all MCPs through the gateway.✓ Copiado
    → mcp_calls.db being written
  2. Query audit log
    Show me all tool calls in the last 24h where the tool name contains 'delete' or 'drop'.✓ Copiado
    → Destructive-op audit trail

Resultado: Queryable audit database for compliance.

Errores comunes
  • Log DB grows unbounded — Rotate and archive monthly

Combinaciones

Combínalo con otros MCPs para multiplicar por 10

gateway + postgres + fetch

DB + web access with PII + injection guards

Put postgres and fetch behind mcp-gateway with presidio + lasso plugins; use normally from Claude.✓ Copiado

Herramientas

Lo que expone este MCP

HerramientaEntradasCuándo llamarCoste
<upstream tools> Depends on upstream MCP Gateway is transparent — you call upstream tools as usual upstream cost + plugin overhead

Coste y límites

Lo que cuesta ejecutarlo

Cuota de API
Lasso plugin requires Lasso API key (paid tier)
Tokens por llamada
Plugin overhead ~50-200ms per call; redaction reduces tokens
Monetario
Gateway itself free. Lasso plugin: see lasso.security pricing.
Consejo
Run basic + presidio plugins for free; only add Lasso if you need advanced injection detection.

Seguridad

Permisos, secretos, alcance

Almacenamiento de credenciales: Plugin API keys in env vars (LASSO_API_KEY, etc.)
Salida de datos: Varies by plugin: basic + presidio are local; Lasso sends samples to Lasso cloud for analysis

Resolución de problemas

Errores comunes y soluciones

Presidio plugin fails to load

Install extra: pip install 'mcp-gateway[presidio]' and download spaCy model: python -m spacy download en_core_web_lg.

Upstream MCP not responding through gateway

Test the upstream directly first; then verify gateway mcp.json command/args match exactly.

Performance drop

Plugin chain order matters — put cheapest (basic mask) first, Lasso last.

Alternativas

mcp-gateway vs otros

AlternativaCuándo usarlaContrapartida
Claude's built-in output filtersYou only use Claude and trust its own redactionNo customization, no audit trail
Concierge SDKYou want a framework for writing MCPs, not a security proxyDifferent problem space

Más

Recursos

📖 Lee el README oficial en GitHub

🐙 Ver issues abiertas

🔍 Ver todos los 400+ servidores MCP y Skills