|
| 1 | +--- |
| 2 | +description: One-page health report for the MCP bridge — build, handshake, sample call, host config, logs |
| 3 | +allowed-tools: Bash, Read, Grep |
| 4 | +--- |
| 5 | + |
| 6 | +Aggregate every layer of the bridge into a single, scannable report. |
| 7 | +Run when the user says "is everything ok", "status check", "what's |
| 8 | +the state of MCP", or before a release. |
| 9 | + |
| 10 | +## Sections (run in order, stop only on hard failure) |
| 11 | + |
| 12 | +### 1. Binary |
| 13 | + |
| 14 | +```bash |
| 15 | +BIN=$(command -v lark-cli || echo "$HOME/bin/lark-cli") |
| 16 | +[ -x "$BIN" ] || { echo "no binary"; exit 1; } |
| 17 | +"$BIN" --version |
| 18 | +``` |
| 19 | + |
| 20 | +### 2. Catalogue |
| 21 | + |
| 22 | +```bash |
| 23 | +"$BIN" mcp tools 2>&1 | tail -3 |
| 24 | +``` |
| 25 | + |
| 26 | +Count tools. Compare to the count of `func toolXxx() tool {` |
| 27 | +in `cmd/mcp/tools.go` — should match. |
| 28 | + |
| 29 | +### 3. Handshake |
| 30 | + |
| 31 | +Reuse the recipe from `/mcp-test`. Capture stdout line count |
| 32 | +(expect 2) and stderr length. |
| 33 | + |
| 34 | +### 4. Sample `tools/call` |
| 35 | + |
| 36 | +Pick the safest tool from the catalogue (read-only, no required |
| 37 | +arg): `lark_calendar_agenda` with `{}` (today is the default), or |
| 38 | +`lark_task_my` with `{}`. Both are safe. If neither exists, skip |
| 39 | +this step and note "no safe sample". |
| 40 | + |
| 41 | +### 5. Host config |
| 42 | + |
| 43 | +```bash |
| 44 | +HOST_CFG="$HOME/Library/Application Support/Claude/claude_desktop_config.json" |
| 45 | +if [ -f "$HOST_CFG" ]; then |
| 46 | + python3 -c " |
| 47 | +import json |
| 48 | +c = json.load(open('$HOST_CFG')) |
| 49 | +servers = c.get('mcpServers', {}) |
| 50 | +for name, s in servers.items(): |
| 51 | + if 'lark' in name.lower(): |
| 52 | + print(name, '→', s.get('command'), s.get('args')) |
| 53 | +" |
| 54 | +fi |
| 55 | +``` |
| 56 | + |
| 57 | +### 6. Recent host log |
| 58 | + |
| 59 | +`tail -20` of the latest `~/Library/Logs/Claude/mcp*.log` if any. |
| 60 | + |
| 61 | +### 7. Auth |
| 62 | + |
| 63 | +`lark-cli auth status` first 3 lines + `lark-cli profile list` head. |
| 64 | + |
| 65 | +## Report shape |
| 66 | + |
| 67 | +``` |
| 68 | +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
| 69 | + MCP doctor — <timestamp> |
| 70 | +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
| 71 | +Binary <path> <version> ✅ / ❌ |
| 72 | +Catalogue <N> tools (source: <M>) ✅ / ⚠ drift / ❌ |
| 73 | +Handshake initialize + tools/list ✅ / ❌ |
| 74 | +Sample call <tool> → isError=<bool> ✅ / ❌ |
| 75 | +Host config registered as "<name>" → <path> ✅ / ❌ / not-installed |
| 76 | +Host log last error: "<line or —>" |
| 77 | +Auth profile=<name> identity=<u/b> ✅ / ❌ |
| 78 | +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
| 79 | +VERDICT HEALTHY / DEGRADED / BROKEN |
| 80 | +NEXT ACTION <one sentence, only if not HEALTHY> |
| 81 | +``` |
| 82 | + |
| 83 | +Then stop. Do not start work — the user might just be checking. |
| 84 | + |
| 85 | +## Hard rules |
| 86 | + |
| 87 | +- Pure observation. Do not mutate any state — no `auth login`, no |
| 88 | + host config edits, no rebuilds. |
| 89 | +- If a step requires sudo or a destructive command to even read |
| 90 | + (rare here), skip it and note "skipped, requires elevation". |
| 91 | +- Always clean up temp files: `rm -f /tmp/mcp-doctor.*`. |
0 commit comments