What it checks
Everything clippy doesn't.
LINTS
700+
Clippy lints
Severity overrides across pedantic, nursery, and cargo groups.
AST
19
Custom rules
Error handling, performance, architecture, security, async, and framework anti-patterns via syn.
DEPS
5
Cargo tools
cargo-audit, cargo-deny, cargo-geiger, cargo-machete, cargo-semver-checks.
FRAMEWORKS
3
Runtime targets
tokio, axum, actix-web — blocking in async, missing handlers, spawn without move.
External tools are optional — missing ones are skipped gracefully. Run rust-doctor --install-deps to install them all at once.
Scoring
One number. Zero ambiguity.
Weighted across 5 dimensions (Security ×2, Reliability ×1.5, Maintainability, Performance, Dependencies). Per dimension: 100 − errors ×1.5 − warnings ×0.75 − info ×0.25. Counts unique rules, not occurrences — fix one issue entirely and the penalty disappears.
75–100
Great
50–74
Needs work
0–49
Critical
MCP Server
Built for AI coding assistants.
rust-doctor includes a built-in Model Context Protocol server. Claude Code, Cursor, VS Code — any MCP-compatible tool can scan your project, explain rules, and suggest fixes.
scanFull diagnostics + health score
scoreQuick 0–100 pass/fail
explain_ruleRule docs + fix guidance
list_rulesBrowse all available checks
Install
Pick your method.
npx
npx -y rust-doctor@latest .cargo
cargo install rust-doctorMCP
claude mcp add --transport stdio -s user rust-doctor -- npx -y rust-doctor --mcpSkill
npx skills add https://github.com/ArthurDEV44/rust-doctor --skill rust-doctorGitHub Actions
- uses: ArthurDEV44/rust-doctor@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
fail-on: warningRules
19 custom AST rules.
Error Handling
unwrap-in-productionError Handling
panic-in-libraryError Handling
box-dyn-error-in-public-apiError Handling
result-unit-errorPerformance
excessive-clonePerformance
string-from-literalPerformance
collect-then-iteratePerformance
large-enum-variantPerformance
unnecessary-allocationArchitecture
high-cyclomatic-complexitySecurity
hardcoded-secretsSecurity
unsafe-block-auditSecurity
sql-injection-riskAsync
blocking-in-asyncAsync
block-on-in-asyncFramework
tokio-main-missingFramework
tokio-spawn-without-moveFramework
axum-handler-not-asyncFramework
actix-blocking-handler| Category | Rule | Severity |
|---|---|---|
| Error Handling | unwrap-in-production | Warning |
| Error Handling | panic-in-library | Error |
| Error Handling | box-dyn-error-in-public-api | Warning |
| Error Handling | result-unit-error | Warning |
| Performance | excessive-clone | Warning |
| Performance | string-from-literal | Info |
| Performance | collect-then-iterate | Warning |
| Performance | large-enum-variant | Warning |
| Performance | unnecessary-allocation | Warning |
| Architecture | high-cyclomatic-complexity | Warning |
| Security | hardcoded-secrets | Error |
| Security | unsafe-block-audit | Warning |
| Security | sql-injection-risk | Error |
| Async | blocking-in-async | Error |
| Async | block-on-in-async | Error |
| Framework | tokio-main-missing | Error |
| Framework | tokio-spawn-without-move | Error |
| Framework | axum-handler-not-async | Warning |
| Framework | actix-blocking-handler | Warning |
FAQ