
mcp-spy
Debug MCP server communication. Use for troubleshooting MCP integrations, viewing traffic, and analyzing latency.
- Installs
- 41
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/johnlindquist/claude --skill mcp-spy- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads mcp-spy automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
MCP Spy - Debug MCP Communication
Debug Model Context Protocol server integrations.
Overview
MCP Spy helps debug:
- Message traffic between Claude and MCP servers
- Latency issues
- Failed requests
- Protocol compliance
Traffic Analysis
View Recent Traffic
# Check MCP logs
tail -f ~/.claude/debug/mcp-*.log
# Or specific server
tail -f ~/.claude/debug/mcp-cm.log
Filter by Type
# Tool calls only
grep "tool_use" ~/.claude/debug/mcp-*.log
# Errors only
grep -i "error\|failed" ~/.claude/debug/mcp-*.log
# Specific tool
grep "beads_add" ~/.claude/debug/mcp-*.log
Latency Analysis
Measure Response Times
# Time a specific tool
time claude --print "Run beads_ready" --dangerously-skip-permissions 2>&1 | head -1
Find Slow Calls
# Look for latency warnings in logs
grep -i "timeout\|slow\|latency" ~/.claude/debug/mcp-*.log
Failed Request Analysis
Find Failures
# All errors
grep -i "error" ~/.claude/debug/mcp-*.log
# Parse error responses
grep "\"error\":" ~/.claude/debug/mcp-*.log | jq '.'
Common Issues
- Connection refused - Server not running
- Timeout - Server too slow
- Invalid JSON - Malformed request/response
- Unknown tool - Tool not registered
MCP Server Debug
Check Server Status
# Test server connection
curl -X POST http://localhost:3000/mcp/list_tools \
-H "Content-Type: application/json" \
-d '{}'
Server Logs
# View server logs (if running as process)
tail -f logs/mcp-server.log
# Or in terminal running server
# Logs appear in stdout
Test Tool Directly
# Call tool directly
curl -X POST http://localhost:3000/mcp/call_tool \
-H "Content-Type: application/json" \
-d '{
"name": "beads_ready",
"args": {}
}'
Protocol Debugging
Inspect Messages
# Pretty print JSON messages
grep "message" ~/.claude/debug/mcp-*.log | jq '.'
Validate Requests
# Check request format
gemini -m pro -o text -e "" "Validate this MCP request format:
$(grep "request" ~/.claude/debug/mcp-*.log | tail -1)
Check:
1. Required fields present
2. Types correct
3. Schema compliance"
Troubleshooting Guide
Server Won't Start
# Check if port in use
lsof -i :3000
# Check server process
ps aux | grep mcp
# Start with verbose
node server/index.ts --verbose
Tool Not Found
# List available tools
curl http://localhost:3000/mcp/list_tools | jq '.tools[].name'
# Check tool registration
grep "registerTool\|toolRegistry" server/*.ts
Slow Responses
# Profile tool execution
time curl -X POST http://localhost:3000/mcp/call_tool \
-H "Content-Type: application/json" \
-d '{"name": "slow_tool", "args": {}}'
# Check for blocking operations
grep -i "await\|sync" tools/slow_tool/index.ts
JSON Parse Errors
# Find malformed JSON
grep -B 5 "JSON\|parse" ~/.claude/debug/mcp-*.log | grep -i error
# Validate JSON
echo '{"test": ...}' | jq '.'
Monitoring
Watch Traffic Live
# Real-time log monitoring
tail -f ~/.claude/debug/mcp-*.log | grep --line-buffered "tool_use\|result"
Traffic Stats
# Count calls per tool
grep "tool_use" ~/.claude/debug/mcp-*.log | \
grep -oP '"name":"[^"]*"' | \
sort | uniq -c | sort -rn
Health Dashboard
#!/bin/bash
# mcp-health.sh
echo "=== MCP Server Health ==="
# Check server
if curl -s http://localhost:3000/health > /dev/null 2>&1; then
echo "Server: UP"
else
echo "Server: DOWN"
fi
# Recent errors
ERRORS=$(grep -c "error" ~/.claude/debug/mcp-*.log 2>/dev/null || echo 0)
echo "Recent errors: $ERRORS"
# Tool count
TOOLS=$(curl -s http://localhost:3000/mcp/list_tools 2>/dev/null | jq '.tools | length' || echo 0)
echo "Registered tools: $TOOLS"
Best Practices
- Enable logging - Keep debug logs on during development
- Check health first - Verify server running before debugging
- Test isolation - Test tools directly before through Claude
- Monitor latency - Watch for degradation
- Log rotation - Don't let logs grow unbounded
- Error alerts - Set up monitoring for failures
FAQ
What does the mcp-spy skill do?
Debug MCP server communication. Use for troubleshooting MCP integrations, viewing traffic, and analyzing latency.
How do I install mcp-spy?
Run npx skills add https://github.com/johnlindquist/claude --skill mcp-spy in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/mcp-spy/ (personal) or .claude/skills/mcp-spy/ (project).
Which AI agents can use mcp-spy?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is mcp-spy safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains mcp-spy?
It is published by johnlindquist in johnlindquist/claude. It has 41 recorded installs.
More from johnlindquist/claude
gemini-image
johnlindquist/claude
Analyze images using Gemini's vision capabilities. Use for image analysis, text extraction from screenshots, and visual content understanding.
brainstorm
johnlindquist/claude
Open the skill to read its SKILL.md instructions.
deepwiki
johnlindquist/claude
Query DeepWiki for repository documentation and structure. Use to understand open source projects, find API docs, and explore codebases.
Popular ai & agents skills
google-agents-cli-publish
google/agents-cli
This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).
google-agents-cli-eval
google/agents-cli
This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).
skill-creator
anthropics/skills
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
codex-pet
prime-skills/runcomfy-agent-skills
Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.
full-output-enforcement
leonxlnx/taste-skill
Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.
executing-plans
obra/superpowers
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available