Skip to main content
Sourcegraph integrates with the tools you already use — editors, browsers, code hosts, and AI assistants — so you can search and navigate code without leaving your workflow.

Editor extensions

Search and navigate code in VS Code, JetBrains IDEs, and other editors.

Browser extensions

Add hover tooltips, go-to-definition, and code search to GitHub, GitLab, and Bitbucket in Chrome, Firefox, and Safari.

Code host integrations

Sync repositories, mirror permissions, and enable user authentication from GitHub, GitLab, and Bitbucket.

AI tools (MCP)

Connect Cody, Claude, Cursor, and other AI tools to Sourcegraph via the Model Context Protocol.

Editor extensions

Sourcegraph’s editor integrations let you search and navigate across all your repositories without leaving your IDE or checking out code locally.

VS Code

Install the Sourcegraph extension from the VS Code Marketplace. Includes Cody AI chat, autocomplete, code search, and go-to-definition across all indexed repositories.

JetBrains IDEs

Works with IntelliJ IDEA, PyCharm, GoLand, WebStorm, and all other JetBrains IDEs. Install from the JetBrains Plugin Marketplace.

Gitpod

The Sourcegraph extension is available on the Open VSX Registry for use in Gitpod and other web-based VS Code environments.

Open in editor

Configure Sourcegraph to open files directly in your local editor from the Sourcegraph web UI.

Installing the VS Code extension

1

Open VS Code

Open the Extensions panel with Ctrl+Shift+X (Windows/Linux) or Cmd+Shift+X (macOS).
2

Search for Sourcegraph

Search for “Sourcegraph” and install the extension published by Sourcegraph.
3

Connect to your instance

Open the Sourcegraph extension settings and enter your Sourcegraph instance URL and access token. Generate a token under Settings > Access tokens in your Sourcegraph instance.

Browser extensions

The Sourcegraph browser extension adds code intelligence — hover tooltips, go-to-definition, find references, and code search — directly to your code host and pull request views.

Chrome

Install from the Chrome Web Store. Works on GitHub, GitHub Enterprise, and more.

Firefox

Install from Mozilla Add-ons. Supports the same code hosts as Chrome.

Safari

Install from the Mac App Store.

Browser search shortcuts

Configure your browser’s address bar to search Sourcegraph directly.
After installing the extension, configure it to point to your Sourcegraph instance URL and access token. Once connected, visit any file or pull request on GitHub to see hover tooltips and code navigation.
You can also use the extension against https://sourcegraph.com to get code intelligence on public repositories without setting up your own instance.

Code host integrations

Sourcegraph connects to your code hosts to sync repositories, enforce access permissions, and allow users to sign in with existing credentials.

GitHub

Sync repositories from GitHub.com or GitHub Enterprise. Mirrors repository permissions and supports GitHub OAuth for user authentication.

GitLab

Sync repositories from GitLab.com or GitLab Self-Managed. Mirrors group and project permissions.

Bitbucket Cloud

Sync repositories from Bitbucket Cloud with workspace-level permission mirroring.

Bitbucket Server / Data Center

Sync repositories from Bitbucket Server and Bitbucket Data Center with project-level permission mirroring.
All code host integrations support:
  • Repository syncing — Sourcegraph indexes selected repositories and keeps them up to date
  • Permission mirroring — repository access in Sourcegraph reflects the permissions set on your code host
  • User authentication — users can sign in to Sourcegraph using their existing code host credentials (OAuth)
Code host connections are configured by site admins. See the administration docs for setup instructions.

AI tool integrations (MCP)

The Sourcegraph MCP server connects AI coding assistants directly to your Sourcegraph instance. Once connected, AI tools can search code, navigate to definitions, find references, read files, and explore commit history across all your repositories. Supported clients include:

Set up MCP

Connect your AI tool to Sourcegraph in a few minutes using the MCP server setup guide.

APIs

If you want to build a custom integration, Sourcegraph provides several APIs:

API overview

Start here. Understand which API to use for your integration and how to authenticate.

Streaming search API

Consume search results as a real-time event stream. Ideal for CI integrations and tooling.

GraphQL API

Query Sourcegraph data for diagnostics and simple tooling.

MCP server

Connect AI agents to Sourcegraph code search via the Model Context Protocol.

Build docs developers (and LLMs) love