mcp-doctor
Diagnose, secure, and benchmark your MCP servers. Zero-config CLI for Claude Code, Cursor, VS Code, and Windsurf.
Documentation
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 doctorThat'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 serveThis 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 `initialize` handshake 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 scanRequires Node.js 18+.
Contributing
Contributions are welcome! Open an issue or submit a pull request.
1. Fork the repo
2. Create a feature branch (`git checkout -b my-feature`)
3. Commit your changes
4. Open a PR
License
Frequently asked questions
What is mcp-doctor?
mcp-doctor is Diagnose, secure, and benchmark your MCP servers. Zero-config CLI for Claude Code, Cursor, VS Code, and Windsurf.
How do I install mcp-doctor?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is mcp-doctor open source?
Yes — it is hosted on GitHub at https://github.com/realwigu/mcp-doctor and has 3 stars.
Related MCP tools
The go-to web for your AI coding agent — local-first search, fetch, crawl & research over MCP. No API keys, no cloud, $0/query. Public beta.
Open-source cross-agent memory layer for coding agents via MCP. Compatible with Claude Code, Codex, Cursor, Windsurf, Gemini CLI, Antigravity, OpenClaw, Hermes Agent, Oh-my-Pi, Pi, Copilot, Kiro, OpenCode, and Trae.
AI Skills, MCP Tools, and CLI for Unity Engine. Full AI develop and test loop. Use cli for quick setup. Efficient token usage, advanced tools. Any C# method may be turned into a tool by a single line. Works with Claude Code, Gemini, Copilot, Cursor and any other absolutely for free.
MCP server that enables AI assistants to interact with Google Gemini CLI, leveraging Gemini's massive token window for large file analysis and codebase understanding
Cut AI token costs 95%+ on code exploration. The leading MCP server for precise, symbol-level GitHub code retrieval via tree-sitter AST. Works with Claude Code, Cursor & any MCP client. 313B+ tokens saved.
AI-powered OSINT agent with interactive REPL, MCP server, and CLI. 19 tools. Works with Claude, GPT-4, or local models. For authorized security research only.
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP