Skip to main content
Glama

MCPGate

Leichtgewichtiges MCP-Gateway — aggregieren, filtern und beobachten Sie Ihre MCP-Tools.

MCPGate fungiert als Vermittler zwischen Ihrem MCP-Client (Claude Desktop, Claude Code, Cursor, VS Code) und mehreren MCP-Servern. Es stellt einen einheitlichen MCP-Endpunkt bereit und gibt Ihnen gleichzeitig die volle Kontrolle darüber, welche Tools verfügbar gemacht werden.

Funktionen

  • Tool-Aggregation — Verbinden Sie mehrere MCP-Server und stellen Sie alle Tools über einen einzigen Endpunkt bereit

  • Tool-Filterung — Erlauben/Blockieren Sie spezifische Tools pro Server über eine einfache YAML-Konfiguration

  • Tool-Präfixe — Automatisches Namespacing (github.create_issue), um Namenskollisionen zu vermeiden

  • Web-Dashboard — Echtzeit-Statusseite mit Übersicht über Server, Tools und Anfrage-Logs

  • Dualer Transport — Stdio (Claude Desktop) oder HTTP/SSE (Remote-Clients)

  • Audit-Trail — Jeder Tool-Aufruf wird inklusive Zeitmessung protokolliert; optionale PostgreSQL-Persistenz

  • Self-Hosted — Bereitstellung auf Railway, Docker oder lokal ausführbar

Schnellstart

Lokal (stdio — für Claude Desktop)

npx mcp-gate start --config mcpgate.yaml

Fügen Sie dies zu Ihrer claude_desktop_config.json hinzu:

{
  "mcpServers": {
    "mcpgate": {
      "command": "npx",
      "args": ["-y", "mcp-gate", "start", "--config", "/path/to/mcpgate.yaml"]
    }
  }
}

Lokal (HTTP — mit Dashboard)

npx mcp-gate start --config mcpgate.yaml
# Dashboard at http://localhost:3000
# MCP endpoint at http://localhost:3000/mcp

Docker

docker compose up
# Dashboard at http://localhost:3000
# Includes PostgreSQL for persistent audit trail

Oder als Standalone:

docker run -p 3000:3000 \
  -e MCPGATE_CONFIG=$(cat mcpgate.yaml | base64 -w 0) \
  -e GITHUB_TOKEN=$GITHUB_TOKEN \
  ghcr.io/mprezz/mcpgate

Railway

Deploy on Railway

Fügen Sie ein PostgreSQL-Plugin für einen persistenten Audit-Trail hinzu — MCPGate erkennt die DATABASE_URL automatisch.

Konfiguration

Erstellen Sie eine mcpgate.yaml:

gateway:
  name: "my-gateway"
  transport: "stdio" # stdio | http | both
  port: 3000
  toolPrefix: true # prefix tools with server name

servers:
  - name: "github"
    transport: "stdio"
    command: "npx"
    args: ["-y", "@modelcontextprotocol/server-github"]
    env:
      GITHUB_TOKEN: "${GITHUB_TOKEN}"
    tools:
      allow:
        - "create_issue"
        - "search_repos"

  - name: "filesystem"
    transport: "stdio"
    command: "npx"
    args: ["-y", "@modelcontextprotocol/server-filesystem", "/home/user"]
    tools:
      block:
        - "write_file"
        - "delete_file"

logging:
  level: "info"

Siehe mcpgate.example.yaml für die vollständige Referenz.

Tool-Filterung

Jeder Server unterstützt allow oder block (schließen sich gegenseitig aus):

  • allow — Nur diese Tools werden bereitgestellt (Whitelist)

  • block — Alle Tools AUSSER diesen werden bereitgestellt (Blacklist)

  • Keines von beiden — Alle Tools werden bereitgestellt

Authentifizierung

Fügen Sie ein Bearer-Token hinzu, um den HTTP-Transport zu schützen:

