codescene-mcp-server
UnexploredAn MCP server that provides CodeScene Code Health analysis tools.
Install
Terminal
$npx -y @codescene/codehealth-mcpmcp_config.json
{
"mcpServers": {
"com-codescene-codescene-mcp-server": {
"args": [
"-y",
"@codescene/codehealth-mcp"
],
"command": "npx"
}
}
}Documentation
CodeHealth MCP Server
The CodeHealth MCP Server exposes CodeScene's Code Health analysis as local AI-friendly tools.
This server is designed to run in your local environment and lets AI assistants (like GitHub Copilot, Cursor, Claude code, etc.) request meaningful Code Health insights directly from your codebase. The Code Health insights augment the AI prompts with rich content around code quality issues, maintainability problems, and technical debt in general.
The repository also includes a downloadable set of public agent skills in skills/ for teams that want to reuse CodeHealth MCP workflows in their own agentic pipelines.
Getting Started with CodeHealth MCP
Want AI to perform the setup? Start with skills/installing-and-activating-codehealth-mcp/SKILL.md.
- Setting up Authentication to the MCP Server — see Authentication.
- Install the MCP Server using one of the installation options below.
- Add the MCP Server to your AI assistant. See the detailed instructions for your environment in the installation guide.
- Copy the agent guidance that matches your license into your repository: AGENTS-full.md for CodeScene Core users, AGENTS-standalone.md for standalone license users, or .amazonq/rules for Amazon Q. Also copy any relevant public skills for reusable workflow prompts.
- Explore the available tools to see what the MCP Server can do and which tools are available for your license.
Installation
Choose the installation method that works best for your platform.
NPM / npx (macOS, Linux, Windows)
Run the MCP server directly with npx (no install needed):
npx @codescene/codehealth-mcp
Or install globally:
npm install -g @codescene/codehealth-mcp
The first run automatically downloads the correct platform-specific binary for your system and caches it for future use. Requires Node.js 18 or later.
📖 Full installation & integration guide
Claude Code
Add the CodeScene marketplace and install the plugin:
/plugin marketplace add codescene-oss/codehealth-mcp
/plugin install codescene@codescene
This installs the MCP server and Code Health skills. Requires Node.js 18 or later.
Claude Desktop
Download the MCP bundle from the latest release page:
codehealth-mcp-{version}.mcpb
Then open the .mcpb file with Claude Desktop to install the MCP server.
VS Code
The CodeHealth MCP is available as a VS Code extension:
Kiro (IDE / CLI)
Recommended — install the Kiro power: The CodeScene Code Health power bundles the MCP server and the public skills, and Kiro manages the server for you. In the IDE, open the Powers panel, choose Add Custom Power → Import power from GitHub, and enter https://github.com/codescene-oss/codehealth-mcp/tree/main/kiro-power. To install from a local clone instead, choose Import power from a folder and select the kiro-power directory. Node.js 18 or later is required. Then ask Kiro to "Log me in to CodeScene".
Manual MCP configuration: Kiro can also launch CodeHealth MCP locally over stdio using either npx or an installed binary. No remote MCP URL or Kiro oauth configuration is needed.
Choose a configuration scope:
- Workspace:
.kiro/settings/mcp.jsonin your project, for project-specific or shared team configuration. - User:
~/.kiro/settings/mcp.json, for all your workspaces.
Both the IDE and CLI use these files. If the same server name appears in both, the workspace entry takes precedence. Merge the codescene entry into any existing mcpServers object rather than replacing your other servers.
Option 1 — npx (requires Node.js 18 or later):
{
"mcpServers": {
"codescene": {
"command": "npx",
"args": ["-y", "@codescene/codehealth-mcp"],
"disabled": false
}
}
}
The first run downloads and caches the platform-specific binary. The -y flag prevents an interactive npm installation prompt.
Option 2 — installed binary:
After installing via Homebrew, the Windows installer, or manual download, use:
{
"mcpServers": {
"codescene": {
"command": "cs-mcp",
"args": [],
"disabled": false
}
}
}
If Kiro cannot find the executable, set command to its absolute path (cs-mcp.exe on Windows). Escape Windows backslashes in JSON, for example C:\\tools\\cs-mcp.exe.
CLI alternative: Instead of editing JSON, register the server from your project directory:
kiro-cli mcp add --name codescene --command "npx -y @codescene/codehealth-mcp" --scope workspace
kiro-cli mcp list
Use --scope global for user-level configuration, or --command cs-mcp for an installed binary.
Custom agents: You can also define the same mcpServers object directly in an agent configuration under .kiro/agents/ or ~/.kiro/agents/. Agent entries override workspace and user entries with the same server name. Set "includeMcpJson": true to inherit servers from the shared MCP configuration files, and include "@codescene" in the agent's tools list if you restrict tool access. See Kiro's agent configuration reference.
Connect and authenticate:
- In the IDE, open the Command Palette and run Kiro: Open workspace MCP config (JSON) or Kiro: Open user MCP config (JSON). Save the configuration, then check the MCP servers tab in the Kiro panel. In CLI chat, use
/mcpto check the connection. - Ask Kiro to "Log me in to CodeScene" so it calls the server's
logintool and opens the browser sign-in flow. For standalone tokens, PATs, or on-prem instances, see Authentication. - Verify with a request such as "Use CodeHealth MCP to review
/absolute/path/to/source-file.rs."
For token-based authentication, add "env": { "CS_ACCESS_TOKEN": "${CS_ACCESS_TOKEN}" } to the server entry and make the variable available to Kiro. In the IDE, approve its expansion when prompted or add it to Mcp Approved Env Vars. Never commit credentials. Leave CS_ACCESS_TOKEN unset when using OAuth login.
Tool calls remain subject to Kiro's permissions; review tools before adding any to autoApprove. For configuration details and troubleshooting, see the Kiro MCP documentation and our Configuration Options.
Homebrew (macOS / Linux)
brew tap codescene-oss/codehealth-mcp https://github.com/codescene-oss/codehealth-mcp
brew trust codescene-oss/codehealth-mcp
brew install cs-mcp
📖 Full installation & integration guide
Windows
For VS Code / GitHub Copilot, the CodeHealth MCP extension bundles and automatically configures the server without a separate PowerShell installation.
Run this in PowerShell:
irm https://raw.githubusercontent.com/codescene-oss/codehealth-mcp/main/install.ps1 | iex
After installing, fully quit and reopen your AI assistant or IDE (including all VS Code windows) so it picks up the updated PATH, then configure the MCP server using the guide below. Restarting only the MCP server or an integrated terminal does not refresh VS Code's PATH. The guide also includes a VS Code configuration that uses the executable path directly and avoids this PATH requirement.
📖 Full installation & integration guide
Manual Download
Download the latest binary for your platform from the GitHub Releases page:
- macOS:
cs-mcp-macos-aarch64.zip(Apple Silicon) orcs-mcp-macos-amd64(Intel) - Linux:
cs-mcp-linux-aarch64.ziporcs-mcp-linux-amd64 - Windows:
cs-mcp-windows-amd64.exe
After downloading, make it executable and optionally add it to your PATH:
chmod +x cs-mcp-*
mv cs-mcp-* /usr/local/bin/cs-mcp
You can also build a static executable from source.
Docker
[!WARNING] The Docker distribution is being retired. From October 1 through December 31, 2026, Docker images will be released only for bug fixes. No Docker images will be released after December 31, 2026. Migrate to NPM / npx, Homebrew, the Windows installer, or another installation option above.
docker pull codescene/codescene-mcp
📖 Full installation & integration guide | Build the Docker image locally
Use Cases
[!TIP] Watch the demo video of the CodeHealth MCP.
[!NOTE] CodeHealth MCP comes with a set of example prompts, agent guidance files to capture the key use cases, and a downloadable set of public skills. Copy the agent guidance that matches your license — AGENTS-full.md for CodeScene Core users or AGENTS-standalone.md for standalone users — and any relevant skills to your own repository.
With the CodeHealth MCP Server in place, your AI tools can:
Safeguard AI-Generated Code
Prevent AI from introducing technical debt by flagging maintainability issues like complexity, deep nesting, low cohesion, etc.
Uplift Unhealthy Code for AI Readiness
AI refactoring quality improves when code is modular and easy to reason about. The MCP server gives your assistant concrete guidance to get there:
- run focused Code Health reviews,
- identify the specific design issues to address,
- refactor in small, measurable steps, and
- verify progress with updated Code Health scores.
This workflow works with MCP alone and is often enough to safely improve legacy code.
Make Targeted Refactoring
AI tools can refactor code, but they lack direction on what to fix and how to measure if it helped.
The Code Health tools solve this by giving AI assistants precise insight into design problems, as well as an objective way to assess the outcome: did the Code Health improve?
Understand Existing Code Before Acting
Use Code Health reviews to inform AI-driven summaries, diagnostics, or code transformations based on real-world cognitive and design challenges, not just syntax.
Review MCP Safeguard Impact
Ask your AI assistant to show your MCP usage overview to see Code Health uplifts, prevented degradations, and the scope and quality of your latest 250 MCP events. Supported clients display an interactive dashboard; other clients receive a Markdown summary. This API-connected feature requires a CodeScene Core account and is not available with a standalone license. See show_mcp_usage_overview for details.
Frequently Asked Questions
Do I need a CodeScene account to use the MCP?
The full feature set — including hotspots, technical debt goals, and code ownership — requires a CodeScene subscription. Authenticate by asking your AI Assistant to login to CodeScene, or use the login too. Alternatively, use your CodeScene instance to create the CS_ACCESS_TOKEN which activates the MCP.
The MCP supports both CodeScene Cloud and CodeScene on-prem.
For local Code Health analysis without a CodeScene subscription, you can use the standalone CodeHealth MCP.
How does the MCP Server keep my code private and secure?
The CodeHealth MCP Server runs fully locally. All analysis — including Code Health scoring, delta reviews, and business-case calculations — is performed on your machine, against your local repository. No source code or analysis data is sent to cloud providers, LLM vendors, or any external service.
Analysis results (e.g. hotspots and technical debt goals) are fetched via REST from your own CodeScene account using a secure token.
For complete details, please see CodeScene's full privacy and security documentation.
Can I use any LLM as the backbone for CodeHealth MCP?
CodeHealth MCP can work with any model your AI assistant supports, but we strongly recommend choosing a frontier model when your assistant offers a model selector (as in tools like GitHub Copilot).
Frontier models -- such as Claude Sonnet -- deliver far better rule adherence and refactoring quality, while legacy models like GPT-4.1 often struggle with MCP constraints. For a consistent, high-quality experience, select the newest available model.
I have multiple repos — how do I configure the MCP?
Since you have to provide a mount path for Docker, you can either have a MCP configuration per project (in VS Code that would be a .vscode/mcp.json file per project, for example) or you can mount a root directory within which all your projects are and then just use that one configuration instead.
Why does IntelliJ give a wrong path to the MCP server?
In our testing we've seen that IntelliJ's AI Assistant sometimes gives a wrong path to the CodeHealth MCP server. From what we can tell, it seems to have nothing to do with the MCP server itself, but rather with IntelliJ's AI Assistant, which seems to hallucinate parts of the path some of the time. We're still investigating this issue and will update this section once we have more information.
How do I configure custom SSL certificates?
If your organization uses an internal CA (Certificate Authority), set the REQUESTS_CA_BUNDLE environment variable to point to your CA certificate file (PEM format). The MCP server automatically configures SSL — you only need to set it once.
The MCP also supports SSL_CERT_FILE and CURL_CA_BUNDLE as alternatives.
For detailed configuration examples (including Docker certificate mounting), see Configuration Options — SSL/TLS.
How do I disable the version update check?
The MCP server periodically checks GitHub for newer releases and shows a "VERSION UPDATE AVAILABLE" banner when your version is outdated. This check runs in the background and never blocks tool responses, but in network-restricted environments you may want to disable it entirely.
Set the CS_DISABLE_VERSION_CHECK environment variable to any non-empty value (e.g. 1). For setup details, see Configuration Options — Version Check.
Building from Source
The MCP server is written in Rust. To build from source:
cargo build --release
The binary is produced at target/release/cs-mcp.
For more details, see:
Sourced from the repository README.
More in Developer Tools
- N8nFair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.202,280
- Gemini CliAn open-source AI agent that brings the power of Gemini directly into your terminal.106,664
- World MonitorLive global intelligence: real-time markets, conflicts, country risk, chokepoints, energy. 39 tools.84,026
- WorldmonitorReal-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface84,024
- Scrapling🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!76,275
- Ruflo🌊 The original agent meta-harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, RAG integration, and native Claude Code / Codex / Hermes and many more Integrated69,270