1. Conduid
  2. Developer Tools
  3. Gateway
MCP server · Developer Tools

Gateway

The MCP gateway is a reverse proxy server that forwards requests from clients to the MCP server or uses all MCP servers under the gateway through a unified portal.

Unclaimed last commit 11 months ago devtools
48Fair

Scored 3 days ago · breakdown

About Gateway

Gateway is an MCP server published by lucky-aeon in the Developer Tools category: the MCP gateway is a reverse proxy server that forwards requests from clients to the MCP server or uses all MCP servers under the gateway through a unified portal. It has been installed 0 times through Conduid.

The repository has 26 stars and 9 forks, with the last commit 11 months ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues (0) before depending on it in production.

Install

Install
npx mcp-gateway

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

Ask AI about Gateway

Powered by Claude · Grounded in docs

I know everything about Gateway. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ·README presentNot checked yet.
  • ·License declaredNot checked yet.
  • ·Tests presentNot checked yet.
  • ·Dependencies pinnedNot checked yet.
  • ·No dynamic code executionNot checked yet.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

Releases

v2.1.0v2.1.0 · 21 Apr 2026What's Changed Add stdio to HTTP stream bridge for MCP servers by @LiusCraft in https://github.com/lucky-aeon/mcp-gateway/pull/19 Add SSE to HTTP stream bridge for MCP servers by @LiusCraft in…
v2.0.1v2.0.1 · 8 Sep 2025What's Changed fix mcp restart by @LiusCraft in https://github.com/lucky-aeon/mcp-gateway/pull/14 fix(service): Extend stdio bridge creation timeout to 5 minutes by @Feynix2004 in https://github.com/lucky-aeon/mcp-gateway/pull/15 New…
v2.0.0v2.0.0 · 28 Jun 2025What's Changed Refactor/mcp service by @LiusCraft in https://github.com/lucky-aeon/mcp-gateway/pull/11 Update Dockerfile with multi-stage build and Go env settings by @LiusCraft in https://github.com/lucky-aeon/mcp-gateway/pull/13 Full…
v1.0.0v1.0.0 · 2 Jun 2025What's Changed docs(README): update MCP server usage instructions and remove WIP notes by @LiusCraft in https://github.com/lucky-aeon/mcp-gateway/pull/7 初始化网关前端项目结构,添加 React、TypeScript 和 Vite 支持,包含基本的 ESLint 配置和样式文件。 by @LiusCraft in…
v0.1.2v0.1.2 · 22 Apr 2025Full Changelog**: https://github.com/lucky-aeon/mcp-gateway/compare/v0.1.1...v0.1.2

README

MCP Gateway

Description

The MCP gateway is a reverse proxy server that forwards requests from clients to the MCP server or uses all MCP servers under the gateway through a unified portal.

Supports two transport protocols (switchable at startup):

  • SSE (default, legacy MCP transport)
  • Streamable HTTP (MCP spec 2025-03-26)

Features

  • Deploy multiple MCP servers
  • Connect to MCP server
  • Use gateway to call MCP servers
  • Get all MCP servers' SSE streams
  • Get all MCP servers' tools
  • Streamable HTTP aggregated endpoint with session management via Mcp-Session-Id header
  • Dynamic capability aggregation (gateway only advertises capabilities that at least one downstream MCP supports)
  • API Key authentication (Bearer token / query param) and session-based authorization

Installation

  1. pull github package
docker pull ghcr.io/lucky-aeon/mcp-gateway:latest
  1. self build docker image
docker build -t mcp-gateway .

Usage

run github docker container

docker run -d --name mcp-gateway -p 8080:8080 ghcr.io/lucky-aeon/mcp-gateway

run self build docker container

docker run -d --name mcp-gateway -p 8080:8080 mcp-gateway

Configuration

The gateway reads config.json from the config directory (defaults to ./vm when present, otherwise .). A minimal example:

{
    "LogLevel": 0,
    "Bind": "[::]:8080",
    "Auth": {
        "Enabled": true,
        "ApiKey": "123456"
    },
    "GatewayProtocol": "sse",
    "McpServiceMgrConfig": {
        "McpServiceRetryCount": 3
    }
}

Key fields:

Field Default Description
Bind [::]:8080 Server listen address.
GatewayProtocol sse Transport protocol: sse or streamhttp. Also overridable via --protocol flag.
Auth.Enabled true Whether to enforce API Key authentication.
Auth.ApiKey 123456 API Key used by clients.
SessionGCInterval 10s Interval for garbage-collecting idle proxy sessions.
ProxySessionTimeout 1m Timeout for idle proxy sessions before GC.
McpServiceMgrConfig.McpServiceRetryCount 3 Max retries for a failed MCP service before marking it failed.

