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
Provider
Taqla Inc.
Release date
May 09, 2025
Language
Go
Stats
1.9K stars

Sourcebot is an open source code search tool that allows you to index and search across multiple repositories and code hosts. With its blazingly fast interface powered by the Zoekt search engine, you can quickly find code across GitHub, GitLab, Bitbucket, Gitea, or Gerrit repositories.

Installation

Sourcebot can be deployed in seconds using the official Docker image:

Quick Start

  1. Create a configuration file:
touch config.json
echo '{
    "$schema": "https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json",
    "connections": {
        // Comments are supported
        "starter-connection": {
            "type": "github",
            "repos": [
                "sourcebot-dev/sourcebot"
            ]
        }
    }
}' > config.json
  1. Run the Docker container:
docker run \
  -p 3000:3000 \
  --pull=always \
  --rm \
  -v $(pwd):/data \
  -e CONFIG_PATH=/data/config.json \
  --name sourcebot \
  ghcr.io/sourcebot-dev/sourcebot:latest
  1. Access the web interface at http://localhost:3000

Understanding the Docker Command

The Docker command performs several important functions:

  • Pulls and runs the latest Sourcebot image
  • Maps port 3000 between your machine and the container
  • Mounts your current directory to allow Sourcebot to persist the .sourcebot cache
  • Clones the sourcebot repository and indexes it into a searchable format
  • Starts the web server on port 3000

Configuration

Basic Configuration

The config.json file defines which repositories to index. The basic structure is:

{
    "$schema": "https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json",
    "connections": {
        "connection-name": {
            "type": "github|gitlab|bitbucket|gitea|gerrit",
            "repos": [
                "owner/repo"
            ]
        }
    }
}

Adding Multiple Repositories

You can add multiple repositories from different sources:

{
    "connections": {
        "github-repos": {
            "type": "github",
            "repos": [
                "sourcebot-dev/sourcebot",
                "another-org/another-repo"
            ]
        },
        "gitlab-repos": {
            "type": "gitlab",
            "repos": [
                "group/project"
            ]
        }
    }
}

Private Repositories

To access private repositories, you'll need to provide authentication credentials. Refer to the official documentation for detailed instructions.

Usage

Searching Code

Once installed, you can search through your indexed repositories using the web interface at http://localhost:3000. The search supports:

  • Regular text search
  • Regular expressions
  • File path filtering
  • Repository filtering

Search Syntax Examples

  • Basic search: function
  • Search in specific file types: function file:\.js$
  • Search in specific repositories: function repo:sourcebot
  • Combine filters: function file:\.js$ repo:sourcebot

Telemetry

Sourcebot collects anonymous usage data by default. No sensitive data is collected, but if you'd like to disable this, set the SOURCEBOT_TELEMETRY_DISABLED environment variable to true:

docker run \
  -p 3000:3000 \
  --pull=always \
  --rm \
  -v $(pwd):/data \
  -e CONFIG_PATH=/data/config.json \
  -e SOURCEBOT_TELEMETRY_DISABLED=true \
  --name sourcebot \
  ghcr.io/sourcebot-dev/sourcebot:latest

For more information on telemetry, visit the telemetry documentation.

Additional Resources

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

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

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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