mcporter

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

MCPorter (
mcporter
)

MCPorter (
mcporter
)

MCPorter is a CLI for working with MCP servers. Use it to discover configured servers, read their tool signatures, and call tools directly from the shell.
The two commands that matter most are
list
(discover and inspect) and
call
(invoke). Always
list
before you
call
so arguments match the real schema.
For exact flags, run
mcporter <command> --help
. MCPorter discovers servers from its config — the global config at
~/.mcporter/mcporter.json
, a project config at
./config/mcporter.json
, or an explicit
--config <path>
— plus editor imports (Cursor, Claude Code, Codex, etc.). Use
mcporter config list
or
mcporter list --verbose
to see where each server comes from.
MCPorter 是一款用于操作MCP服务器的CLI工具。你可以用它发现已配置的服务器、读取其工具签名,并直接从Shell中调用工具。
最常用的两个命令是
list
(发现和检查)和
call
(调用)。调用前务必先执行
list
,确保参数匹配实际的架构。
如需查看具体参数,请运行
mcporter <command> --help
。MCPorter会从配置中发现服务器——包括全局配置
~/.mcporter/mcporter.json
、项目配置
./config/mcporter.json
,或者通过显式指定
--config <path>
——此外还支持编辑器导入(Cursor、Claude Code、Codex等)。使用
mcporter config list
mcporter list --verbose
可以查看每个服务器的来源。

Workflow

工作流程

bash
undefined
bash
undefined

1. See configured servers and their health

1. 查看已配置的服务器及其健康状态

mcporter list
mcporter list

2. Read one server's tools as TypeScript-like signatures

2. 读取某一服务器的工具,以类TypeScript签名形式展示

mcporter list <server>
mcporter list <server>

3. Call a tool using the signature from step 2

3. 使用步骤2中的签名调用工具

mcporter call '<server>.<tool>(arg: "value", count: 5)'
undefined
mcporter call '<server>.<tool>(arg: "value", count: 5)'
undefined

list
— discover and inspect

list
—— 发现与检查

bash
mcporter list                             # All servers, with live status
mcporter list <server>                    # Tools for one server, as signatures
mcporter list <server> --schema           # Raw JSON schema for each tool
mcporter list <server> --json             # Machine-readable, full tool metadata
mcporter list <server> --all-parameters   # Reveal hidden optional params
Single-server output reads like a TypeScript header: a doc comment per tool, a
function name(...)
signature with required params first and optional ones marked
?
, plus an
Examples:
block written in the function-call syntax below. Optional params beyond the first few are hidden unless you pass
--all-parameters
or
--schema
.
ts
function web_search_exa(query: string, numResults?: number);
bash
mcporter list                             # 所有服务器,包含实时状态
mcporter list <server>                    # 某一服务器的工具,以签名形式展示
mcporter list <server> --schema           # 每个工具的原始JSON架构
mcporter list <server> --json             # 机器可读的完整工具元数据
mcporter list <server> --all-parameters   # 显示隐藏的可选参数
单服务器的输出类似TypeScript头文件:每个工具配有文档注释,
function name(...)
签名中必填参数在前,可选参数标记为
?
,下方还有一个使用下文函数调用语法编写的
Examples:
块。除非传入
--all-parameters
--schema
,否则前几个之外的可选参数会被隐藏。
ts
function web_search_exa(query: string, numResults?: number);

call
— invoke a tool

call
—— 调用工具

Recommended: function-call syntax. It mirrors the signature from
mcporter list
, is self-documenting, handles nested objects/arrays, and avoids shell-flag ambiguity. Wrap the whole argument in single quotes.
bash
mcporter call 'exa.web_search_exa(query: "best React state libraries", numResults: 5)'
mcporter call 'linear.create_comment(issueId: "ENG-123", body: "Looks good!")'
  • Named arguments are preferred; unlabeled values map to schema order.
  • Use
    --output json
    for structured results; connection/auth/offline/http failures emit a
    { server, tool, issue }
    envelope for scripting.
bash
mcporter call 'exa.web_search_exa(query: "...")' --output json
推荐:函数调用语法。它与
mcporter list
输出的签名一致,具备自文档化特性,支持嵌套对象/数组,还能避免Shell参数歧义。请将整个参数用单引号包裹。
bash
mcporter call 'exa.web_search_exa(query: "best React state libraries", numResults: 5)'
mcporter call 'linear.create_comment(issueId: "ENG-123", body: "Looks good!")'
  • 推荐使用命名参数;未标记的值会按照架构顺序映射。
  • 使用
    --output json
    可获取结构化结果;连接/认证/离线/HTTP失败时会输出
    { server, tool, issue }
    格式的信息,便于脚本处理。
bash
mcporter call 'exa.web_search_exa(query: "...")' --output json

Other argument styles (when the recommended one is awkward)

其他参数风格(当推荐风格使用不便时)

bash
undefined
bash
undefined

Shell-friendly key/value pairs (good in scripts)

适合Shell的键值对格式(适用于脚本)

mcporter call linear.list_issues team=ENG limit:5
mcporter call linear.list_issues team=ENG limit:5

Prebuilt JSON payload (or
--json -
to read from stdin)

预构建的JSON负载(或使用
--json -
从标准输入读取)

mcporter call linear.create_issue --json '{"title":"Bug","team":"ENG"}'
mcporter call linear.create_issue --json '{"title":"Bug","team":"ENG"}'

Read a long string argument from a file

从文件读取长字符串参数

mcporter call linear.create_comment issueId=LNR-123 body=@comment.md
undefined
mcporter call linear.create_comment issueId=LNR-123 body=@comment.md
undefined

Ad-hoc servers (not in config)

临时服务器(未在配置中)

Point
list
/
call
at an endpoint directly, no config edit needed:
bash
mcporter list https://mcp.linear.app/mcp
mcporter call 'https://www.shadcn.io/api/mcp.getComponent(component: "vortex")'
mcporter list --stdio "bun run ./server.ts" --env TOKEN=xyz
Bare domains assume
https://
; plain
http://
needs
--allow-http
. Persist a tried endpoint with
--persist <config>
to make its short name reusable.
无需修改配置,直接将
list
/
call
指向端点即可:
bash
mcporter list https://mcp.linear.app/mcp
mcporter call 'https://www.shadcn.io/api/mcp.getComponent(component: "vortex")'
mcporter list --stdio "bun run ./server.ts" --env TOKEN=xyz
裸域名默认使用
https://
;若使用纯
http://
则需添加
--allow-http
参数。使用
--persist <config>
可将测试过的端点持久化,使其短名称可重复使用。

Notes

注意事项

  • Pass secrets via environment variables, e.g.
    LINEAR_API_KEY=… mcporter call 'linear.search_documentation(query: "automations")'
    .
  • Other commands exist (
    auth
    ,
    config
    ,
    resource
    ,
    daemon
    ,
    generate-cli
    ,
    emit-ts
    ); run
    mcporter --help
    when you need them.
  • 通过环境变量传递密钥,例如
    LINEAR_API_KEY=… mcporter call 'linear.search_documentation(query: "automations")'
  • 还有其他命令可用(
    auth
    config
    resource
    daemon
    generate-cli
    emit-ts
    );需要时运行
    mcporter --help
    查看详情。