gateway:
  auth:
    token: "${MCPGATE_AUTH_TOKEN}"

Wenn die Authentifizierung konfiguriert ist:

  • Alle Endpunkte erfordern einen Authorization: Bearer <token> Header

  • /health bleibt öffentlich (für Railway/Docker Health-Checks)

  • MCP-Clients übergeben das Token über benutzerdefinierte Header in ihrer Transport-Konfiguration

Ohne konfigurierte Authentifizierung sind alle Endpunkte offen (für die lokale/private Nutzung).

Umgebungsvariablen-Interpolation

Verwenden Sie ${VAR} oder ${VAR:-default} in YAML, um auf Umgebungsvariablen zu verweisen:

env:
  GITHUB_TOKEN: "${GITHUB_TOKEN}"
  API_URL: "${API_URL:-https://api.example.com}"

Dashboard

Wenn MCPGate im HTTP-Modus läuft, stellt es ein Web-Dashboard unter der Root-URL bereit:

  • / — Statusseite mit Upstream-Servern, Tools und Anfrage-Logs

  • /api/status — JSON-API für den programmatischen Zugriff

  • /health — Health-Check-Endpunkt (für Railway/Docker)

  • /mcp — MCP-Protokoll-Endpunkt (Streamable HTTP)

Speicherung

MCPGate protokolliert jeden Tool-Aufruf mit Zeit- und Fehlerinformationen.

  • Standard — Im Arbeitsspeicher (kein Setup erforderlich, Daten gehen bei Neustart verloren)

  • PostgreSQL — Setzen Sie die Umgebungsvariable DATABASE_URL (Tabellen werden automatisch erstellt)

# Local development with Docker Compose
docker compose up postgres -d
export DATABASE_URL=postgresql://mcpgate:mcpgate@localhost:5432/mcpgate
npx mcp-gate start --config mcpgate.yaml

Umgebungsvariablen

Variable

Erforderlich

Standard

Beschreibung

PORT

Nein

3000

HTTP-Port (Railway setzt diesen automatisch)

MCPGATE_CONFIG

Nein

Base64-kodierte YAML-Konfiguration (für Railway/Docker)

DATABASE_URL

Nein

PostgreSQL-Verbindungszeichenfolge (aktiviert persistenten Audit-Trail)

LOG_LEVEL

Nein

info

debug / info / warn / error

MCPGATE_AUTH_TOKEN

Nein

Bearer-Token für HTTP-Auth (Referenz in YAML via ${MCPGATE_AUTH_TOKEN})

Entwicklung

git clone https://github.com/mprezz/mcpgate.git
cd mcpgate
npm install

npm run dev          # development with hot reload
npm run build        # compile TypeScript
npm run test         # run tests (vitest)
npm run lint         # eslint
npm run typecheck    # tsc --noEmit

Architektur

Client (Claude, Cursor)
    │
    ▼ stdio or HTTP/SSE
┌──────────────────────────────┐
│         MCPGate              │
│                              │
│  ┌─────────────────────┐     │
│  │   Tool Registry     │     │  ← filters + namespaces tools
│  └─────────────────────┘     │
│  ┌─────────────────────┐     │
│  │   Tool Router       │     │  ← routes calls to correct server
│  └─────────────────────┘     │
│  ┌─────────────────────┐     │
│  │  Upstream Manager   │     │  ← manages server connections
│  └─────────────────────┘     │
│  ┌─────────────────────┐     │
│  │   Storage           │     │  ← memory or PostgreSQL
│  └─────────────────────┘     │
└──────────────────────────────┘
    │           │           │
    ▼           ▼           ▼
 Server A    Server B    Server C
 (GitHub)  (Filesystem)  (Custom)

Lizenz

Apache 2.0 — siehe LICENSE

-
security - not tested
A
license - permissive license
-
quality - not tested

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

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/martin-santiago/mcpgate'

If you have feedback or need assistance with the MCP directory API, please join our Discord server