Quick Start Guide: Running CodeScene's MCP Server in VS Code

With CodeScene’s MCP Server, your AI becomes more than just a code generator, it becomes a true engineering partner that understands and protects your project’s code quality. Follow these steps to set it up in Visual Studio Code.

Installation

Step 1: Install the Latest Binary

Manual Download

Download the latest binary for your platform from the GitHub Releases page :

  • macOS: cs-mcp-macos-aarch64 (Apple Silicon) or cs-mcp-macos-amd64 (Intel)

  • Linux: cs-mcp-linux-aarch64 or cs-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

No need to run it manually, VS Code will handle that for you.

Step 2: Get your CodeScene Access Token

  1. Get a CS_ACCESS_TOKEN for the MCP Server which allows the server to access CodeScene’s code health analysis.

    • For CodeScene Cloud, create the token here: https://codescene.io/users/me/pat

    • For CodeScene on-prem, the token is available at: https://<your-cs-host>:<port>/configuration/user/token

  2. Copy the AGENTS.md file to your repository. This file guides AI agents on how to use the MCP, including rules that safeguard AI coding.

    AGENTS.md

    7.5 KB

    ℹ️ If you use Amazon Q, copy the .amazonq/rules directory instead.

Step 3: Configure your CodeScene Access Token in VS Code

  1. Open the Command Palette (Shift + Command + P on Mac, Ctrl + Shift + P on Windows/Linux).

  2. Select MCP: Open User Configuration

  3. Add the following to your mcp.json file:

    {
        "servers": {
          "codescene": {
            "command": "cs-mcp",
            "env": {
              "CS_ACCESS_TOKEN": "<your token here>"
            }
          }
        }
      }

    Example:

  4. Save the file and you are good to go!

Step 4: See your Engineering Partner in Action

  1. Simply choose a file and instruct Co-Pilot to run a code health score to see it in action for the first time.

  2. You can also ask your AI tooling to make a business case for refactoring for management to understand the business impact of improving the code health of the file:


  3. If you are ready to make an impact, ask your AI tooling to get your chosen file to a perfect code health score of 10:

✅ Success Insight: Great work! Your AI assistant now has full access to CodeScene’s code health metrics, enabling it to understand your project’s quality and safeguard AI-generated code. Explore all supported use cases in the CodeScene MCP documentation.