Skip to main content
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.
  • 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.
You can read more about the options in the authorization section below.
Fastest setup: Open Settings → Account → MCP in your Sourcebot deployment to copy the Server URL and use one-click install cards for supported clients.
Note the following about these examples:
  • The examples 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 MCP docsRun the following command:
Replace 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 MCP docsGo to: Settings -> Cursor Settings -> Tools & MCP -> New MCP ServerPaste the following into your ~/.cursor/mcp.json file:
Replace 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 MCP docsAdd the following to your .vscode/mcp.json file:
Replace 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 MCP docs
Run the following command:
Replace https://app.sourcebot.dev with wherever your Sourcebot instance is hosted. Codex will automatically detect OAuth support and prompt you to authorize in your browser when you first connect.
Open Settings → Account → MCP in your Sourcebot deployment and click Copy command on the Codex card for a ready-to-run command with the correct Server URL.
OpenCode MCP docsAdd the following to your opencode.jsonc file:
Replace 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 MCP docsGo to: Windsurf Settings -> Cascade -> Add Server -> Add Custom ServerPaste the following into your ~/.codeium/windsurf/mcp_config.json file:
Replace 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. 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. With the MCP Gateway, both methods can also call the user’s allowed connector tools, such as Linear.

OAuth 2.0

Sourcebot implements an OAuth 2.0 authorization server with support for dynamic client registration (RFC 7591). This means MCP clients can register themselves automatically without any manual setup. Just point your client at the MCP endpoint and it will handle the full authorization flow, prompting you to log in and approve access in your browser the first time you connect. No API key or manual token management is required. Once authorized, Sourcebot issues a short-lived access token (valid for 1 hour) and a refresh token (valid for 90 days). The MCP client handles token refresh automatically, so you stay connected without needing to re-authorize.
OAuth authorization prompt showing Cursor requesting access to a Sourcebot account

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, go to Settings → API Keys and click New API key. Pass the key as an Authorization: Bearer <key> header when connecting to the MCP server.
API Keys page in Sourcebot Settings