Skip to main content
Glama
Presh-AR

codescan-mcp-server

by Presh-AR

Codescan MCP Server

A Model Context Protocol (MCP) server implementation for Codescan, enabling AI models to interact with Codescan's API through a standardized interface.

Features

  • List Codescan projects

  • Get project metrics

  • Query project issues with advanced filtering

  • Environment-based configuration

  • Docker support

  • TypeScript implementation

Related MCP server: sonarqube-mcp-py

Prerequisites

  • Node.js 20 or later

  • pnpm 10.7.1 or later

  • Docker (optional, for containerized deployment)

Installation

Local Development

  1. Clone the repository:

git clone <repository-url>
cd codescan-mcp-server
  1. Install dependencies:

pnpm install
  1. Build the project:

pnpm run build
  1. Start the server:

pnpm start

Docker Deployment

  1. Build the Docker image:

docker build -t codescan-mcp-server .
  1. Run the container:

docker run -d \
  -e CODESCAN_URL=https://app.codescan.io \
  -e CODESCAN_TOKEN=your_token_here \
  -e CODESCAN_ORGANIZATION=your_org \
  -e CODESCAN_PROJECT=your_project \
  -e CODESCAN_COMPONENT=your_component \
  -e NODE_OPTIONS="--experimental-specifier-resolution=node" \
  -p 3000:3000 \
  codescan-mcp-server

Environment Variables

Variable

Description

Required

Default

CODESCAN_URL

URL of your Codescan instance

Yes

https://app.codescan.io

CODESCAN_TOKEN

Authentication token for Codescan API

Yes

-

CODESCAN_ORGANIZATION

Organization key for Codescan Cloud

No

-

CODESCAN_PROJECT

Default project key

No

-

CODESCAN_COMPONENT

Default component key

No

-

NODE_OPTIONS

Node.js runtime options

No

--experimental-specifier-resolution=node

MCP Client Configuration

Here's an example MCP client configuration for interacting with the Codescan MCP server:

{
  "name": "codescan-mcp-client",
  "version": "1.0.0",
  "description": "MCP client for Codescan integration",
  "servers": [
    {
      "name": "codescan-mcp-server",
      "url": "http://localhost:3000",
      "tools": ["projects", "metrics", "issues"]
    }
  ],
  "env": {
    "CODESCAN_URL": "https://app.codescan.io",
    "CODESCAN_TOKEN": "your_token_here",
    "CODESCAN_ORGANIZATION": "your_org",
    "CODESCAN_PROJECT": "your_project",
    "CODESCAN_COMPONENT": "your_component"
  }
}

Tool Usage Examples

  1. List Projects:

{
  "tool": "projects",
  "params": {
    "page": "1",
    "page_size": "10"
  }
}
  1. Get Metrics:

{
  "tool": "metrics",
  "params": {
    "component": "your_component",
    "page": "1",
    "page_size": "10"
  }
}
  1. Get Issues:

{
  "tool": "issues",
  "params": {
    "component": "your_component",
    "severity": "MAJOR",
    "page": "1",
    "page_size": "10",
    "statuses": ["OPEN", "CONFIRMED"],
    "types": ["BUG", "VULNERABILITY"]
  }
}

Development

Available Scripts

  • pnpm run build: Build the TypeScript code

  • pnpm start: Start the MCP server

  • pnpm test: Run tests

  • pnpm lint: Run linter

  • pnpm format: Format code

Project Structure

codescan-mcp-server/
├── src/
│   ├── index.ts        # Main server entry point
│   └── codescan.ts     # Codescan API client
├── dist/               # Compiled JavaScript
├── Dockerfile          # Docker configuration
├── package.json        # Project dependencies
├── tsconfig.json       # TypeScript configuration
└── mcp.json           # MCP server configuration

License

[License Type] - See LICENSE file for details

Available Tools

3 tools
issuesC

Get issues for a Codescan project

ParametersJSON Schema
NameRequiredDescriptionDefault
tokenNo
componentYes
severityNo
pageNo
page_sizeNo
statusesNo
resolutionsNo
resolvedNo
typesNo
rulesNo
tagsNo
created_afterNo
created_beforeNo
created_atNo
created_in_lastNo
assigneesNo
authorsNo
cweNo
languagesNo
owasp_top10No
sans_top25No
sonarsource_securityNo
on_component_onlyNo
facetsNo
since_leak_periodNo
in_new_code_periodNo

TDQS

C2.1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must disclose behavioral traits. It only says 'Get issues', which implies a read operation, but it doesn't confirm idempotency, rate limits, pagination behavior, or error handling. The description provides no meaningful behavioral context for a tool with 26 parameters.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, which is concise, but it is under-specified and lacks structure. It fails to earn its place because it does not aid correct tool invocation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the high parameter count, no output schema, and no annotations, the description is severely incomplete. It does not cover return values, filtering options, pagination, or any usage nuances.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It does not explain any of the 26 parameters. Even though some parameters have enums, their meanings are not clarified. The description adds no value beyond the parameter names.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get issues for a Codescan project' clearly states the verb and resource, and implies the context of a Codescan project. It distinguishes from siblings 'metrics' and 'projects' by naming a different resource.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'metrics' or 'projects'. There are no exclusions or context hints for usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

metricsC

Get available metrics from Codescan

ParametersJSON Schema
NameRequiredDescriptionDefault
tokenNo
pageNo
page_sizeNo
componentNo

TDQS

C2.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must convey behavioral traits. It only says 'Get available metrics', which implies a read operation but does not disclose side effects, authentication requirements, rate limits, pagination behavior, or response format. The presence of 'page' and 'page_size' parameters hints at pagination, but this is not explained.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely short (one sentence), but it lacks necessary detail. Conciseness is achieved at the cost of completeness, making it under-specified. The structure is flat and does not front-load key information beyond the basic purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given four parameters, no annotations, no output schema, and sibling tools, the description is severely incomplete. It fails to explain what the tool returns, how parameters work, or when to use it. The tool's complexity demands a richer description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description must explain parameter semantics, but it does not. It mentions none of the four parameters (token, page, page_size, component), leaving the agent to guess their purpose and format. This is a critical gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Get available metrics from Codescan', clearly indicating the verb (get) and resource (metrics). It distinguishes this tool from sibling tools 'issues' and 'projects' by referring to a different resource type. However, it does not explicitly differentiate itself from potential other metric-related tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No usage guidelines are provided. The description does not specify when to use this tool over alternatives, nor does it mention prerequisites or typical use cases. The agent is left without guidance on tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

projectsC

List all Codescan projects

ParametersJSON Schema
NameRequiredDescriptionDefault
tokenNo
pageNo
page_sizeNo
projectsNo

TDQS

C2.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description fails to disclose any behavioral traits such as authentication requirements, pagination behavior, or what happens when no projects exist.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very concise at one sentence with no wasted words, but it is overly brief and lacks necessary detail for a tool with four parameters.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has four parameters with no schema descriptions, no output schema, and no annotations, the description is severely incomplete, providing only a basic purpose.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and the description does not mention any of the four parameters (token, page, page_size, projects), leaving their meaning and usage completely unexplained.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb 'List' and resource 'Codescan projects', clearly indicating the tool's function and distinguishing it from siblings 'issues' and 'metrics'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives; the description simply states what it does without any context on when it is appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv1.1.0
    • First observedissues
    • First observedmetrics
    • First observedprojects

TDQS

C2.8/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a distinct purpose: listing projects, retrieving issues for a project, and fetching metrics. There is no overlap or ambiguity.

Naming Consistency4/5

All tool names are single nouns, which is consistent. Adding verbs (e.g., list_projects) would make them more descriptive, but the pattern is uniform.

Tool Count4/5

3 tools is a reasonable number for a focused code scanning server. It covers the core actions without being overly sparse.

Completeness3/5

The server covers listing projects, retrieving issues, and getting metrics. Missing are details on individual projects, issue filtering, or update/delete operations, but for a read-only scanner it is fairly complete.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    B
    maintenance
    An MCP server for SonarQube that enables LLM agents to discover projects, analyze code quality metrics, check Quality Gate status, search issues with filters, and rank projects by worst-performing metrics. It provides read-only, safe access to SonarQube instances with structured outputs and error handling.
    5
    51 PyPI
    MIT
  • A
    license
    C
    quality
    D
    maintenance
    A Python MCP server for SonarQube, enabling AI agents to query projects, issues, quality gates, coverage, and security hotspots.
    13
    MIT
  • F
    license
    Not graded
    quality
    A
    maintenance
    MCP server that exposes SonarQube data as AI agent tools, enabling project discovery, quality gates, measures, issues, hotspots, rule explanations, source code, and raw API access.
    4
    -