Sourcebot MCP server

Enables code search across multiple repository hosts including GitHub, GitLab, Gitea, Gerrit, and Bitbucket with advanced filtering options for exploring large codebases through natural language queries.
Back to servers
Setup instructions
Provider
Taqla Inc.
Release date
May 09, 2025
Language
Go
Stats
2.9K stars

Sourcebot is a self-hosted tool that helps you understand your codebase through AI-powered queries and comprehensive code search capabilities. It allows you to ask natural language questions about your code and provides detailed answers with inline citations, while also offering powerful search functionality across all your repositories.

Installation

Sourcebot can be deployed quickly using Docker Compose. Here's how to get started:

Prerequisites

  • Docker and Docker Compose installed on your system
  • Access to repositories you want to index

Setup Steps

  1. Download the docker-compose.yml file:
curl -o docker-compose.yml https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/docker-compose.yml
  1. Create a configuration file in the same directory:
touch config.json
echo '{
    "$schema": "https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json",
    "connections": {
        "starter-connection": {
            "type": "github",
            "repos": [
                "sourcebot-dev/sourcebot"
            ]
        }
    }
}' > config.json
  1. Update any secrets or configuration settings in the docker-compose.yml file

  2. Start Sourcebot:

docker compose up
  1. Access the Sourcebot interface by navigating to http://localhost:3000 in your web browser

Configuration

Basic Configuration

The config.json file controls Sourcebot's behavior, including:

  • Which repositories to index
  • Language model providers
  • Authentication settings
  • Additional features

Repository Connection

You can configure Sourcebot to connect to various code hosting platforms:

{
  "connections": {
    "my-github-connection": {
      "type": "github",
      "repos": [
        "username/repo-name",
        "organization/another-repo"
      ]
    }
  }
}

Advanced Configuration

For more detailed configuration options, including:

  • Connecting to different LLM providers
  • Setting up authentication
  • Customizing search behavior

Visit the configuration documentation.

Usage

Asking Questions About Your Code

Once Sourcebot is running and has indexed your repositories, you can:

  1. Navigate to the main interface
  2. Type natural language questions about your codebase
  3. Receive detailed answers with inline citations and code references

Example questions:

  • "How is authentication implemented?"
  • "What's the data flow in the login process?"
  • "Explain the error handling in the API routes"

Code Search

Sourcebot provides powerful search capabilities:

  • Search across all repositories and branches
  • Use regular expressions
  • Apply repository and language filters
  • Leverage boolean logic (AND, OR, NOT)

Code Navigation

Navigate your code with IDE-like features:

  • Go to definition
  • Find references
  • Explore function and class relationships

File Explorer

Browse all files in your repositories with:

  • Syntax highlighting
  • File tree navigation
  • Code navigation tools

Disabling Telemetry

Sourcebot collects anonymous usage data by default. To disable telemetry:

Set the environment variable SOURCEBOT_TELEMETRY_DISABLED to true in your docker-compose.yml file:

environment:
  - SOURCEBOT_TELEMETRY_DISABLED=true

For more information about Sourcebot, visit the official documentation or try the public demo.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "sourcebot" '{"command":"docker","args":["run","-p","3000:3000","--pull=always","--rm","-v","${workspaceFolder}:/data","-e","CONFIG_PATH=/data/config.json","--name","sourcebot","ghcr.io/sourcebot-dev/sourcebot:latest"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "sourcebot": {
            "command": "docker",
            "args": [
                "run",
                "-p",
                "3000:3000",
                "--pull=always",
                "--rm",
                "-v",
                "${workspaceFolder}:/data",
                "-e",
                "CONFIG_PATH=/data/config.json",
                "--name",
                "sourcebot",
                "ghcr.io/sourcebot-dev/sourcebot:latest"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "sourcebot": {
            "command": "docker",
            "args": [
                "run",
                "-p",
                "3000:3000",
                "--pull=always",
                "--rm",
                "-v",
                "${workspaceFolder}:/data",
                "-e",
                "CONFIG_PATH=/data/config.json",
                "--name",
                "sourcebot",
                "ghcr.io/sourcebot-dev/sourcebot:latest"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later