Selecting the gateway protocol

Either set GatewayProtocol in config.json:

{ "GatewayProtocol": "streamhttp" }

Or pass the CLI flag (takes precedence):

./mcp-gateway --protocol=streamhttp

Valid values: sse (default) or streamhttp.

Authentication

When Auth.Enabled is true, every request must present a credential. The gateway looks up the key in the following order:

  1. Authorization: Bearer <ApiKey> header
  2. ?api_key=<ApiKey> query parameter
  3. ?sessionId=<id> query parameter (only valid after a session has been created)
  4. Mcp-Session-Id: <id> header (Streamable HTTP clients)
  5. X-Session-Id: <id> header

Typical patterns:

  • Long-lived client (agent / Inspector): configure Authorization: Bearer <ApiKey> once; the gateway also threads the session identifier in responses so subsequent requests can skip the API Key if desired.
  • Browser / debug use: append ?api_key=<ApiKey> to URLs.

initialize (the first request in a session) must carry the API Key, since no session exists yet.

API

Deploy

support: uvx, npx. or sse url

POST /deploy HTTP/1.1
Host: localhost:8080
Content-Type: application/json

{
    "mcpServers": {
        "time": {
            "url": "http://mcp-server:8080",  // url 和 command 二选一
            "command": "uvx",  // url 和 command 二选一
            "args": ["mcp-server-time", "--local-timezone=America/New_York"],  // 可选,command 的参数
            "env": {  // 可选,环境变量
                "KEY1": "VALUE1",
                "KEY2": "VALUE2"
            }
        }
    }
}

Use MCP (SSE Mode)

Available when GatewayProtocol is sse (default).

GET SSE

GET /{mcp-server-name}/sse HTTP/1.1
Host: localhost:8080

POST Message

POST /{mcp-server-name}/message HTTP/1.1
Host: localhost:8080
Content-Type: application/json

{
    "method": "tools/call",
    "params": {
        "name": "get_current_time",
        "arguments": {
            "timezone": "Asia/Seoul"
        }
    },
    "jsonrpc": "2.0",
    "id": 2
}

Use Gateway (SSE Mode)

Available when GatewayProtocol is sse (default).

网关和直连MCP的区别在于,只需要与网关交互,网关会自动将请求转发到对应的MCP服务器。在call 时,需要在method前面添加 mcpServerName 内容,标识该请求来自哪个 MCP 服务器。

GET SSE

GET /sse HTTP/1.1
Host: localhost:8080

这里 sse 是整个网关下所有的 MCP 服务器的 SSE 流。

当客户端订阅 sse 时,网关会为每个 MCP 服务器创建一个 SSE 连接,并将所有 MCP 服务器的 SSE 流合并到一起。

在响应的所有tools/call 的结果中,会在method前面添加 mcpServerName 内容,标识该结果来自哪个 MCP 服务器。

POST Message

POST /message HTTP/1.1
Host: localhost:8080
Content-Type: application/json

{
    "method": "tools/call",
    "params": {
        "name": "{mcp-server-name}-get_current_time",
        "arguments": {
            "timezone": "Asia/Seoul"
        }
    },
    "jsonrpc": "2.0",
    "id": 2
}

获取网关下所有工具

POST /message HTTP/1.1
Host: localhost:8080
Content-Type: application/json

{
    "method": "tools/list",
    "jsonrpc": "2.0",
    "id": 1
}

# SSE 响应 message event

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "tools": [
      {
        "name": "{mcpServerName}-get_current_time",
        "description": "Get current time in a specific timezones",
        "inputSchema": {
          "type": "object",
          "properties": {
            "timezone": {
              "type": "string",
              "description": "IANA timezone name (e.g., 'America/New_York', 'Europe/London'). Use 'America/New_York' as local timezone if no timezone provided by the user."
            }
          },
          "required": [
            "timezone"
          ]
        }
      },
      {
        "name": "{mcpServerName}-convert_time",
        "description": "Convert time between timezones",
        "inputSchema": {
          "type": "object",
          "properties": {
            "source_timezone": {
              "type": "string",
              "description": "Source IANA timezone name (e.g., 'America/New_York', 'Europe/London'). Use 'America/New_York' as local timezone if no source timezone provided by the user."
            },
            "time": {
              "type": "string",
              "description": "Time to convert in 24-hour format (HH:MM)"
            },
            "target_timezone": {
              "type": "string",
              "description": "Target IANA timezone name (e.g., 'Asia/Tokyo', 'America/San_Francisco'). Use 'America/New_York' as local timezone if no target timezone provided by the user."
            }
          },
          "required": [
            "source_timezone",
            "time",
            "target_timezone"
          ]
        }
      }
    ]
  }
}

