# Codehealth MCP

> Codehealth MCP is an open-source agent skill for developer tools. Gives your agent CodeScene structural Code Health reviews, score deltas and commit gates. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/smartworldarafath/REA_Skill/tree/main/.agents/skills/codehealth-mcp
- **Repository:** https://github.com/smartworldarafath/rea_skill
- **GitHub stars:** 66
- **License:** MIT
- **Skill name:** codehealth-mcp
- **Collection:** https://github.com/smartworldarafath/REA_Skill
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

This skill tells an AI coding agent how to use the CodeScene MCP server to measure design-level maintainability of code, going beyond style and lint checks. Before an agent edits a file, it runs a full Code Health review to record a baseline score and the code smells listed. After each change it re-scores the same file and treats any drop as a regression to fix before the task is considered done.

The workflow also covers repository gates. Before a commit the agent runs a pre-commit safeguard to block changes that introduce Code Health regressions, and before opening a pull request it runs a change-set analysis against the base branch. Scores are read on a 1 to 10 scale, and the skill sets how cautiously the agent should refactor depending on the score range.

The MCP server is configured through a CodeScene access token that the user supplies, and the setup uses the npx package for the standalone server. Only the four standalone tools are used, so no paid CodeScene platform account is needed. The tools analyze files and git state in the local repository the user points them at, and the skill advises against using it on secrets or paths that should not be analyzed. If the server is unavailable, the agent is told to report the check as skipped rather than estimate a score.

## When your agent uses it

> Real-time structural Code Health via CodeScene MCP — review before edits, verify score deltas after changes, gate commits and PRs. Use when reviewing code quality, refactoring, checking if AI changes degraded a file, or before commit/PR.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/smartworldarafath/REA_Skill/tree/HEAD/.agents/skills/codehealth-mcp)
- [License: MIT](https://github.com/smartworldarafath/REA_Skill/tree/HEAD/.agents/skills/codehealth-mcp)

## Features

- **Pre-edit health review:** Runs a full structural analysis on a target file to record a baseline score and listed code smells before changes begin.
- **Post-change score checks:** Re-scores the edited file after each change and compares it with the baseline to catch regressions.
- **Commit safeguard:** Runs a pre-commit check that blocks changes introducing Code Health regressions.
- **Branch change-set analysis:** Analyzes the branch against its base before a pull request is opened.
- **Score-based refactor limits:** Scales how broad a refactor may be according to the file's score range on a 1 to 10 scale.
- **Offline fallback rules:** Tells the agent to report the check as skipped instead of inventing scores when the MCP server is unavailable.

## Good for

- Review a legacy module for maintainability before changing it
- Check whether an AI-generated diff degraded the health of a file
- Run a structural check before committing refactored code
- Verify Code Health on a branch before opening a pull request
- Refactor a low-scoring file with a narrow, score-guided scope

## Install

### Claude Code

This skill ships in the `rea-skills` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add smartworldarafath/REA_Skill
/plugin install rea-skills@smartworldarafath
```

Or copy only this skill to `~/.claude/skills/codehealth-mcp`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/codehealth-mcp &&
cp -R "$tmp/.agents/skills/codehealth-mcp" ~/.claude/skills/codehealth-mcp &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/codehealth-mcp` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/codehealth-mcp` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/codehealth-mcp &&
cp -R "$tmp/.agents/skills/codehealth-mcp" ~/.agents/skills/codehealth-mcp &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/codehealth-mcp` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/codehealth-mcp` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/codehealth-mcp &&
cp -R "$tmp/.agents/skills/codehealth-mcp" ~/.cursor/skills/codehealth-mcp &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/codehealth-mcp` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/smartworldarafath/REA_Skill.git --path .agents/skills/codehealth-mcp
```

Or copy the folder to `~/.gemini/skills/codehealth-mcp` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/codehealth-mcp`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/codehealth-mcp &&
cp -R "$tmp/.agents/skills/codehealth-mcp" ~/.copilot/skills/codehealth-mcp &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/codehealth-mcp` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git
```

Then copy `REA_Skill/.agents/skills/codehealth-mcp` into your agent's skills folder as `codehealth-mcp`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does Codehealth MCP need to run?

It needs the CodeScene MCP server, installed through npx as @codescene/codehealth-mcp, and a CS_ACCESS_TOKEN that the user sets personally. The standalone tools do not require a paid CodeScene platform account.

### Does Codehealth MCP change my code automatically?

No. The skill directs the agent to review and score files and to run gates. It does not make edits on its own, and the tools run only when invoked.

### Which tools does Codehealth MCP use?

It uses code_health_review, code_health_score, pre_commit_code_health_safeguard and analyze_change_set. Platform-only tools such as repository-wide hotspot lists are not used.

### What happens if the MCP server is down?

The agent should not invent scores. It tells the user the check was skipped and continues only with explicit approval, preferring lint and tests for gating in the meantime.

### Does Codehealth MCP work with ECC bundled MCP servers automatically?

No. The codescene entry in the ECC configuration is a template, and the user must copy it into their own config if they want it enabled.

### How do I install Codehealth MCP in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/codehealth-mcp to use it in all your projects, or to .claude/skills/codehealth-mcp in one project. Or install the rea-skills plugin, which includes it: /plugin marketplace add smartworldarafath/REA_Skill, then /plugin install rea-skills@smartworldarafath.

### Does Codehealth MCP run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Codehealth MCP?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Codehealth MCP?

The closest alternatives to Codehealth MCP are Codebase memory MCP, MCP implementation security review, Code review expert, Harness review and Code quality analysis.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Codebase memory MCP](https://ai-powered.com/skills/codebase-memory-mcp): Codebase memory MCP is an open-source agent skill for knowledge and memory.
- [MCP implementation security review](https://ai-powered.com/skills/mcp-implementation-security-review): MCP implementation security review is an open-source agent skill for security.
- [Code review expert](https://ai-powered.com/skills/code-review-expert): Code review expert is an open-source agent skill for developer tools.
- [Harness review](https://ai-powered.com/skills/harness-review-chachamaru127): Harness review is an open-source agent skill for developer tools.
- [Code quality analysis](https://ai-powered.com/skills/code-quality-analysis): Code quality analysis is an open-source agent skill for developer tools.
- [MCP release QA](https://ai-powered.com/skills/mcp-release-qa): MCP release QA is an open-source agent skill for developer tools.
- [Code review](https://ai-powered.com/skills/code-review): Code review is an open-source agent skill for developer tools.
- [Thermo nuclear code quality review](https://ai-powered.com/skills/thermo-nuclear-code-quality-review-michael-denyer): Thermo nuclear code quality review is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/codehealth-mcp
