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.

The fastest and recommended way to get started in VS Code is to install the CodeScene CodeHealth MCP extension and sign in using OAuth.

The extension bundles the CodeScene MCP Server and automatically configures it, so there is no need to manually download the MCP Server, edit mcp.json, or create an access token for each developer.

Recommended: Install the CodeScene VS Code Extension

Step 1: Install the extension

Install the CodeScene CodeHealth MCP extension from the VS Code Marketplace:

Install CodeScene CodeHealth MCP

The extension automatically installs and registers the CodeScene MCP Server and includes the correct binary for your operating system and architecture. Once installed, the CodeScene MCP tools are available in Agent mode in Copilot Chat.

Step 2: Configure your CodeScene account

For most users, no additional configuration is required.

Multiple CodeScene Cloud accounts

If you belong to multiple CodeScene Cloud accounts, set your CodeScene Account ID before signing in.

In VS Code:

  1. Open Settings.

  2. Search for codescene.accountId.

  3. Enter your CodeScene Account ID.

Your Account ID is the number shown under "My Account" in CodeScene Cloud.

Important: This is your CodeScene account/tenant ID. It is not an SSO configuration value.

If you only belong to one CodeScene Cloud account, you can skip this step.

CodeScene On-Premise

If you are using CodeScene On-Premise, set your CodeScene instance URL before signing in.

In VS Code:

  1. Open Settings.

  2. Search for codescene.onpremUrl.

  3. Enter the URL of your CodeScene On-Premise instance.

For example:

https://codescene.example.com

Important: OAuth does not require any configuration on the CodeScene server. Do not confuse this with CodeScene SSO configuration.

Step 3: Sign in with OAuth

OAuth is the recommended authentication method for interactive use.

You can start the CodeScene login flow in any of the following ways:

Option 1: Use the login prompt

In Copilot Chat, open the MCP prompt picker and select:

login

The prompt will start the CodeScene OAuth login flow.

Option 2: Use the Command Palette

Open the VS Code Command Palette:

Shift + Command + P on Mac
Ctrl + Shift + P on Windows/Linux

Select:

CodeScene: Sign In

Your browser will open and you'll be asked to sign in to CodeScene.

Complete the authentication in your browser.

Option 3: Ask Copilot

Open Copilot Chat in Agent mode and ask:

Log me in to CodeScene

Copilot will call the CodeScene login tool and start the OAuth authentication flow.

Once authentication is complete, you're ready to use CodeScene.

Step 4: Start using CodeScene

Open a file in your project and switch Copilot Chat to Agent mode.

You can now ask Copilot to use CodeScene's CodeHealth tools.

For example:

Run a Code Health analysis on this file.

You can also ask Copilot to:

  • Explain the Code Health of a file.

  • Identify the most important code smells to address.

  • Review a file and suggest improvements.

  • Build a business case for refactoring.

  • Refactor a file to improve its Code Health.

  • Check your changes for Code Health regressions before committing.

For example:

Refactor this file to improve its Code Health score, then re-analyse it to verify the improvement.

The MCP Server provides the CodeScene CodeHealth context and tools, while the AI assistant performs the actual code changes.

Important: Always review AI-generated changes before committing them

Alternative: Install the MCP Server manually

The VS Code extension is the recommended installation method for most users.

If you prefer to install and manage the MCP Server yourself, you can download the latest binary instead.

Manual Download

Download the latest version from the CodeScene MCP Server GitHub Releases page.

Available binaries include:

  • 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

Homebrew

You can also install the MCP Server using Homebrew:

brew tap codescene-oss/codescene-mcp-server https://github.com/codescene-oss/codescene-mcp-server brew install cs-mcp

After installation, the cs-mcp command will be available in your PATH.

PowerShell

On Windows, you can install the latest version using PowerShell:

irm https://raw.githubusercontent.com/codescene-oss/codescene-mcp-server/main/install.ps1 | iex

This downloads the latest version to %LOCALAPPDATA%\Programs\cs-mcp and adds it to your PATH.

Configure the manually installed server in VS Code

If you install the MCP Server manually, open the VS Code Command Palette:

Shift + Command + P on Mac
Ctrl + Shift + P on Windows/Linux

Select:

MCP: Open User Configuration

Add the CodeScene MCP Server to your mcp.json:

{

  "servers": {

    "codescene": {

      "type": "stdio",

      "command": "cs-mcp"

    }

  }

}

Save the file.

You can then use the same OAuth login flow described above.

Alternative authentication: Personal Access Token

OAuth is the recommended authentication method for interactive use.

With OAuth, developers don't need to manually create, copy, or configure an access token.

A Personal Access Token (PAT) is still available for scenarios such as:

  • CI/CD pipelines

  • Headless environments

  • Automated workflows

  • Environments without browser access

  • Situations where a static credential is preferred

If a PAT is configured, it takes precedence over OAuth.

For more information, see the CodeScene MCP authentication documentation.

You're good to go

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