Launch Sourcebot
http://localhost:3000
) is passed to the MCP server via the SOURCEBOT_HOST
url.If a host is not provided, then the server will fallback to using the demo instance hosted at https://demo.sourcebot.dev. You can see the list of repositories indexed here. Add additional repositories by opening a PR.Create an API key
SOURCEBOT_API_KEY
environment variable.Install the MCP server
Cursor
Settings
-> Cursor Settings
-> MCP
-> Add new global MCP server
Paste the following into your ~/.cursor/mcp.json
file. This will install Sourcebot globally within Cursor:http://localhost:3000
with wherever your Sourcebot instance is hosted.Windsurf
Windsurf Settings
-> Cascade
-> Add Server
-> Add Custom Server
Paste the following into your mcp_config.json
file:http://localhost:3000
with wherever your Sourcebot instance is hosted.VS Code
http://localhost:3000
with wherever your Sourcebot instance is hosted.Claude Code
http://localhost:3000
with wherever your Sourcebot instance is hosted.Claude Desktop
claude_desktop_config.json
:http://localhost:3000
with wherever your Sourcebot instance is hosted.Prompt the LLM
use sourcebot
when prompting.search_code
query
.
Parameters:
Name | Required | Description |
---|---|---|
query | yes | Regex pattern to search for. Escape special characters and spaces with a single backslash (e.g., ‘console.log’, ‘console\ log’). |
filterByRepoIds | no | Restrict search to specific repository IDs (from ‘list_repos’). Leave empty to search all. |
filterByLanguages | no | Restrict search to specific languages (GitHub linguist format, e.g., Python, JavaScript). |
caseSensitive | no | Case sensitive search (default: false). |
includeCodeSnippets | no | Include code snippets in results (default: false). |
maxTokens | no | Max tokens to return (default: env.DEFAULT_MINIMUM_TOKENS). |
list_repos
get_file_source
Name | Required | Description |
---|---|---|
fileName | yes | The file to fetch the source code for. |
repoId | yes | The Sourcebot repository ID. |
Name | Default | Description |
---|---|---|
SOURCEBOT_HOST | http://localhost:3000 | URL of your Sourcebot instance. |
SOURCEBOT_API_KEY | - | Sourcebot API key. |
DEFAULT_MINIMUM_TOKENS | 10000 | Minimum number of tokens to return in responses. |
DEFAULT_MATCHES | 10000 | Number of code matches to fetch per search. |
DEFAULT_CONTEXT_LINES | 5 | Lines of context to include above/below matches. |