DeepSource MCP Server

by sapientpants

990 downloads
Not rated
GitHub

About

Model Context Protocol (MCP) server for DeepSource

Details

Author
sapientpants
Downloads
990
Categories
Other

- Integrates with DeepSource via GraphQL API
- Implements the Model Context Protocol for AI assistants
- Retrieves project lists, issues, and analysis runs
- Supports pagination and filtering of results
- Built with TypeScript for type safety
- Runs on Linux, macOS, and Windows

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name DeepSource MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install via npm (npx deepsource-mcp-server@1.1.0) or run the Docker image (sapientpants/deepsource-mcp-server). Provide your DeepSource API key as the environment variable DEEPSOURCE_API_KEY. Configure the server in your AI assistant’s MCP client, e.g., by adding a deepsource entry to claude_desktop_config.json with the appropriate command and environment variable.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "deepsource mcp server": {
            "deepsource": {
                "command": "docker",
                "args": [
                    "run",
                    "-i",
                    "--rm",
                    "-e",
                    "DEEPSOURCE_API_KEY",
                    "sapientpants/deepsource-mcp-server"
                ],
                "env": {
                    "DEEPSOURCE_API_KEY": "your-deepsource-api-key"
                }
            }
        }
    }
}

McpServers

{
    "deepsource": {
        "command": "docker",
        "args": [
            "run",
            "-i",
            "--rm",
            "-e",
            "DEEPSOURCE_API_KEY",
            "sapientpants/deepsource-mcp-server"
        ],
        "env": {
            "DEEPSOURCE_API_KEY": "your-deepsource-api-key"
        }
    }
}

DeepSource MCP Server

CI
DeepSource
DeepSource
DeepSource
npm version
npm downloads
License

A Model Context Protocol (MCP) server that integrates with DeepSource to provide AI assistants with access to code quality metrics, issues, and analysis results.

Overview

The DeepSource MCP Server enables AI assistants to interact with DeepSource's code quality analysis capabilities through the Model Context Protocol. This integration allows AI assistants to:

Retrieve code metrics and analysis results
Access and filter issues
Check quality status
Analyze project quality over time

Features

DeepSource API Integration: Connects to DeepSource via GraphQL API
MCP Protocol Support: Implements the Model Context Protocol for AI assistant integration
TypeScript/Node.js: Built with TypeScript for type safety and modern JavaScript features
Cross-Platform: Works on Linux, macOS, and Windows
Robust Error Handling: Comprehensive error handling for network, authentication, and parsing issues

Usage with Claude Desktop

1. Edit claude_desktop_config.json:
- Open Claude Desktop
- Go to Settings -> Developer -> Edit Config
- Add the one of the configurations below to the mcpServers section

2. Restart Claude Desktop to apply the changes

Docker

{
  "mcpServers": {
    "deepsource": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DEEPSOURCE_API_KEY",
        "sapientpants/deepsource-mcp-server"
      ],
      "env": {
        "DEEPSOURCE_API_KEY": "your-deepsource-api-key"
      }
    }
  }
}

NPX

{
  "mcpServers": {
    "deepsource": {
      "command": "npx",
      "args": [
        "-y",
        "deepsource-mcp-server@1.1.0"
      ],
      "env": {
        "DEEPSOURCE_API_KEY": "your-deepsource-api-key"
      }
    }
  }
}

Available Tools

The DeepSource MCP Server provides the following tools:

1. deepsource_projects: List all available DeepSource projects
Parameters:
No required parameters

2. deepsource_project_issues: Get issues from a DeepSource project
Parameters:
projectKey (required) - The unique identifier for the DeepSource project
offset (optional) - Number of items to skip for pagination
first (optional) - Number of items to return (defaults to 10)
after (optional) - Cursor for forward pagination
before (optional) - Cursor for backward pagination
last (optional) - Number of items to return before the 'before' cursor (default: 10)

3. deepsource_project_runs: List analysis runs for a DeepSource project
Parameters:
projectKey (required) - The unique identifier for the DeepSource project
offset (optional) - Number of items to skip for pagination
first (optional) - Number of items to return (defaults to 10)
after (optional) - Cursor for forward pagination
before (optional) - Cursor for backward pagination
last (optional) - Number of items to return before the 'before' cursor (default: 10)

4. deepsource_run: Get a specific analysis run by its runUid or commitOid
Parameters:
runIdentifier (required) - The runUid (UUID) or commitOid (commit hash) to identify the run

Development

1. Clone the repository:

git clone https://github.com/sapientpants/deepsource-mcp-server.git
cd deepsource-mcp-server

2. Install dependencies:

pnpm install

3. Build the project:

pnpm run build

4. Configure Claude Desktop

{
"mcpServers": {
"deepsource": {
"command": "node",
"args": [
"/path/to/deepsource-mcp-server/dist/index.js"
],
"env": {
"DEEPSOURCE_API_KEY": "your-deepsource-api-key"
}
}
}
}

Prerequisites

Node.js 20 or higher
pnpm 10.7.0 or higher
Docker (for container builds)

Scripts

pnpm run build - Build the TypeScript code
pnpm run start - Start the server
pnpm run dev - Start the server in development mode
pnpm run test - Run tests
pnpm run lint - Run ESLint
pnpm run format - Format code with Prettier

License

MIT

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.