test-mcp-by-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTest MCP by CLI
通过CLI测试MCP
Validate MCP servers with (philschmid/mcp-cli v0.3.0) using release-verified behavior first, then use official repo source only when it matches what the installed binary actually does.
mcp-cli首先使用经过发布验证的行为,通过(philschmid/mcp-cli v0.3.0)验证MCP服务器;仅当官方仓库源码与已安装二进制文件的实际表现一致时,才使用官方仓库源码。
mcp-cliCore rules
核心规则
- Execute commands directly and sequentially.
- Do not write helper scripts unless explicitly requested.
- Treat server work as incomplete until verification checks pass.
- Prefer single-server commands while debugging.
- After rebuilding a server, always retest with .
MCP_NO_DAEMON=1 - Treat and real command output as the primary behavioral source for the installed release.
mcp-cli --help - Remember that returns the raw MCP JSON envelope on stdout in the installed
callbinary.v0.3.0
- 直接按顺序执行命令。
- 除非明确要求,否则不要编写辅助脚本。
- 在验证检查全部通过前,视服务器工作为未完成状态。
- 调试时优先使用单服务器命令。
- 重建服务器后,务必使用重新测试。
MCP_NO_DAEMON=1 - 将及实际命令输出作为已安装版本的主要行为参考依据。
mcp-cli --help - 请记住,在已安装的v0.3.0版本二进制文件中,命令会在标准输出中返回原始的MCP JSON信封。
call
What to load first
优先加载内容
Use this progressive order to keep context tight:
- This file () for command strategy, decision rules, and execution flow.
SKILL.md - Skill references for concrete command blocks:
- — 8-phase verification sequence and checklist
references/testing-flow.md - — config format, search paths, tool filtering, env var substitution, JSON input methods
references/configuration-and-arguments.md - — raw output parsing, stream handling, chaining, CI/CD patterns, verified environment variables
references/output-debugging-and-chaining.md - — common errors, exit codes, daemon behavior, and release inconsistencies
references/errors-and-recovery.md
- Read only the relevant reference for the current problem instead of loading all files.
- Return to this file when you need the overall workflow or decision rules.
遵循以下渐进式顺序,以保持上下文紧凑:
- 本文件():提供命令策略、决策规则及执行流程。
SKILL.md - Skill参考文档:包含具体命令块:
- — 8阶段验证序列及检查清单
references/testing-flow.md - — 配置格式、搜索路径、工具过滤、环境变量替换、JSON输入方法
references/configuration-and-arguments.md - — 原始输出解析、流处理、命令链、CI/CD模式、已验证环境变量
references/output-debugging-and-chaining.md - — 常见错误、退出码、守护进程行为及版本不一致问题
references/errors-and-recovery.md
- 仅加载与当前问题相关的参考文档,而非全部文件。
- 当需要整体工作流或决策规则时,回到本文件。
Execution workflow
执行工作流
- Follow the 8-phase verification order in .
references/testing-flow.md - Use config and JSON argument patterns from .
references/configuration-and-arguments.md - Use stream handling, chaining, and env controls from .
references/output-debugging-and-chaining.md - If any command fails, apply diagnosis from .
references/errors-and-recovery.md - Do not report done until all checklist items pass.
- 遵循中的8阶段验证顺序。
references/testing-flow.md - 使用中的配置及JSON参数模式。
references/configuration-and-arguments.md - 使用中的流处理、命令链及环境变量控制方法。
references/output-debugging-and-chaining.md - 若任何命令执行失败,参考进行诊断。
references/errors-and-recovery.md - 所有检查清单项通过前,不要报告完成。
Decision rules
决策规则
Apply when things go wrong:
- If Phase 1 (connect) fails: stop everything. Fix config or server startup before proceeding.
- If a tool is missing from inventory: check in config — it takes precedence over
disabledTools. ReadallowedTools.references/configuration-and-arguments.md - If calls return stale results: use — the daemon caches old server processes for 60s. Read daemon section in
MCP_NO_DAEMON=1.references/errors-and-recovery.md - If calls hang: lower timeout with (default is 1800s). Read env var section in
MCP_TIMEOUT=30.references/output-debugging-and-chaining.md - If debugging protocol issues: use to see full protocol traffic on stderr.
MCP_DEBUG=1 - If (no args) hangs: it connects ALL servers. Use
mcp-clito test one at a time.mcp-cli info <server> - If you get : always use a subcommand —
AMBIGUOUS_COMMAND,call, orinfo.grep - If output parsing looks wrong: returns raw JSON in this release. Extract content with
call. Readjq -r '.content[0].text'.references/output-debugging-and-chaining.md - If docs and binary disagree: trust the installed binary and real command output over inferred internals.
当出现问题时应用以下规则:
- 若阶段1(连接)失败:立即停止所有操作。在继续之前修复配置或服务器启动问题。
- 若工具未出现在清单中:检查配置中的— 它的优先级高于
disabledTools。请阅读allowedTools。references/configuration-and-arguments.md - 若调用返回过时结果:使用— 守护进程会缓存旧服务器进程60秒。请阅读
MCP_NO_DAEMON=1中的守护进程章节。references/errors-and-recovery.md - 若调用挂起:通过降低超时时间(默认是1800秒)。请阅读
MCP_TIMEOUT=30中的环境变量章节。references/output-debugging-and-chaining.md - 若调试协议问题:使用在标准错误输出中查看完整协议流量。
MCP_DEBUG=1 - 若(无参数)挂起:它会连接所有服务器。使用
mcp-cli逐个测试。mcp-cli info <server> - 若出现错误:务必使用子命令 —
AMBIGUOUS_COMMAND、call或info。grep - 若输出解析异常:在本版本中返回原始JSON。使用
call提取内容。请阅读jq -r '.content[0].text'。references/output-debugging-and-chaining.md - 若文档与二进制文件表现不一致:优先信任已安装的二进制文件及实际命令输出,而非推断的内部实现。
Repository-specific execution mode
仓库专属执行模式
When validating this repository's own source code, run the local CLI implementation:
bash
bun run src/index.ts -c ./mcp_servers.json info filesystem
bun run src/index.ts -c ./mcp_servers.json call filesystem read_file '{"path":"./README.md"}'Use globally installed for all other workflows.
mcp-cli当验证本仓库自身的源码时,运行本地CLI实现:
bash
bun run src/index.ts -c ./mcp_servers.json info filesystem
bun run src/index.ts -c ./mcp_servers.json call filesystem read_file '{"path":"./README.md"}'所有其他工作流均使用全局安装的。
mcp-cliMinimal quick start
极简快速入门
bash
undefinedbash
undefinedInstall if missing
若未安装则进行安装
which mcp-cli || curl -fsSL https://raw.githubusercontent.com/philschmid/mcp-cli/main/install.sh | bash
which mcp-cli || curl -fsSL https://raw.githubusercontent.com/philschmid/mcp-cli/main/install.sh | bash
Connect and inspect
连接并检查
mcp-cli info my-server
mcp-cli info my-server my-tool
mcp-cli info my-server
mcp-cli info my-server my-tool
Happy path + error path
正常路径 + 错误路径测试
mcp-cli call my-server my-tool '{"param":"value"}'
mcp-cli call my-server my-tool '{}'
mcp-cli call my-server my-tool '{"param":"value"}'
mcp-cli call my-server my-tool '{}'
Fresh-connection check after rebuild
重建后进行新连接检查
MCP_NO_DAEMON=1 mcp-cli call my-server my-tool '{"param":"value"}'
If any step fails, continue debugging; do not claim completion.MCP_NO_DAEMON=1 mcp-cli call my-server my-tool '{"param":"value"}'
若任何步骤失败,请继续调试;不要声称已完成。Reference files
参考文件
| File | When to read |
|---|---|
| Running the full 8-phase verification sequence or the final checklist |
| Setting up config files, tool filtering, env var substitution, or passing JSON arguments |
| Parsing output, piping between tools, CI/CD scripts, or controlling behavior via env vars |
| Any command fails — error type lookup, exit code interpretation, daemon issues, or release inconsistencies |
| 文件 | 阅读时机 |
|---|---|
| 运行完整的8阶段验证序列或最终检查清单时 |
| 设置配置文件、工具过滤、环境变量替换或传递JSON参数时 |
| 解析输出、工具间管道传输、编写CI/CD脚本或通过环境变量控制行为时 |
| 任何命令执行失败时 — 错误类型查找、退出码解读、守护进程问题或版本不一致问题 |