Use Gateway (Streamable HTTP Mode)

Available when GatewayProtocol is streamhttp (set via config or --protocol=streamhttp).

Implements the MCP Streamable HTTP transport defined in spec 2025-03-26. The gateway exposes a single aggregated endpoint /stream that accepts POST, GET and DELETE. Session identifiers are carried in the Mcp-Session-Id HTTP header.

1. Establish a session (initialize)

POST /stream HTTP/1.1
Host: localhost:8080
Authorization: Bearer 123456
Accept: application/json, text/event-stream
Content-Type: application/json

{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
        "protocolVersion": "2025-03-26",
        "capabilities": {},
        "clientInfo": {"name": "my-client", "version": "1.0.0"}
    }
}

Response:

HTTP/1.1 200 OK
Content-Type: application/json
Mcp-Session-Id: 7782f2f9-563c-4379-b961-df06e49e54c0

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "protocolVersion": "2025-03-26",
        "serverInfo": {"name": "mcp-gateway", "version": "1.0.0"},
        "capabilities": { /* OR-merged from all downstream MCP servers */ },
        "instructions": "MCP Gateway aggregates multiple MCP servers. Tools are namespaced as <serverName>_<toolName>."
    }
}

Keep the returned Mcp-Session-Id and send it on every subsequent request.

2. Complete the handshake (notification)

POST /stream HTTP/1.1
Host: localhost:8080
Authorization: Bearer 123456
Content-Type: application/json
Mcp-Session-Id: 7782f2f9-563c-4379-b961-df06e49e54c0

{"jsonrpc": "2.0", "method": "notifications/initialized"}

Response: 202 Accepted (empty body).

3. Call tools or list resources

POST /stream HTTP/1.1
Host: localhost:8080
Authorization: Bearer 123456
Accept: application/json, text/event-stream
Content-Type: application/json
Mcp-Session-Id: 7782f2f9-563c-4379-b961-df06e49e54c0

{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "tools/call",
    "params": {
        "name": "{mcp-server-name}_get_current_time",
        "arguments": {"timezone": "Asia/Seoul"}
    }
}

Aggregated tool names follow the pattern <serverName>_<toolName>, same rule as the SSE gateway mode.

The response arrives synchronously in the HTTP response body:

{"jsonrpc": "2.0", "id": 2, "result": { /* ... */ }}

Notifications (JSON-RPC messages without id) are answered with 202 Accepted and forwarded asynchronously.

4. Subscribe to server-initiated events (optional)

GET /stream HTTP/1.1
Host: localhost:8080
Authorization: Bearer 123456
Accept: text/event-stream
Mcp-Session-Id: 7782f2f9-563c-4379-b961-df06e49e54c0

The gateway keeps the connection open and emits event: message frames for server → client JSON-RPC requests and notifications (e.g. progress updates, log messages). JSON-RPC responses are never pushed here — they are returned in the HTTP response of the originating POST /stream request.

Lines starting with : are SSE keepalive comments and can be ignored.

5. Close the session

DELETE /stream HTTP/1.1
Host: localhost:8080
Authorization: Bearer 123456
Mcp-Session-Id: 7782f2f9-563c-4379-b961-df06e49e54c0

Response: 200 OK.

Single-server passthrough

In Streamable HTTP mode you can also reach an individual MCP server directly:

POST /{mcp-server-name} HTTP/1.1
GET  /{mcp-server-name} HTTP/1.1

The gateway forwards the request to the target MCP's message endpoint. Session management in this mode is the responsibility of the downstream server.

Connecting with MCP Inspector

  1. In Inspector select Transport Type: Streamable HTTP.
  2. URL: http://localhost:8080/stream.
  3. Under ConfigurationCustom Headers, add Authorization: Bearer <ApiKey>.
  4. Click Connect. The Inspector handles the Mcp-Session-Id exchange automatically.

README mirrored from the source repository 3 days ago. The original is authoritative.

Questions

About Gateway

How do I install Gateway?

Run npx mcp-gateway, then add the server to your MCP client's configuration. Conduid has recorded 0 installs, so the command is known to work with current clients.

Is Gateway safe to use with an AI agent?

Its trust score is 48 out of 100 (fair). It passes 0 of 1 static security checks; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Gateway still maintained?

Yes — the latest release is v2.1.0 (21 Apr 2026), and the last commit was 11 months ago. The repository has 26 stars and 0 open issues.