Building an MCP server is easy. Knowing whether it actually works, won't confuse the model, and isn't a security hole is the hard part. mcp-doctor launches your server, runs the full handshake, introspects everything it exposes, and reports problems — with a real exit code for CI.
$ mcp-doctor -- python -m my_server mcp-doctor -> my-server 0.1.0 protocol 2024-11-05 | 27 tools, 3 resources, 0 prompts ERROR [prompt-injection] A tool description contains override-style language… ERROR [missing-description] Tool 'helper' has no description… WARN [tool-bloat] 27 tools exposed. Selection accuracy degrades past ~20… WARN [dangerous-tool] Tool 'run_shell' looks like it executes commands… FAIL 2 error(s), 2 warning(s).
Every check maps to a real, reported failure mode when running MCP servers with Claude and other agents — not hypotheticals.
initialize handshakeEverything after -- is how you launch your server over stdio. It's run as an argument list, never through a shell.
pipx install mcp-doctor
Or pip install mcp-doctor. Zero runtime dependencies — nothing to break your environment.
mcp-doctor -- python -m my_server
Works with any stdio server — node build/index.js, a binary, whatever launches it.
echo $?
0 when clean, 1 on an error-level finding. Add --json for machine-readable output.
The official Inspector is a GUI — great for poking around, useless in CI. mcp-doctor is the command-line counterpart that fails your build when the server regresses.
- run: pipx install mcp-doctor - run: mcp-doctor -- python -m my_server # exits 1 on an error-level issue
No pro tier, no locked checks, no "contact sales." If it caught a prompt-injection string, saved you a broken CI run, or just taught you something about your own server — you can say thanks. Every donation goes straight into keeping this and the rest of the toolkit maintained and free.
0x2aed4e50cf319ad63575c54b1db8040fe90653a9
BNB Smart Chain network only.
Health, lint & security audit for MCP servers. You're here.
Persistent file-based memory for your agent.
Catch weak prompts before they ship.
Build your first MCP server in minutes.