CodeHealth MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| JAVA_HOME | No | Java runtime for PMD (else `java` on `PATH`). | |
| CODEHEALTH_NO_PMD | No | Set to `1` to not use PMD. | |
| CODEHEALTH_PMD_HOME | No | PMD `pmd-bin-*` directory (or a directory that holds one); also the `install-pmd` target. | |
| CODEHEALTH_CACHE_DIR | No | PMD cache and scratch copies (default `~/.cache/codehealth`). | |
| CODEHEALTH_PMD_TIMEOUT | No | Seconds per PMD run (default 120). |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Maintainability analysis for the ~30 languages lizard reads (Python, JavaScript, TypeScript/TSX, Java, Go, C/C++, C#, Ruby, Kotlin, Swift, Rust, PHP and more). Scores files 1-10 (Healthy >= 9, Warning >= 4, Alert < 4) and lists code smells. All paths must be absolute.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| code_health_scoreA | Score one source file for maintainability. |
| code_health_reviewA | Review one source file and list its code smells. |
| pre_commit_code_health_safeguardA | Check staged and modified files against HEAD before committing. |
| analyze_change_setA | Compare every changed file on the current branch with its merge base. |
| rules_config_validateA | Validate the repository's code health rules file. |
| rules_config_list_thresholdsA | List every threshold with its default value and source. |
| rules_config_set_ruleA | Set a rule's weight in the repository rules file (0 disables the rule). |
| rules_config_set_thresholdB | Override a threshold in the repository rules file. |
| explain_code_healthA | Explain the Code Health model, a smell, or the score bands. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 9 tools
Most tools are clearly distinct (explain vs. analyze vs. rules configuration), and the two closest pairs — code_health_score vs. code_health_review and pre_commit_code_health_safeguard vs. analyze_change_set — are separated by explicit 'when to use' framing (quick score vs. full findings; staged/HEAD vs. merge base). The score/review pair still shares nearly identical inputs and only differs in output depth, so an agent could pick the lighter tool when it needed findings.
Conventions are mixed: code_health_score and code_health_review use a noun-prefix form, explain_code_health flips to verb-first, analyze_change_set is verb_noun, pre_commit_code_health_safeguard has no verb at all, and the rules_config_* family uses a different noun_noun_verb ordering. Each name is individually readable, but there is no single predictable pattern to infer a tool from.
Nine tools is well within the ideal range and each one earns its place: two analysis entry points, two change-comparison entry points, documentation, and four rules-file operations. Nothing appears redundant or bolted on.
The surface covers the lifecycle well — score, detailed review, explanation, pre-commit gate, branch-level change analysis, and full rules read/validate/write. Gaps remain around reading back the effective repository rules (only defaults are listed) and any multi-file or directory-level scan, since analysis is one file at a time.