MCP Gateway CLI

MCP开发工具

提供方 VincentK1991

开发工具 未标注 Token 社区 / 第三方

一个用于与MCP服务器交互的命令行工具,支持发现工具、缓存模式以及从终端直接调用工具。

一句话选型结论

按资料字段整理

MCP Gateway CLI 属于开发工具类 MCP 服务器,传输方式未标注,Token,没有现成安装命令,需按官方文档接入。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类开发工具 传输方式未标注 鉴权Token 部署方式未标注
GitHub 星标 2 仓库热度,无公开仓库时显示未标注
工具数 2 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

开发工具
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量2暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

适用场景

命令行工具Go本地部署MCP服务器工具发现模式缓存脚本集成

安装与配置

未标注 Token
上游未给出传输方式
  1. 1
    准备运行环境

    按官方文档确认运行环境(常见为 Node.js 或 Python),装好后再执行安装命令。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后客户端会列出约 2 个工具,随便调一个只读工具确认能返回结果。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
代码与仓库操作

在对话里直接查代码、提 issue、走 PR,省掉来回切工具。

本地命令与脚本

把构建、测试、格式化这类重复命令交给模型执行。

接口联调与测试

让模型调你的接口、跑一遍用例,快速定位问题。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 资料标注 2 个工具,职责相对集中,接入后不容易误操作。

先想清楚的地方

  • 没有现成安装命令,需要按官方文档自己填启动命令和参数。
  • 使用前要准备好Token对应的凭据,并按最小权限配置。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在开发工具场景里让模型直接调用外部能力的人。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
MCP Gateway CLI当前 2 未标注 未标注 无 2026-05-17
Git 838e2ec1 12 stdio · 本地进程 本地部署 有 2026-05-17
Markitdown MCP 2c653a5f 1 stdio · 本地进程 本地部署 有 2026-05-17
JavaGuide 未标注 stdio · 本地进程 本地部署 有 2026-04-11
awesome-claude-skills 未标注 stdio · 本地进程 本地部署 有 2026-04-26
Context7 831acf40 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

开发工具
字段来自项目仓库与公开索引,中文说明由本站标注
提供方VincentK1991上游标注的维护方 VincentK1991
分类开发工具本站按上游分类展示
连接方式未标注上游未给出传输方式
鉴权方式Token远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · 未标注本地安装时用到的包标识与运行时
部署类型未标注上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

6.4 KB
来自项目仓库与上游目录的原文,未做删改

网关cli

用于与进行交互的命令行工具 主控程序 服务器。它发现注册的MCP服务器暴露的工具,缓存它们的模式,并允许您直接从终端调用它们——完全支持管道、脚本和与其他CLI工具的组合。


安装

Homebrew(macOS和Linux)```bash

brew install VincentK1991/tap/gateway-cli


### curl(macOS和Linux)```bash
curl -fsSL https://raw.githubusercontent.com/VincentK1991/mcp-gateway-cli/main/install.sh | bash

这会检测您的操作系统和架构,从最新的GitHub版本下载正确的二进制文件,验证校验和,并安装到 /usr/local/bin.

要安装特定版本,请执行以下操作:```bash
VERSION=v1.2.0 curl -fsSL https://raw.githubusercontent.com/VincentK1991/mcp-gateway-cli/main/install.sh | bash


### 去安装(需要Go 1.23+)```bash
go install github.com/VincentK1991/mcp-gateway-cli@latest

验证安装```bash

gateway-cli --version


______________________________________________________________________

## 注册MCP服务器

MCP服务器已在中注册 `~/.gateway-cli/config.yaml`。如果文件不存在,请创建该文件:```yaml
mcps:
calculator:
url: http://localhost:8000/mcp
matrix:
url: http://localhost:8001/mcp

每个条目都需要一个名称(用作CLI子命令)和MCP服务器的URL /mcp 终点。

对于需要身份验证或自定义标头的MCP服务器,添加 headers 块:```yaml
mcps:
calculator:
url: http://localhost:8000/mcp
my-api:
url: https://api.example.com/mcp
headers:
Authorization: "Bearer mytoken"
another-api:
url: https://other.example.com/mcp
headers:
Authorization: "Bearer ${MY_API_TOKEN}" # reads from environment variable
X-Tenant-Id: "acme"


标头值支持环境变量扩展--使用 `${VAR}` 避免将机密直接存储在配置文件中。在运行任何命令之前,在shell中设置变量:```bash
export MY_API_TOKEN="your-secret-token"
gateway-cli my-api some-tool --flag value

编辑配置后,刷新模式缓存:```bash
gateway-cli schema refresh


您可以检查发现的内容:```bash
gateway-cli schema info
``````
Last fetched : 2026-03-16 22:29:12
MCP servers  : 2
Total tools  : 2

calculator (1 tools)
calculate            Perform a basic integer calculation.

matrix (1 tools)
process_matrix       Perform matrix operations on 1D/2D arrays or scalars.

