🩺 mcp-doctor
Offline security scanner for MCP servers.
Detects tool poisoning, credential exposure, and dangerous permissions — before you connect.
pip install mcp-doctor
mcp-doctor scan
Why
The MCP ecosystem grew to 10,000+ servers in 18 months. Most developers connect servers without any security review. Meanwhile:
- Tool poisoning hides malicious instructions in tool descriptions that the AI reads but the user never sees (MCPTox, AAAI 2026)
- 24,008 secrets were found in public MCP config files (GitGuardian, 2026)
- CVE-2025-54136 showed shared-repo MCP configs can be weaponized across teams
mcp-doctor scans your MCP configs locally and offline — nothing leaves your machine.
What it checks
| Rule | ID | Severity | What it detects |
|---|---|---|---|
| Tool Poisoning | TP-001 | CRITICAL | Hidden instructions in tool descriptions (prompt injection) |
| Unicode Concealment | TP-002 | HIGH | Invisible Unicode characters hiding payloads |
| Hardcoded Secrets | CE-001 | CRITICAL | API keys and tokens in config files |
| Secret Env Vars | CE-002 | HIGH | Literal secret values in env blocks |
| Shell Access | DP-001 | CRITICAL | Servers that grant direct shell execution |
| Broad FS Access | DP-002 | HIGH | Filesystem access to root or home directory |
| Unencrypted HTTP | TS-001 | HIGH | Non-localhost MCP connections over plain HTTP |
| Remote Endpoint | TS-002 | MEDIUM | Connections to remote servers (verify auth) |
| Unverified Package | CX-001 | MEDIUM | npx -y auto-install of unknown npm packages |
| Inline Code Exec | CX-002 | HIGH | python -c / node -e inline code execution |
| Long Argument | CX-003 | MEDIUM | Suspiciously long args (possible obfuscated payload) |
| Large Tool Surface | SC-001 | LOW | Servers exposing 25+ tools (increased attack surface) |
Usage
# Auto-detect configs (Claude Desktop, Cursor, VS Code, project-level)
mcp-doctor scan
# Scan a specific config file
mcp-doctor scan path/to/config.json
# JSON output (for CI pipelines)
mcp-doctor scan --output json
# Search a project directory for MCP configs
mcp-doctor scan --dir /path/to/project
Example output
🩺 mcp-doctor scan report
Config: ~/.config/Claude/claude_desktop_config.json
Servers scanned: 4
🔴 CRITICAL TP-001 evil-server Prompt injection in tool description
🔴 CRITICAL CE-001 leaky-server Hardcoded Anthropic API key
🔴 CRITICAL DP-001 shell-access Shell execution access
🟠 HIGH CE-002 leaky-server Secret in env: OPENAI_API_KEY
🟠 HIGH TS-001 unsafe-remote Unencrypted HTTP transport
CRITICAL 3 | HIGH 2
FAIL — critical findings require action.
CI Integration
mcp-doctor exits with code 1 when critical findings are present:
# .github/workflows/mcp-check.yml
- run: pip install mcp-doctor
- run: mcp-doctor scan --output json > mcp-report.json
Privacy
- Fully offline — no API calls, no telemetry, no data sent anywhere
- Config contents are analyzed in-process and never written to disk
- Unlike some alternatives, your tool schemas are never sent to external servers
License
MIT
Release files for mcp-hygiene 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mcp_hygiene-0.2.0.tar.gz | 15.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_hygiene-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.8 kB
Release files / mcp_hygiene-0.2.0.tar.gz
| Download URL | mcp_hygiene-0.2.0.tar.gz |
|---|---|
| Size | 15.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
edf5857b15b776ccee8b73a9a1202bd33873adb75b9cd60b2b7be91170ce3bca
|
|
BLAKE2b-256 checksum How to use checksums |
4d3ee7df22343e64e4fe79b34a3b6f830402f895cd3f44718fa532e6525f46de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.
Transparency logRelease files / mcp_hygiene-0.2.0-py3-none-any.whl
| Download URL | mcp_hygiene-0.2.0-py3-none-any.whl |
|---|---|
| Size | 19.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cddd3d732b0e0c0b7395cdf9c709cc2679c37bfe2517c338b9fa111fbd77ffef
|
|
BLAKE2b-256 checksum How to use checksums |
5df63cce902aef7b5ff809ae36e5ecaab83c68b201b3d139e14825269ed4699e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.
Transparency log