only available in a paid plan. Please activate a license key to use this feature.
Use cases
- Context for local agents: Plug the MCP into coding agents like Cursor, Claude Code, or Copilot to give them context across your entire codebase, not just the open workspace.
- Building autonomous AI agents: Use Sourcebot as a code context layer for multi-agent systems that review PRs, auto-fix bugs, and answer questions across the company.
Getting Started
Sourcebot MCP uses a Streamable HTTP transport hosted at the/api/mcp route. Two authorization mechanisms are supported:
- OAuth (preferred): MCP clients that support OAuth 2.0 will automatically handle the authorization flow and issue a short lived access token. No API key or manual token management required. Only available with a paid subscription.
- API key: Any MCP client can authorize using a Sourcebot API key passed as a
Authorization: Bearer <key>header. Create one in Settings → API Keys.
If anonymous access is enabled on your Sourcebot instance, no OAuth token or API key is required. You can connect directly to the MCP endpoint without any authorization.
The examples below add the MCP server and connect it to Sourcebot’s public deployment at app.sourcebot.dev. Replace the URL with your own Sourcebot deployment as needed.
Claude Code
Claude Code
Claude Code MCP docsRun the following command:Replace
- OAuth
- API Key
only available in a paid plan. Please activate a license key to use this feature.
https://app.sourcebot.dev with wherever your Sourcebot instance is hosted. Claude Code will automatically handle the OAuth 2.0 authorization flow the first time you connect.Cursor
Cursor
Cursor MCP docsGo to: Replace
Settings -> Cursor Settings -> Tools & MCP -> New MCP ServerPaste the following into your ~/.cursor/mcp.json file:- OAuth
- API Key
only available in a paid plan. Please activate a license key to use this feature.
https://app.sourcebot.dev with wherever your Sourcebot instance is hosted. Cursor will automatically handle the OAuth 2.0 authorization flow the first time you connect.VS Code
VS Code
VS Code MCP docsAdd the following to your .vscode/mcp.json file:Replace
- OAuth
- API Key
only available in a paid plan. Please activate a license key to use this feature.
https://app.sourcebot.dev with wherever your Sourcebot instance is hosted. VS Code will automatically handle the OAuth 2.0 authorization flow the first time you connect.Codex
Codex
Codex MCP docsAdd the following to your Replace
~/.codex/config.toml file:- OAuth
- API Key
only available in a paid plan. Please activate a license key to use this feature.
https://app.sourcebot.dev with wherever your Sourcebot instance is hosted. Then run the following to authenticate:OpenCode
OpenCode
OpenCode MCP docsAdd the following to your Replace
opencode.jsonc file:- OAuth
- API Key
only available in a paid plan. Please activate a license key to use this feature.
https://app.sourcebot.dev with wherever your Sourcebot instance is hosted. OpenCode will automatically handle the OAuth 2.0 authorization flow the first time you connect. You can also manually trigger it with:Windsurf
Windsurf
Windsurf MCP docsGo to: Replace
Windsurf Settings -> Cascade -> Add Server -> Add Custom ServerPaste the following into your ~/.codeium/windsurf/mcp_config.json file:- OAuth
- API Key
only available in a paid plan. Please activate a license key to use this feature.
https://app.sourcebot.dev with wherever your Sourcebot instance is hosted. Windsurf will automatically handle the OAuth 2.0 authorization flow the first time you connect.Authorization
The Sourcebot MCP server supports two authorization methods, OAuth and API keys. If anonymous access is enabled on your instance, no authorization is required. Regardless of which method you use, all MCP requests are scoped to the associated Sourcebot user and inherit the user’s role and permissions. When permission syncing is configured, this includes repository permissions - the MCP server will only surface results from repositories the user has access to.OAuth 2.0
only available in a paid plan. Please activate a license key to use this feature.

API Key (Bearer token)
API keys provide a simpler alternative to OAuth that works with any MCP client. Each key is scoped to the user who created it and inherits their permissions. To create one, navigate to Settings → API Keys and click Create API Key. Pass the key as anAuthorization: Bearer <key> header when connecting to the MCP server.

Available Tools
grep
Searches for code matching a regular expression pattern across repositories, similar to grep/ripgrep. Always case-sensitive. Results are grouped by file and include line numbers.
Parameters:
list_repos
Lists repositories indexed by Sourcebot with optional filtering and pagination.
Parameters:
read_file
Reads the source code for a given file, with optional line range control for large files.
Parameters:
list_tree
Lists files and directories from a repository path. Directories are shown before files at each level.
Parameters:
list_commits
Get a list of commits for a given repository.
Parameters:
glob
Finds files whose paths match a glob pattern across repositories (e.g. **/*.ts, src/**/*.test.{ts,tsx}). Results are grouped by repository.
Parameters:
get_diff
Returns a structured diff between two refs in a repository using a two-dot comparison.
Parameters:
find_symbol_definitions
Finds where a symbol (function, class, variable, etc.) is defined in a repository.
Parameters:
find_symbol_references
Finds all usages of a symbol (function, class, variable, etc.) across a repository.
Parameters:
list_language_models
Lists the available language models configured on the Sourcebot instance. Use this to discover which models can be specified when calling ask_codebase.
Parameters:
This tool takes no parameters.