运行工具

工具调用方式如下: gateway-cli [flags]

每个工具的标志都是根据其输入模式自动生成的。使用 --help 查看可用标志:```bash
gateway-cli calculator calculate --help
gateway-cli matrix process_matrix --help


**基本示例:**```bash
# Integer arithmetic
gateway-cli calculator calculate --a 10 --b 5 --operation add
gateway-cli calculator calculate --a 10 --b 3 --operation mul
gateway-cli calculator calculate --a 10 --b 0 --operation div   # returns error gracefully

# Vector operations
gateway-cli matrix process_matrix --a '[1,2,3]' --b '[4,5,6]' --operation add

# Matrix dot product
gateway-cli matrix process_matrix --a '[[1,2],[3,4]]' --b '[[5,6],[7,8]]' --operation dot

合成工具输出

使用 --json / -j 标记以剥离MCP信封并仅返回结构化结果。这使得将工具链接在一起变得简单明了:```bash

Step 1: compute a scale factor

Step 2: use it as input to the matrix tool

SCALE=$(gateway-cli --json calculator calculate --a 3 --b 4 --operation mul | jq '.result | floor')
gateway-cli --json matrix process_matrix --a '[[1,2],[3,4]]' --b "$SCALE" --operation mul
``````json
{
"error": null,
"result": [[12, 24], [36, 48]]
}


多级管道:```bash
# Chain three calculator calls
A=$(gateway-cli --json calculator calculate --a 2 --b 3 --operation add | jq '.result | floor')
B=$(gateway-cli --json calculator calculate --a 4 --b 2 --operation mul | jq '.result | floor')
gateway-cli --json calculator calculate --a "$A" --b "$B" --operation add | jq '.result'
# → 13

与其他CLI工具结合使用

输出是标准的JSON,因此它与Unix工具链自然集成。

jq——提取和转换:```bash

Extract just the result value

gateway-cli --json calculator calculate --a 10 --b 3 --operation mul | jq '.result'

Extract matrix rows

gateway-cli --json matrix process_matrix --a '[[1,2],[3,4]]' --b '[[5,6],[7,8]]' --operation dot \
| jq '.result[]'


**将输出保存到文件:**```bash
gateway-cli --json matrix process_matrix --a '[[1,2],[3,4]]' --b '[[5,6],[7,8]]' --operation dot \
> result.json

在shell脚本中使用:```bash

!/bin/bash

for op in add sub mul; do
echo -n "$op: "
gateway-cli --json calculator calculate --a 10 --b 3 --operation "$op" | jq '.result'
done


**插入其他工具(`fx`, `python`等等):**```bash
# Interactive JSON explorer
gateway-cli --json matrix process_matrix --a '[[1,2],[3,4]]' --b '[[5,6],[7,8]]' --operation dot | fx

# Process in Python
gateway-cli --json calculator calculate --a 10 --b 3 --operation add \
| python3 -c "import sys, json; d = json.load(sys.stdin); print(f'Result is {d[\"result\"]}')"

架构缓存管理```bash

gateway-cli schema refresh # force re-fetch from all MCP servers
gateway-cli schema info # show cached MCPs and tools
gateway-cli schema invalidate # delete the cache


每个命令上都有可用的标志:

|标志|描述|
|---|---|
| `--json`, `-j` |仅输出结构化内容(无MCP信封)|
| `--text`, `-t` |将第一个文本内容项以纯字符串形式输出|
| `--refresh-schema` |运行命令前重新获取架构|
| `--offline` |仅使用缓存的架构,切勿联系MCP服务器|
| `--config` |自定义配置文件的路径|

### 检查并更新您的版本```bash
# Show installed version
gateway-cli --version

# Homebrew
brew upgrade gateway-cli

# curl (re-runs the installer, overwrites the binary)
curl -fsSL https://raw.githubusercontent.com/VincentK1991/mcp-gateway-cli/main/install.sh | bash

# Go install
go install github.com/VincentK1991/mcp-gateway-cli@latest

gateway-cli还会在后台自动检查新版本(最多每天一次),并在有新版本可用时向stderr打印提醒。

常见问题

5 问
答案由本站依据条目字段整理,不引用上游原文
MCP Gateway CLI 怎么安装?

资料没有给出安装命令,请到官方仓库或文档按说明接入;这类条目多数是生态应用,或尚未发布可安装包。

MCP Gateway CLI 怎么在客户端里配置?

它的传输方式未标注,在客户端 MCP 配置里按官方文档填写启动命令和参数,保存后重启客户端生效。

MCP Gateway CLI 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

MCP Gateway CLI 需要 API Key 吗?

资料标注需要Token认证,使用前准备好对应凭据,并按最小权限配置。

MCP Gateway CLI 能提供哪些能力?

资料显示约 2 个工具;能力标签包括 命令行工具、工具发现、Go。具体工具清单以官方文档为准。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。