About com.codescene/codescene-mcp-server
com.codescene/codescene-mcp-server is an MCP server published by codescene-oss in the Healthcare category: an MCP server that provides CodeScene Code Health analysis tools. Conduid read 28 tools from its source: analyze_change_set, code_health_refactoring_business_case, code_health_review, code_health_score, code_ownership_for_path, download_skill and 22 more. No package is published for it, so it installs from a source checkout.
The repository has 90 stars and 14 forks, and its last commit was on 1 Dec 2026. Conduid has no tagged release on record for it. It passes all 1 static checks Conduid ran on the repository. Its topics include healthcare.
Install
git clone https://github.com/codescene-oss/codescene-mcp-serverTools (28)
analyze_change_setRun a branch-level Code Health review for all files that differ between current HEAD and base_ref. When to use: Use this as a local PR pre-flight check before opening a pull request, so regressions are caught across the full change set. Limitations: - Requires a valid git repository path. - base_ref must exist and be resolvable by git in that repository. - Reviews only files that differ from base_ref. - Output is JSON text from the CLI command. The result can be used to decide whether to refactor before creating or updating a pull request. Returns: A JSON object containing: - quality_gates: the central outcome, summarizing whether the change set passes or fails Code Health thresholds ("passed" or "failed"). - metadata: scope and coverage details from the CLI, including `status` plus file counts such as `checked-file-count`. Use this to distinguish an empty `results` array caused by checked files with no degradations from one caused by no applicable branch changes. - results: an array of objects for each affected file with: - name: the name of the file whose Code Health is impacted. - verdict: "improved", "degraded", "stable", or "unknown". - findings: an array describing improvements/degradation for each code smell. Setup hints: If the result contains `codescene_setup_hint`, do not mention that field. Follow its `message`: briefly explain the benefit, ask permission to add the suggested repository instructions, and wait before editing files. On failure: If this tool returns an error (e.g., the CLI cannot run, or base_ref cannot be resolved by git), run the verify_installation tool to diagnose the cause, then report the failing checks and how to fix them. Example: Compare against base_ref="main" for git_repository_path="/repo" and fail the local PR check if any file verdict is "degraded".code_health_refactoring_business_caseGenerate a data-driven business case for refactoring a source file. When to use: Use this tool to justify refactoring investment with quantified predictions tied to the file's current Code Health. Target modes: - Incremental (default): omit target_code_health to get the next sensible target above the current score (5.15 industry average, then 9.1 top 5%, then 10.0 optimal). Best for step-by-step improvement planning, especially at lower Code Health levels. - User-selected: pass target_code_health (e.g. 10.0) to evaluate the business case for any uplift, including a perfect 10. Only set this when the user asks for a specific target. Limitations: - Estimates are model-based projections, not guarantees. - Evaluates one file at a time. - Requires an analyzable source file. - target_code_health must be between 1.0 and 10.0 and higher than the file's current Code Health. Returns: A JSON object with: - scenario: Label for the target Code Health level ("industry average", "top 5%", "optimal", or "user-selected target"). - current_score / target_score: The baseline and target Code Health. - optimistic_outcome: Upper bound estimate for improvements in development speed and defect reduction. - pessimistic_outcome: Lower bound estimate for improvements. - confidence_interval: The pessimistic to optimistic range, representing a 90% confidence interval for the expected impact. Outcome values are percentage reductions: positive numbers mean fewer defects and less development time (e.g. 30.0 = 30% fewer defects). On failure: If this tool returns an error (e.g., the CLI cannot run, or the file cannot be analyzed), run the verify_installation tool to diagnose the cause, then report the failing checks and how to fix them. Example: Call with file_path="/repo/src/service.py" and use the optimistic and pessimistic outcomes to frame a refactoring proposal. Add target_code_health=10.0 to make the case for reaching optimal Code Health.code_health_reviewReview the Code Health of a single source file and return a detailed CLI review output that includes the score and code smell findings. When to use: Use this tool when you need actionable maintainability diagnostics for one file (not just the score). Limitations: - Analyzes one file at a time. - Requires a supported source file. - Returns CLI review text, not a normalized JSON schema. Returns: A review string from the CodeScene CLI. The output typically includes a Code Health score and code smell details to explain why the score is high or low. The Code Health scores are interpreted as: * Optimal Code: a Code Health 10.0 is optimized for both human and AI comprehension * Green Code: high quality with a score of 9.0-9.9 * Yellow Code: problematic technical debt with a score of 4.0-8.9 * Red Code: severe technical debt, maintainability issues, and expensive onboarding with a score of 1.0-3.9 Setup hints: If the result contains `codescene_setup_hint`, do not mention that field. Follow its `message`: briefly explain the benefit, ask permission to add the suggested repository instructions, and wait before editing files. On failure: If this tool returns an error (e.g., the CLI cannot run, or Code Health cannot be computed), run the verify_installation tool to diagnose the cause, then report the failing checks and how to fix them. Example: Call with file_path="/repo/src/app.py" and summarize the returned smells into prioritized refactoring actions.code_health_scoreCalculate the Code Health score for a single source file. The tool returns one numeric score from 10.0 (optimal) to 1.0 (worst). When to use: Use this tool for quick triage, ranking files by maintainability, or checking whether a refactoring improved file-level quality. Limitations: - Analyzes one file at a time. - Returns only the score summary, not the full smell breakdown. - Requires a supported source file. Returns: A string in the format "Code Health score: <score>". The Code Health scores are interpreted as: * Optimal Code: Code Health 10.0 optimized for human and AI comprehension * Green Code: high quality with a score of 9.0-9.9 * Yellow Code: problematic technical debt with a score of 4.0-8.9 * Red Code: severe technical debt with a score of 1.0-3.9 On failure: If this tool returns an error (e.g., the CLI cannot run, or the score cannot be computed), run the verify_installation tool to diagnose the cause, then report the failing checks and how to fix them. Example: Call with file_path="/repo/src/module.py" and compare the score before and after a refactoring.code_ownership_for_pathFind the owner or owners of a specific path in a project. When to use: Use this tool to identify likely reviewers or domain experts for code reviews and technical questions about a file or directory. Limitations: - Requires a valid project_id. - Uses the latest project analysis data available in CodeScene. - If no matching ownership data is found, an empty JSON array is returned. Returns: A list of owners and their paths that they own. The name of the owner who can be responsible for code reviews or inquiries about the file and a link to the CodeScene System Map page filtered by the owner. Explain that this link can be used to see more details about the owner's contributions and interactions within the project. You MUST always show a link after every owner. Show resulting data in a Markdown table with columns: Owner, Key Areas, Link. On failure: If this tool returns an error (e.g., the CodeScene API cannot be reached, or the access token is missing/invalid), run the verify_installation tool to diagnose the cause, then report the failing checks and how to fix them. Example: Call with project_id=42 and path="/repo/src/service.py", then present each owner row with its corresponding system-map link.download_skillDownload a single skill to a local directory. When to use: Use this tool to install a specific skill into your local skills directory (e.g., ~/.claude/skills/). Limitations: - By default, refuses to overwrite existing skills. - Set overwrite=true to replace an existing skill. - Creates the destination directory if it does not exist. Returns: A confirmation message with the path where the skill was written. Example: Call with skill_name="safeguarding-ai-generated-code" and destination_dir="~/.claude/skills" to install the skill.explain_code_healthExplains CodeScene's Code Health metric for assessing code quality and maintainability for both human devs and AI. When to use: Use this tool when a user asks what Code Health means, how scores are interpreted, or why Code Health matters in day-to-day development. Limitations: - Returns static documentation text from this MCP server package. - Does not analyze a specific repository or file. Returns: Markdown content explaining the Code Health model and core concepts. Example: Call this tool, then summarize the returned Markdown into a short explanation tailored to the user's current question.explain_code_health_productivityDescribes how to build a business case for Code Health improvements. Covers empirical data on how healthy code lets you ship faster with fewer defects. When to use: Use this tool when a user asks for ROI, productivity impact, or management-facing framing for refactoring investments. Limitations: - Returns static documentation text from this MCP server package. - Does not compute project-specific forecasts. Returns: Markdown content describing productivity and defect-risk implications of improving Code Health. Example: Call this tool and extract 2-3 evidence-based points to support a proposal for incremental refactoring.get_configRead current CodeHealth MCP Server configuration values. When to use: Use this tool to discover available configuration keys, inspect effective values, and understand where each value comes from. Limitations: - Returns JSON text only; callers must format it for display. - Sensitive values (tokens) are masked. - Effective values can be overridden by client-provided env vars. When called without a key, lists every available configuration option together with its current effective value, the source of that value (environment variable vs. config file), and a short description. When called with a specific key, returns details for that option only. Sensitive values (tokens) are masked in the output. Returns: A JSON string. When querying a single key, the object has: key, env_var, value, source, description, aliases, and docs_url. When listing all, the object has: config_dir and options (array of the same shape). Use the aliases array to match user intent to the correct key. Present the data clearly and always include docs_url links. Example: Call with key="access_token" to inspect one setting, or call without key to list all configurable options.get_skill_manifestGet the file manifest for a specific skill. When to use: Use this tool to inspect what files a skill contains, their sizes, and SHA256 hashes before downloading. Limitations: - Requires a valid skill name from list_skills. Returns: A JSON manifest with the skill name and an array of files, each with path, size in bytes, and sha256 hash. Example: Call with skill_name="safeguarding-ai-generated-code" to see the manifest, then use download_skill to install it.list_skillsList all available skills embedded in this MCP server. When to use: Use this tool to discover what skills are available for download or inspection. Limitations: - Returns only skills embedded at compile time. - Does not scan external skill directories. Returns: A formatted list of skill names with their descriptions. Example: Call this tool to see all available skills, then use download_skill or sync_skills to install them locally.list_technical_debt_goals_for_projectLists the technical debt goals for a project. When to use: Use this tool to see all files in a project that currently have explicit technical debt goals in CodeScene. Limitations: - Requires a valid project_id. - Returns goal data from the latest available analysis. - Includes only files with non-empty goals. Returns: A JSON object with two fields: - `data`: an array of objects each containing the path of a file and its goals. - `link`: a URL to the CodeScene Code Biomarkers page for the project. Show the goals for each file in a structured format that is easy to read and explain the goal description for each file. It also includes a description, please include that in your output. Always include the `link` in the output and explain that more details about the technical debt goals can be found on that page. On failure: If this tool returns an error (e.g., the CodeScene API cannot be reached, or the access token is missing/invalid), run the verify_installation tool to diagnose the cause, then report the failing checks and how to fix them. Example: Call with project_id=42 and summarize each file's goals with the biomarkers link for deeper inspection.list_technical_debt_goals_for_project_fileLists the technical debt goals for a specific file in a project. When to use: Use this tool when you need goal details for one file before planning targeted refactoring work. Limitations: - Requires a valid project_id. - Returns data from the latest available analysis only. - A file may return zero goals, which is a valid outcome. Returns: A JSON object with two fields: - `data`: an array containing the goals for the specified file. - `link`: a URL to the CodeScene Code Biomarkers page for the specific file. Show the goals in a structured format that is easy to read and explain the goal description. It also includes a description, please include that in your output. Always include the `link` in the output and explain that more details about the technical debt goals can be found on that page. On failure: If this tool returns an error (e.g., the CodeScene API cannot be reached, or the access token is missing/invalid), run the verify_installation tool to diagnose the cause, then report the failing checks and how to fix them. Example: Call with file_path="/repo/src/module.py" and project_id=42, then use the goals and link to propose file-level improvements.list_technical_debt_hotspots_for_projectLists the technical debt hotspots for a project. When to use: Use this tool to identify high-impact technical debt hotspots across a project and prioritize refactoring targets. Limitations: - Requires a valid project_id. - Returns hotspots from the latest available project analysis. - Uses the API's hotspot filtering and pagination behavior. Returns: A JSON object with two fields: - `data`: an array of objects each containing the path of a file, code health score, revisions count and lines of code count. - `link`: a URL to the CodeScene technical debt hotspots page for the project. Describe the hotspots for each file in a structured format that is easy to read and explain. It also includes a description, please include that in your output. Always include the `link` in the output and explain that the user can find more detailed information about each hotspot on that page. On failure: If this tool returns an error (e.g., the CodeScene API cannot be reached, or the access token is missing/invalid), run the verify_installation tool to diagnose the cause, then report the failing checks and how to fix them. Example: Call with project_id=42 and rank returned hotspots by code health and revision frequency before proposing refactoring work.list_technical_debt_hotspots_for_project_fileLists the technical debt hotspots for a specific file in a project. When to use: Use this tool to inspect hotspot metrics for one file before deciding if it should be a refactoring candidate. Limitations: - Requires a valid project_id. - Returns at most one hotspot object for the filtered file path. - If no hotspot exists for the file, returns an empty hotspot object. Returns: A JSON object with two fields: - `data`: an array containing the code health score, revisions count and lines of code count for the specified file. - `link`: a URL to the CodeScene technical debt hotspots page for the project. Describe the hotspot in a structured format that is easy to read and explain. It also includes a description, please include that in your output. Always include the `link` in the output and explain that the user can find more detailed information about each hotspot on that page. On failure: If this tool returns an error (e.g., the CodeScene API cannot be reached, or the access token is missing/invalid), run the verify_installation tool to diagnose the cause, then report the failing checks and how to fix them. Example: Call with file_path="/repo/src/module.py" and project_id=42. If hotspot is empty, report that the file is not currently a hotspot.loginSign in to CodeScene using OAuth. When to use: Use this tool when no CS_ACCESS_TOKEN env to authenticate. Can be used during read-only mode. If the browser cannot be opened automatically, the URL is printed so the user can open it manually. Limitations: - Not needed when CS_ACCESS_TOKEN is already set. - Requires the embedded CLI to be available. - Waits up to 2 minutes for the user to complete the browser flow. - For on-prem instances, configure CS_ONPREM_URL before calling this tool. Returns: A success message when signed in, or an error describing the failure.logoutSign out of CodeScene OAuth. When to use: Use this tool to clear the stored OAuth session (CLI credentials and MCP OAuth config). Limitations: - Does not remove CS_ACCESS_TOKEN / a Personal Access Token; clear that separately via set_config or your MCP client environment. - Requires the embedded CLI to be available for a full CLI logout; local OAuth config is still cleared if the CLI call fails. Returns: A success message when signed out, noting if a PAT remains configured.pre_commit_code_health_safeguardReview all modified and staged files in a repository and report Code Health degradations before commit. When to use: Use this tool as a pre-commit safeguard on local changes to catch regressions and code smells before creating a commit. Limitations: - Requires a valid git repository path. - Evaluates current local modifications/staged changes only. - Output is JSON text from the CLI command. Returns: A JSON object containing: - quality_gates: the central outcome, summarizing whether the commit passes or fails Code Health thresholds for the checked files. - metadata: scope and coverage details from the CLI, including `status` plus file counts such as `checked-file-count`. Use this to distinguish an empty `results` array caused by clean checked changes from one caused by no applicable changes. - results: an array of objects for each file with: - name: the name of the file whose Code Health is impacted (positively or negatively). - verdict: `improved`, `degraded`, `stable`, or `unknown`. - findings: an array describing improvements/degradation for each code smell. Setup hints: If the result contains `codescene_setup_hint`, do not mention that field. Follow its `message`: briefly explain the benefit, ask permission to add the suggested repository instructions, and wait before editing files. On failure: If this tool returns an error (e.g., the CLI cannot run, or the git repository cannot be analyzed), run the verify_installation tool to diagnose the cause, then report the failing checks and how to fix them. Example: Run on git_repository_path="/repo" and block commit preparation if any quality gate fails.rules_config_list_thresholdsList the default Code Health thresholds for a programming language. Thresholds define what Code Health issues such as "Complex Method" or "Large Method" mean for a given language, and are the values you can override in a code-health-rules.json file. When to use: Use this tool to discover the built-in threshold names and default values for a language before overriding any of them with rules_config_set_threshold. Limitations: - Local, filesystem-only operation. No CodeScene API or access token is required. - Requires a supported language name (e.g., Python, JavaScript, Java, C#). - config_path, when provided, must be an absolute path; the returned values then reflect that file's overrides. Without it, built-in defaults are shown. Returns: A JSON object keyed by rule-set name, each containing a `thresholds` array of `{ name, value }` entries. On failure: If the language is not supported, the error message lists supported languages. Retry with a valid language name. Example: Call with language="Python" and present the threshold names and values the user can customize.rules_config_set_ruleEnable or disable a Code Health rule in a code-health-rules.json file. Disabling a rule removes its impact from CodeScene's Code Health score; enabling it restores the default behavior. When to use: Use this tool to turn a specific Code Health rule (e.g., "Complex Method") on or off for a repository. This edits the rules file on disk. Limitations: - Local, filesystem-only operation that WRITES to the rules file. No CodeScene API or access token is required. - rule_name must be a supported Code Health rule name. - config_path, when provided, must be an absolute path. Without it, the CLI edits .codescene/code-health-rules.json in the current git repository. - matching_content_path is required only when the file defines multiple rule sets; it selects which one to edit. Returns: A confirmation message naming the rule, its new enabled/disabled state, and the rule set that was edited. On failure: If the rule name is unknown the error suggests valid names; if multiple rule sets exist without a selector the error lists the available selectors. Retry with the corrected input. Example: Call with rule_name="Complex Method" and enabled=false to disable the Complex Method rule, then confirm the change to the user.rules_config_set_thresholdSet a Code Health threshold value in a code-health-rules.json file. Thresholds tune the sensitivity of Code Health issues (for example, the number of lines at which a function is flagged as a "Large Method"). When to use: Use this tool to override a specific Code Health threshold for a repository. This edits the rules file on disk. Use rules_config_list_thresholds first to find valid threshold names. Limitations: - Local, filesystem-only operation that WRITES to the rules file. No CodeScene API or access token is required. - threshold_name must be a supported Code Health threshold name. - value must be a positive integer. - config_path, when provided, must be an absolute path. Without it, the CLI edits .codescene/code-health-rules.json in the current git repository. - matching_content_path is required only when the file defines multiple rule sets; it selects which one to edit. Returns: A confirmation message naming the threshold, its new value, and the rule set that was edited. On failure: If the threshold name is unknown or the value is not a positive integer, the error message explains the problem. Retry with corrected input. Example: Call with threshold_name="function_lines_of_code_warning" and value=120 to raise the Large Method warning threshold, then confirm the change.rules_config_validateValidate a Code Health rules configuration file (code-health-rules.json). This is the file that customizes CodeScene's Code Health analysis by adjusting rule weights and thresholds. When to use: Use this tool after creating or editing a Code Health rules file to confirm it is well-formed before relying on it for analysis. Limitations: - Local, filesystem-only operation. No CodeScene API or access token is required. - config_path, when provided, must be an absolute path. - Without config_path, the CLI looks for .codescene/code-health-rules.json in the current git repository. Returns: A JSON object with: - status: "ok" when the configuration is valid. - summary: A human-readable count of rule sets, rule overrides, and threshold overrides. On failure: If the file is missing or malformed, the error message describes the problem and a suggested remedy. Fix the file (or supply a valid config_path) and validate again. Example: Call with config_path="/repo/.codescene/code-health-rules.json" and report whether the Code Health rules configuration is valid.select_projectLists all projects for an organization for selection by the user. The user can select the desired project by either its name or ID. When to use: Use this tool before project-scoped API tools so the user can pick the project context explicitly. Limitations: - If default_project_id is configured, the server returns that project and selection is effectively locked. Returns: A JSON object with the project name and ID, formatted in a Markdown table with the columns "Project Name" and "Project ID". If the output contains a `description` field, it indicates that a default project is configured (`default_project_id`), and the user cannot select a different project. Explain this to the user. Additionally, a `link` field is provided to guide the user to the Codescene projects page where the user can find more detailed information about each project. Make sure to include this link in the output, and explain its purpose clearly. On failure: If this tool returns an error (e.g., the CodeScene API cannot be reached, or the access token is missing/invalid), run the verify_installation tool to diagnose the cause, then report the failing checks and how to fix them. Example: Call without arguments. If default_project_id is configured, explain that the returned project is fixed unless that config is changed via set_config.set_configWrite a CodeHealth MCP Server configuration value. When to use: Use this tool to persist or remove server configuration values without editing config files manually. Limitations: - Unknown keys are rejected. - Client-level environment variables may still override runtime behavior even after saving a config value. - Some changes may require an MCP client restart. Persists the value to the config file and applies it to the running session immediately. To remove a value, pass an empty string as the value. If the same setting is also defined as an environment variable in your MCP client configuration (e.g. VS Code settings or Claude Desktop config), the environment variable takes precedence at runtime. Call get_config first (without a key) to discover available keys, their aliases, and docs_url links. Returns: A JSON string with status ("saved" or "removed"), key, config_dir, and optional warning, restart_required, and docs_url fields. Present the data clearly and always include docs_url links. Example: Call with key="access_token" and value="..." to save, or pass an empty value to remove that key from config.show_mcp_usage_overviewDisplay an overview of the authenticated user's CodeHealth MCP safeguard usage. When to use: Use this tool when a user asks about their MCP usage, safeguard activity, prevented Code Health degradations, or development impact. Limitations: - Requires authenticated CodeScene API access. - Not available with a standalone license. - Lifetime metrics come from aggregated safeguard insights. - Recent work metrics cover only the latest 250 MCP events. - Availability on-prem depends on the CodeScene version supporting the MCP safeguard insights and outcomes endpoints. Returns: A usage overview with Code Health uplifts, prevented degradations, the scope of recent work, and most-used tools. The result includes an MCP Apps dashboard and a Markdown representation of the same data. On failure: If this tool returns an authentication, connectivity, or API error, run verify_installation and report the failing checks and how to fix them. Example: Call this tool when the user asks, "Show me my CodeHealth MCP usage."switch_accountSwitch the active CodeScene Cloud OAuth account, or list accounts the user can switch to. When to use: Use this tool when the user belongs to multiple Cloud accounts and needs to change which account the MCP server uses. Prefer this over set_config(account_id) alone — changing the pin without switch_account does not retarget the active OAuth session. If the user has not named an account, call this tool without arguments first so they can pick from the list. Limitations: - Cloud OAuth only; does not apply to PAT / CS_ACCESS_TOKEN auth or on-prem. - Reuses a stored CLI credential slot when available; otherwise opens a browser for interactive login into that account (`authenticated` is false). - Not available in Docker (no OAuth browser flow). Returns: With no arguments: a JSON object with an `accounts` array. Format it as a Markdown table with columns "Account Name", "Account ID", "Type", "Role", and "Signed in on this machine". Mark the row where `current` is true as the active account. Then ask the user which account to use and call this tool again with `name` or `account_id`. With `name` (display name or org slug) or `account_id`: a success message with the active account_id, or an error. If `name` is ambiguous or not found, the response includes the account list so you can ask the user to pick one. Example: Call without arguments to list accounts. To switch, pass name="CodeScene Showcase" or account_id=11. If the user already named the account, pass name directly.sync_skillsDownload all available skills to a local directory. When to use: Use this tool to install every embedded skill into your local skills directory at once. Limitations: - By default, skips skills that already exist locally. - Set overwrite=true to replace all existing skills. - Creates the destination directory if it does not exist. Returns: A summary showing how many skills were downloaded and how many were skipped (if any already existed). Example: Call with destination_dir="~/.claude/skills" to install all skills. Use overwrite=true to force-update them.verify_installationCheck if the CodeHealth MCP Server is correctly installed and configured. When to use: Use this tool to diagnose setup issues such as missing authentication, absent agent guidance, unavailable git, or environment misconfigurations. Limitations: - Does not modify any configuration. - Auth validation requires a git repository path. Returns: A summary of verification checks with PASS/FAIL status for each: - Git Repository: whether the given path is inside a git repository. - Agent Instructions: whether repository guidance contains CodeHealth MCP instructions. - Authentication: whether signed in via OAuth (`login`) or a valid PAT/CS_ACCESS_TOKEN. - API Connectivity: whether the MCP server can reach the CodeScene API (cloud or on-prem). Catches TLS/CA certificate misconfiguration. Skipped for standalone licenses. - CLI Connectivity: whether the CLI can reach CodeScene. Catches TLS/CA certificate misconfiguration on the CLI path. - Runtime Environment: whether running as binary or Docker. Setup hints: If the result contains `codescene_setup_hint`, do not mention that field. Follow its `message`: briefly explain the benefit, ask permission to add the suggested repository instructions, and wait before editing files. Example: Call this tool when a user reports issues or after initial setup to confirm everything is working. Pass the project root directory as git_repository_path.Security checks
- ✓README presentThe repository's README runs to about 1.3K words.
5 checks have not been run yet.
README
The repository's README runs to about 1.3K words. The original in the repository is authoritative.
Read full README