realwigu/mcp-doctor
๐ ๐ ๐ ๐ช ๐ง - Zero-config diagnostics for MCP servers. Auto-discovers configs across Claude Code, Cursor, VS Code, Windsurf, and Claude Desktop, then tests connections via JSON-RPC handshake, audits security issues, and benchmarks latency. Also runs as an MCP server itself.
Quick Install
{
"mcpServers": {
"realwigu-mcp-doctor": {
"command": "npx",
"args": [
"-y",
"realwigu-mcp-doctor"
]
}
}
}Using an AI coding agent (Claude Code, Cursor, etc.)? Copy a ready-made prompt that tells it to fetch the setup instructions and install this server for you.
Documentation Overview
mcp-doctor
Diagnose, secure, and benchmark your MCP servers.
Zero-config CLI that auto-discovers MCP server configs across Claude Code, Cursor, VS Code, Windsurf, and Claude Desktop โ then tests connections, flags security issues, and benchmarks latency in seconds.
Why?
MCP servers are becoming the backbone of AI-assisted development. But as you add more servers across more tools, things break silently:
- Servers go down and you don't notice until a tool call fails mid-conversation
- Secrets leak โ API keys hardcoded in config files, tokens visible in process args
- Slow servers drag down your entire AI workflow without you realizing it
- Configs drift between tools โ what works in Cursor might be broken in Claude Desktop
mcp-doctor gives you a single command to check everything, across every tool, in seconds.
Quick Start
npx @wigu/mcp-doctor doctor
That's it. No config needed โ it finds your servers automatically.
Commands
| Command | Description |
|---|---|
doctor | Run all checks at once (scan + security + bench) |
scan | Test all MCP server connections |
security | Audit configs for security issues |
bench | Benchmark server response times |
serve | Run as an MCP server (stdio transport) |
All commands support --json for machine-readable output.
doctor โ Full checkup (recommended)
Runs scan, security, and bench in one go and prints a summary.
mcp-doctor doctor
# JSON output for CI/scripts
mcp-doctor doctor --json
scan โ Test all MCP server connections
Discovers configs and verifies each server responds to a JSON-RPC handshake.
$ mcp-doctor scan
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ mcp-doctor v0.3.0 โ
โ Diagnose ยท Secure ยท Benchmark โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Found 3 server(s)
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโฌโโโโโโโโโโ
โ Server โ Source โ Status โ
โโโโโโโโโโโโโโโโผโโโโโโโโโโโโโผโโโโโโโโโโค
โ filesystem โ Claude โ โ OK โ
โ postgres โ Cursor โ โ OK โ
โ slack โ VS Code โ โ FAIL โ
โโโโโโโโโโโโโโโโดโโโโโโโโโโโโโดโโโโโโโโโโ
security โ Audit configs for security issues
Checks for leaked secrets, overly broad permissions, and risky command patterns.
$ mcp-doctor security
โ 2 issues found
โโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Severity โ Server โ Issue โ
โโโโโโโโโโโโผโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ HIGH โ postgres โ Plaintext password in config โ
โ MEDIUM โ slack โ Token visible in args โ
โโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
bench โ Benchmark server response times
Measures JSON-RPC round-trip latency for every configured server.
$ mcp-doctor bench
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโ
โ Server โ Latency โ Rating โ
โโโโโโโโโโโโโโโโผโโโโโโโโโโโผโโโโโโโโโค
โ filesystem โ 12ms โ fast โ
โ postgres โ 87ms โ ok โ
โ slack โ timeout โ โ โ
โโโโโโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโ
MCP Server Mode
mcp-doctor can also run as an MCP server itself, exposing scan, security, bench, and doctor as tools your AI assistant can call directly.
{
"mcpServers": {
"mcp-doctor": {
"command": "npx",
"args": ["@wigu/mcp-doctor"]
}
}
}
When invoked without arguments and stdin is piped, it automatically starts in server mode using stdio transport. You can also explicitly run:
mcp-doctor serve
This means your AI assistant can diagnose its own MCP infrastructure on demand.
GitHub Action
Use mcp-doctor in CI to catch broken servers and leaked secrets automatically:
- name: Check MCP servers
uses: realwigu/mcp-doctor@main
with:
command: doctor
fail-on-error: "true"
The action outputs JSON via ${{ steps.mcp-doctor.outputs.result }} for downstream processing.
JSON Output
All commands support --json for structured output โ useful for CI pipelines, dashboards, or scripting:
mcp-doctor doctor --json | jq '.summary'
{
"servers": 3,
"healthy": 2,
"securityIssues": 1,
"avgLatencyMs": 45
}
Supported Tools
| Tool | Config Auto-Detected |
|---|---|
| Claude Code | โ |
| Claude Desktop | โ |
| Cursor | โ |
| VS Code | โ |
| Windsurf | โ |
mcp-doctor reads each tool's config file from its standard location and merges all discovered servers into a single view.
What It Checks
- Connection health โ JSON-RPC
initializehandshake against every server - Security issues โ plaintext secrets, tokens in args, dangerous shell commands
- Latency benchmarks โ round-trip timing with fast / ok / slow ratings
Install
# Run directly (no install needed)
npx @wigu/mcp-doctor scan
# Or install globally
npm install -g @wigu/mcp-doctor
mcp-doctor scan
Requires Node.js 18+.
Contributing
Contributions are welcome! Open an issue or submit a pull request.
- Fork the repo
- Create a feature branch (
git checkout -b my-feature) - Commit your changes
- Open a PR