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.
Sourcebot can be deployed in seconds using the official Docker image:
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
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
http://localhost:3000
The Docker command performs several important functions:
.sourcebot
cacheThe 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"
]
}
}
}
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"
]
}
}
}
To access private repositories, you'll need to provide authentication credentials. Refer to the official documentation for detailed instructions.
Once installed, you can search through your indexed repositories using the web interface at http://localhost:3000
. The search supports:
function
function file:\.js$
function repo:sourcebot
function file:\.js$ repo:sourcebot
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.
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.
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"
]
}
}
}
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.
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.