mcp-doctor is a diagnostic tool for MCP (Model Context Protocol) servers, provided as a zero-configuration CLI. As MCP servers gradually become the backbone of AI-assisted development, an increasing number of servers brings some hard-to-notice problems: servers going down are only discovered when a tool call fails, hardcoded secrets leak from configuration files, slow-responding servers drag down the entire AI workflow, and configuration inconsistencies between different tools cause settings that work in Cursor to fail in Claude Desktop. mcp-doctor aims to quickly check all servers across all tools with a single command.
Main capabilities
- Connection health check: Perform a JSON-RPC initialize handshake with all MCP servers to verify whether the servers respond.
- Security audit: Check for plaintext secrets in configuration, tokens in parameters, dangerous shell commands, and overly broad permissions.
- Latency benchmark: Measure the JSON-RPC round-trip latency of each configured server and give a fast / ok / slow rating.
- Configuration discovery and merging: Automatically read configuration files from the standard locations of each tool and merge the discovered servers into a single view.
Usage
mcp-doctor requires no configuration and automatically finds servers. It supports the following commands:
- doctor: Full check, running scan, security, and bench at once and printing a summary (recommended).
- scan: Test connections to all MCP servers, discover configurations, and verify that each server responds to the JSON-RPC handshake.
- security: Audit configurations for security issues, checking for leaked secrets, overly broad permissions, and risky command patterns.
- bench: Measure JSON-RPC round-trip latency for each configured server and perform benchmarking.
All commands support the --json parameter for outputting machine-readable structured results, suitable for CI pipelines, dashboards, or scripts.
MCP server mode
mcp-doctor itself can also run as an MCP server, exposing scan, security, bench, and doctor as tools that AI assistants can call directly. When invoked without arguments and stdin is piped, it automatically starts server mode with stdio transport; it can alsobe run explicitly. This means AI assistants can diagnose their own MCP infrastructure on demand.
Using in CI
In CI, mcp-doctor can be used to automatically catch broken servers and leaked secrets; the action outputs JSON via ${{ steps.mcp-doctor.outputs.result }} for downstream processing.
Supported tools
Supports Claude Code, Cursor, VS Code, Windsurf, and Claude Desktop. mcp-doctor reads configuration files from the standard locations of each tool and merges all discovered servers.
Runtime requirements
Requires Node.js 18+.
Contributing
Contributions are welcome: submit an issue or pull request. Create a feature branch (git checkout -b my-feature), commit changes.