Command Palette

Search for a command to run...

UnylyUnyly
Browse all

@Zhangzwd/ Gateway

FreeNot checked

A lightweight MCP gateway that aggregates multiple MCP services into a unified stdio interface, automatically prefixing tool names with the service name to avoi

GitHubEmbed

About

A lightweight MCP gateway that aggregates multiple MCP services into a unified stdio interface, automatically prefixing tool names with the service name to avoid conflicts.

README

一个轻量级 MCP 网关,将多个 MCP 服务聚合成一个统一的 stdio 接口。

每个子服务的工具会自动加上 {服务名}_ 前缀,避免工具名冲突。

安装

npx @zhangzwd/mcp-gateway

无需全局安装,npx 会自动下载运行。

配置文件

默认读取 ~/.mcp/gateway.config.json,可通过环境变量 MCP_GATEWAY_CONFIG 覆盖路径。

{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp", "--api-key", "你的API_KEY"]
    },
    "另一个服务名": {
      "command": "node",
      "args": ["path/to/server.js"]
    }
  }
}

mcpServers 中的每个 key 就是服务名,会作为工具前缀。例如 context7 服务的 resolve-library-id 工具对外暴露为 context7_resolve-library-id

在 AI 工具中使用

opencode.json

{
  "mcp": {
    "gateway": {
      "type": "local",
      "command": ["npx", "-y", "@zhangzwd/mcp-gateway"]
    }
  }
}

codex config.toml

[mcp_servers.gateway]
command = "npx"
args = ["-y", "@zhangzwd/mcp-gateway"]

reasonix config.json

{
  "mcpServers": {
    "gateway": {
      "command": "npx",
      "args": ["-y", "@zhangzwd/mcp-gateway"]
    }
  }
}

项目结构

~/.mcp/gateway.config.json   # 配置文件(你编辑这个)
~/.mcp-gateway/
  gateway.js                  # 主程序(已发布到 npm)
  package.json
  README.md

工作原理

  1. 读取 gateway.config.json,获取子 MCP 服务列表
  2. 为每个子服务启动一个子进程(stdio 通信)
  3. 调用 listTools 获取工具列表,工具名加 {服务名}_ 前缀
  4. 将自己注册为一个 MCP Server,暴露合并后的工具列表
  5. 收到 tools/call 请求时,根据工具名前缀路由到对应的子服务

from github.com/zhangzwd/mcp-gateway

Install @Zhangzwd/ Gateway in Claude Desktop, Claude Code & Cursor

Recommended · one command, every IDE
unyly install zhangzwd-mcp-gateway

Installs into Claude Desktop, Claude Code, Cursor & VS Code — handles npx, uvx and build-from-source repos for you.

First time? Get the CLI: curl -fsSL https://unyly.org/install | sh

Or configure manually

Run in your terminal:

claude mcp add zhangzwd-mcp-gateway -- npx -y @zhangzwd/mcp-gateway

FAQ

Is @Zhangzwd/ Gateway MCP free?

Yes, @Zhangzwd/ Gateway MCP is free — one-click install via Unyly at no cost.

Does @Zhangzwd/ Gateway need an API key?

No, @Zhangzwd/ Gateway runs without API keys or environment variables.

Is @Zhangzwd/ Gateway hosted or self-hosted?

Self-hosted: the server runs locally on your machine via the install command above.

How do I install @Zhangzwd/ Gateway in Claude Desktop, Claude Code or Cursor?

Open @Zhangzwd/ Gateway on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.

Related MCPs

Compare @Zhangzwd/ Gateway with

Not sure what to pick?

Find your stack in 60 seconds

Author?

Embed badge for your README

Browse similar

All development MCPs