Skip to main content
Glama
thargy
by thargy

Universal MCP Gateway (mcp-gateway)

@thargy/mcp-server-core 上に構築された、高性能なマルチテナント対応のModel Context Protocol (MCP) リバースプロキシ兼ゲートウェイサービスです。


なぜ mcp-gateway なのか?

多くのサードパーティ製MCPサーバー(github-mcp-server、Brave Search、SQLite、PostgreSQLなど)は、主にstdio経由でのローカルデスクトップ実行を想定して構築されています。HTTPやCloudflare Zero Trustトンネル経由で公開すると、以下のような機能が欠けていることがよくあります:

  1. Cloudflare SSEストリームのプライミング: リバースプロキシのバッファリングを回避するための即時 : heartbeat\n\n コメント。

  2. 最新のMCPハンドシェイク互換性: subscriptions/listen、server/discover、およびステートレスJSON-RPCディスパッチのサポート。

  3. セッションライフサイクル管理: Mcp-Session-Id ヘッダーの適切な追跡とトークン認証。

mcp-gateway は、リモートMCPクライアント(Antigravity IDE、Cloudflare Zero Trust、Cursorなど)と、1つ以上のアップストリームにあるサードパーティ製MCPバックエンド(コンテナ、HTTP API、stdio CLIツールなど)の間に接続し、単一のマルチテナント対応アダプターとして動作します。


Related MCP server: Shared MCP Gateway

アーキテクチャ

graph TD
    subgraph Clients ["MCP Clients"]
        AG["Antigravity IDE / Agents"]
        CFPortal["Cloudflare Zero Trust MCP Portal"]
    end

    subgraph Ingress ["Cloudflare Tunnel (mcp.thargy.com)"]
        Tunnel["cloudflared (HA Server)"]
    end

    subgraph Gateway ["mcp-gateway Container (:3007 -> :3008)"]
        App["@thargy/mcp-server-core Router"]
        GHRoute["/gh/mcp -> HttpProxyAdapter"]
        BraveRoute["/brave/mcp -> StdioProxyAdapter"]
    end

    subgraph Backends ["3rd-Party Backends"]
        GHContainer["github-mcp-backend (:8082)"]
        BraveCLI["@modelcontextprotocol/server-brave-search"]
    end

    Clients --> Ingress
    Ingress --> Gateway
    App --> GHRoute --> GHContainer
    App --> BraveRoute --> BraveCLI

設定 (config.yaml)

port: 3008

routes:
  gh:
    type: http
    name: "github-mcp-server"
    description: "GitHub Model Context Protocol Server (repositories, commits, issues, PRs)"
    targetUrl: "http://github-mcp-backend:8082"
    authHeaderEnv: "GITHUB_PERSONAL_ACCESS_TOKEN"

  # brave:
  #   type: stdio
  #   name: "brave-search"
  #   description: "Brave Search MCP Server"
  #   command: "npx"
  #   args: ["-y", "@modelcontextprotocol/server-brave-search"]
  #   env:
  #     BRAVE_API_KEY: "${BRAVE_API_KEY}"

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Aggregates multiple shared MCP servers into a single HTTP gateway, providing a unified, observable, and reusable MCP access layer for multiple AI clients like Codex, OpenCode, and OpenClaw. It centralizes configuration management, logging, health checks, and circuit breaking to simplify multi-client MCP deployments.
    5
    -
  • A
    license
    Not graded
    quality
    C
    maintenance
    A universal MCP server that acts as a unified gateway for dynamically connecting and managing multiple MCP servers via a single HTTP endpoint.
    6 npm
    6
    MIT
  • A
    license
    Not graded
    quality
    A
    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