S

sourcegraph.com

Sourcegraph provides code search, code navigation, repository analysis, and related developer tooling for source code across many repositories. It is offered as Sourcegraph Cloud and self-hosted deployments, with separate analytics features for usage and performance data.

6 integrations · MCP · REST · GraphQL · CLI

Sourcegraph exposes a GraphQL debug API, a streaming search HTTP API, a newer external HTTP API at `/api-reference`, an MCP server, an analytics HTTP API on analytics.sourcegraph.com, and the `src` CLI; all documented surfaces require authentication.

discovered 2mo ago
MCP servers1
REST · OpenAPI3
GraphQL1
CLI1
Credentials
Sourcegraph access tokenapi_keyGet key ↗

Create a personal or service-account access token in your Sourcegraph instance. The docs reference Settings > Access tokens for users and service-account Access tokens for service accounts; start from creating an access token or service accounts. Use the mcp scope for MCP-only access when desired.

OAuth 2.0oauth2$ src login

Acquired by the CLI — running src login opens the auth flow and stores the credential.

Sourcegraph service-account M2M OAuth clientoauth2_ccSet up OAuth ↗

Create a service account, then open that account's Access tokens > M2M credentials and click Create M2M credential as documented in service accounts. Save the generated client_id and client_secret, then exchange them for a short-lived bearer token with the Sourcegraph OAuth token endpoint. Select scopes appropriate to the target API.

Sourcegraph Analytics access tokenbearerGet token ↗

Sign in to your Sourcegraph Account, open the Sourcegraph Analytics access tokens management page, and create an analytics access token. Export it for scripts as ACCESS_TOKEN.

conventions · 1/8 published

Publish these signals → /publishing