# Sourcegraph

> Cross-repo code search, navigation, and Deep Search via the official Sourcegraph MCP.

[Canonical HTML page](https://top-mcps.com/mcp/sourcegraph) · [server.json](https://top-mcps.com/mcp/sourcegraph.json) · [methodology](https://top-mcps.com/about/methodology)

## At a glance

- **Maintainer:** Sourcegraph
- **Transport:** Streamable HTTP
- **Auth model:** API key
- **Required secrets:** None
- **Supported clients:** Claude, Cursor, Any MCP-compatible client, Sourcegraph instances
- **Latest version:** latest
- **Last verified:** 2026-05-27
- **Score:** 54/100 (rubric 2026-04 — see https://top-mcps.com/about/methodology)
- **Homepage:** https://sourcegraph.com/mcp

## Quick answer

**What it does.** Exposes Sourcegraph code intelligence as MCP tools: keyword + semantic code search, file/repo listing and reading, go-to-definition, find-references, diff and commit history, Deep Search, ownership signals.

**Best for:**
- Cross-repo find-references
- Go-to-definition across services
- Impact analysis before a change
- Deep Search for hard-to-find patterns
- Ownership and commit-history lookups

**Not for:**
- Single-repo workflows (use git + grep)
- Orgs not running Sourcegraph
- Cases where the agent's local context already has the code

## Description

The official Sourcegraph MCP gives AI agents the same code-intelligence surface a senior engineer uses — keyword and semantic search, go-to-definition, find-references, diffs, commit history, ownership signals, and Deep Search across repos.

## Why it matters

Cross-repo code search is the missing primitive for most coding agents — they hallucinate APIs they cannot see. Sourcegraph plugs that gap with the same backend a thousand-engineer org runs.

## Key features

- Keyword + semantic search
- Go-to-definition + find-references
- Deep Search across repos
- Diff and commit-history access
- Ownership signals for routing

## FAQ

### Does it need a Sourcegraph instance?

Yes — the MCP talks to an instance (Sourcegraph Cloud or your self-hosted deployment). Without one there is no index to query.

### What is Deep Search?

A Sourcegraph feature that runs multi-step, LLM-assisted searches across the codebase — well-suited to vague "find all places where we do X" questions.

### How is it different from GitHub MCP?

GitHub MCP drives the GitHub API (PRs, issues, code search via GitHub). Sourcegraph drives a code-intelligence index — go-to-def, find-refs, cross-repo are first-class.

## Changelog

- **2026-05-27** — Refreshed install snippets and fact sheet; verified for 2026.
- **2025-07-10** — Initial directory listing.
