mcp-inspector-debugging

A procedure for checking and debugging MCP servers through the MCP Inspector interface, with browser automation and server-log inspection.

In plain words
What is it for?
Use it to inspect an MCP server, automate Inspector checks with Playwright, manage the server through iTerm, read recent logs, and verify a build.
Why use it?
It provides a defined way to investigate failed connections or requests while avoiding terminal commands that keep running in the foreground.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/steipete/agent-rules/mcp-inspector-debugging
Clone the repo
git clone --depth 1 https://github.com/steipete/agent-rules
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,629 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01629
Opus 5 $0.00000 $0.00814
Sonnet 5 $0.00000 $0.00326
Haiku 4.5 $0.00000 $0.00163

Measured 2d ago against content hash 62ac1fa0dc44, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mcp-inspector-debugging scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

project-rules/mcp-inspector-debugging.mdc · 102 lines

How it starts

The opening of the file, as written. The whole thing — 102 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Rule Name: mcp-inspector Description: Debugging and verifying MCP servers via the MCP Inspector UI. This rule uses Playwright for UI automation, iTerm for server management, and Claude Code for log inspection.

Note: Replace placeholders with your specific values:

  • [MCP_SERVER_NAME] - Your MCP server name
  • [WORKSPACE_PATH] - Absolute path to your project
  • [TEST_CREDENTIALS] - Any test credentials needed
  • [CONFIG_FILE] - Your configuration file path
  • [LOG_FILE] - Your log file path

To read the log, use tail -n 100 /path/to/logfile.log

DO NOT RUN BLOCKING TERMINAL COMMANDS VIA YOUR TERMINAL TOOL. INSTEAD USE Terminal app via AppleScript. Blocking operations include:

  • node dist/index.js
  • npm run dev
  • npm start

This is ok: Grab the last X lines: tail -n 100 server.log

Run npm run build to verify build.

Check iTerm log when the MCP Inspector fails, as it might show errors from our service.

Required Tools:

  • run_terminal_cmd (for global pkill, and as fallback for Inspector start)
  • mcp_iterm-mcp_send_control_character
  • mcp_iterm-mcp_write_to_terminal
  • mcp_iterm-mcp_read_terminal_output
  • mcp_playwright_browser_navigate
  • mcp_playwright_browser_type
  • mcp_playwright_browser_click
  • mcp_playwright_browser_snapshot
  • mcp_playwright_browser_console_messages
  • mcp_playwright_browser_wait_for
  • mcp_claude-code_claude_code

User Workspace Path Placeholder:

  • [WORKSPACE_PATH] in this rule MUST be replaced by the AI assistant with the absolute path to the user's current project workspace (e.g., from <user_info>).

Phase 1: Start MCP Inspector Server (via iTerm)

  1. Clear iTerm & Kill Existing Inspector Processes:
    • Action: mcp_iterm-mcp_send_control_character, letter: "C". (Stop any current iTerm command).
  2. Start New Inspector Process in iTerm:
    • Action: mcp_iterm-mcp_write_to_terminal, command: [ENV_VARS] npx @modelcontextprotocol/inspector ./start.sh.
    • Action: mcp_iterm-mcp_read_terminal_output, linesOfOutput: 7 (or enough to see startup messages clearly).
    • Verify: Look for "MCP Inspector is up and running at http://127.0.0.1:6274". Note the proxy port.
  3. Wait for Inspector UI: mcp_playwright_browser_wait_for, time: 3 (seconds).

Phase 2: Connect to MCP Server via Playwright

  1. Navigate/Refresh Inspector Page:
    • Action: mcp_playwright_browser_navigate, url: http://127.0.0.1:6274.
    • Expected: Ensures a fresh state of the Inspector UI.
    • Snapshot: Take a snapshot.
  2. Fill Connection Form:
    • Set Command: (Obtain ref from snapshot for "Command textbox")
      • Action: mcp_playwright_browser_type, text: [WORKSPACE_PATH]/start.sh.
    • Set Arguments: (Obtain ref for "Arguments textbox")
      • Action: mcp_playwright_browser_type, text: "".
    • Environment Variables: (prefilled if you add it in the inspector call)
      • Action: Click "Environment Variables" button (obtain ref) to view current. Snapshot. Environment variables may be set in your configuration file. No UI entry is strictly needed unless overriding these for a specific test run.
      • (If needing to override, e.g., LOG_FILE_PATH=/tmp/custom-mcp-server.log):
        • Click "Add Environment Variable" button (obtain ref).
        • Type key into the new key textbox (obtain ref).
        • Type value into the new value textbox (obtain ref). Repeat as needed.
  3. Click "Connect": (Obtain ref from snapshot for "Connect button")
    • Action: mcp_playwright_browser_click.
    • Snapshot: Take a snapshot.
  4. Verify Connection:
    • Examine snapshot: Check for connected status (e.g., service [MCP_SERVICE_NAME] appears).
    • If connection fails, examine "Error output from MCP server" panel in Inspector UI. This shows stderr from start.sh.
    • Crucially, also check the start.sh debug log: mcp_claude-code_claude_code, prompt: "Read /tmp/[MCP_SERVER_NAME]_start_debug.log".
    • If start.sh log shows it tried to run [MCP_SERVER_NAME] but Inspector still failed to connect, then check [MCP_SERVER_NAME]'s own log: mcp_claude-code_claude_code, prompt: "Read [WORKSPACE_PATH]/[LOG_FILE]".

Read the full file on GitHub · 102 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 102 lines · 0 tokens per session scan A 62ac1fa0dc44

Subscribe to this mod's changes

mcp-inspector-debugging is a cursor rule published in the GitHub repository steipete/agent-rules (5,695 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,629 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.