Quick Start Guide: Running CodeScene's MCP Server with Claude 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 with Claude Code.

Authentication made easy with OAuth

The latest version of the CodeScene MCP Server supports OAuth authentication.

This means you no longer need to manually create, copy, and configure a CodeScene access token for every developer.

For most users, OAuth is the recommended way to authenticate. Simply sign in to CodeScene when prompted and the MCP Server will handle authentication for you.

Important: OAuth does not require any configuration on the CodeScene server. Do not confuse this with CodeScene SSO configuration, no SSO configuration is required to use OAuth with the MCP Server.

OAuth makes it significantly easier to roll out CodeScene MCP across a development team, since each developer can authenticate with their own CodeScene account without having to manually manage access tokens.

Installation

Step 1: Install the Latest MCP Server

Download and install the latest version of the CodeScene MCP Server.

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

Homebrew Installation

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 Installation

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.

Important: Make sure you are using the latest version of the MCP Server to use OAuth authentication.

Step 2: Add CodeScene MCP to Claude Code

Add the CodeScene MCP Server to Claude Code:

claude mcp add codescene -- cs-mcp

For CodeScene On-Premise, include your CodeScene URL:

claude mcp add codescene --env CS_ONPREM_URL=<your-onprem-url> -- cs-mcp

You don't need to add an access token when using OAuth.

Step 3: Sign in to CodeScene

Once the MCP Server has been added, start Claude Code and ask it to log in to CodeScene:

Log me in to CodeScene

Claude Code will start the CodeScene authentication flow and open your browser.

Complete the sign-in in your browser. Once authentication is complete, Claude Code can use CodeScene MCP with your CodeScene account.

Using multiple CodeScene Cloud accounts

If you belong to more than one CodeScene Cloud account, you may need to specify which account you want to use.

Set your CodeScene Account ID by asking Claude Code:

Set my CodeScene account ID to 123

Replace 123 with your CodeScene Account ID.

Where do I find my Account ID?

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

It is the numeric account identifier shown in your account details. It is not an SSO configuration value.

You only need to specify the Account ID if you belong to multiple CodeScene Cloud accounts.

Alternative authentication: Personal Access Token

OAuth is the recommended authentication method for interactive use.

A Personal Access Token (PAT) can still be used when OAuth isn't suitable—for example:

  • CI/CD pipelines

  • Headless environments

  • Automated workflows

  • Environments without browser access

  • Scenarios where a static credential is preferred

Create a Personal Access Token

For CodeScene Cloud, create a token from your CodeScene account.

For CodeScene On-Premise, your administrator or CodeScene instance may provide a token through the appropriate user configuration page.

Configure the token with Claude Code

For the native binary:

export CS_ACCESS_TOKEN="<your token here>" claude mcp add codescene --env CS_ACCESS_TOKEN=$CS_ACCESS_TOKEN -- cs-mcp

For CodeScene On-Premise:

export CS_ACCESS_TOKEN="<your token here>" export CS_ONPREM_URL="<your onprem url>" claude mcp add codescene \ --env CS_ACCESS_TOKEN=$CS_ACCESS_TOKEN \ --env CS_ONPREM_URL=$CS_ONPREM_URL \ -- cs-mcp

Important: If CS_ACCESS_TOKEN is configured, the MCP Server will use the access token rather than your OAuth session.

Step 4: See Your Engineering Partner in Action

Once you're authenticated, choose a file in your project and ask Claude Code to run a Code Health analysis.

For example:

Run a Code Health analysis on this file.

You can also ask Claude Code to:

  • Explain the Code Health of the file.

  • Identify the most important issues to address.

  • Make a business case for refactoring.

  • Refactor the file to improve its Code Health.

  • Re-analyse the file to verify the improvement.

For example, you can ask:

Refactor this file to improve its Code Health score.

The MCP Server provides Claude with CodeScene's code health context and analysis tools, while Claude performs the actual code changes.

Important: Always review AI-generated changes before committing them.

You're ready to go

Claude Code now has access to CodeScene's Code Health intelligence, allowing it to understand your project's maintainability and help safeguard AI-generated code.

With OAuth, there is no need to manually create and distribute access tokens to individual developers. This makes CodeScene MCP much easier to roll out across your development team.

✅ 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.