mcporter
$ mcporter 社区开源 中风险mcporter(openclaw/mcporter)将 Model Context Protocol 服务桥接为原生 shell 工作流。Agent 可通过 --brief/--schema 按需发现工具、借助 --stdio 或 --http-url 配合 --json 临时调用工具,甚至通过 generate-cli 与 emit-ts 生成独立 CLI 与 TypeScript 客户端。
npm install -g mcporter mcporter 让 Agent 直接在 bash 中按需以 --brief 和 --json 调用 MCP 工具,彻底消除常驻 MCP Schema 导致的上下文膨胀。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
专为 AI Agent 设计,提供 --json、--output json、--brief、--schema、临时 --stdio/--http-url 与 --quiet。
- Supports
--json,--output,--brief,--schema, and ad-hoc--stdio/--http-url
将只读 list 探测与 call 执行分离,并支持 --scope project|home 配置隔离;call 权限取决于目标 MCP 服务。
- Read-only
listdiscovery and--scopeconfig isolation
跨平台 Node.js CLI,支持 npx mcporter 免安装运行或 npm install -g mcporter。
- Zero-install
npx mcporterand npm package
把任意 MCP 服务转化为按需 CLI 或独立编译的 TypeScript 工具,有效解决上下文膨胀。
- Bridges MCP servers to shell +
generate-cli/emit-ts
由 openclaw/mcporter 在 MIT 协议下积极维护。
- Active
openclaw/mcporterrepo
仓库 README 详尽覆盖 list、call、config、auth 与 generate-cli。
- Comprehensive README at github.com/openclaw/mcporter
安全边界、鉴权与放权指南
服务配置存于 ./config/mcporter.json 或 ~/.mcporter/;支持导入 Cursor/Claude 配置并缓存 OAuth 令牌。
基于 MIT 协议 100% 免费开源。
# mcporter Agent Rules - Use `mcporter list <server> --brief` first instead of dumping full `--schema` for every server. - Always pass `--output json` (or `--json`) on `list` and `call`. - Review generated code before running `mcporter generate-cli` outputs in production.
Agent 高频安全命令配方
只读查询(安全推荐)
mcporter list --stdio "npx -y @modelcontextprotocol/server-filesystem ." --brief --json
临时拉起本地 MCP 服务并以紧凑 JSON 输出方法签名,不污染上下文。
mcporter list my-server --schema --json
只针对目标服务拉取完整 JSON Schema。
受控写入与预演
mcporter call my-server.search query="rate limit" --output json
从 shell 执行单次 MCP 工具调用并输出 JSON 结果。
核心优势
- +
--brief渐进发现配合--output json大幅削减 MCP 工具定义消耗的 Token。 - + 临时
--stdio与--http-url无需修改宿主全局配置即可直连测试服务。 - +
generate-cli与emit-ts可将高频 MCP 服务固化为独立命令行工具。
注意事项与踩坑点
- ! 对接需 OAuth 浏览器登录的远端服务时,
mcporter auth仍需人工完成授权。