Sourcegraph MCP server

Search your Sourcegraph code, jump to definitions, and ask Deep Search questions in plain English.

Tools
13
Transport
Remote (HTTP)
Sign-in
Sign in with Sourcegraph
Made by
Sourcegraph
RevampKey connects Sourcegraph in one click and adds its 3 skills. No config file. Free for Mac, Windows and Linux. Already installed? Open Sourcegraph in RevampKey

Get RevampKey to connect Sourcegraph

RevampKey is a free desktop app for Mac, Windows and Linux. Install it, sign in, and Sourcegraph is one click away with its skills already attached.

Download RevampKey

Not now? Use the skills in your current tool

for s in essentials change-history-investigation code-search-audit; do
  curl -fsSL --create-dirs -o .claude/skills/sourcegraph-$s/SKILL.md https://revampkey.com/marketplace/sourcegraph/skills/$s/SKILL.md
done

What the Sourcegraph MCP server does

Sourcegraph is a code search and code intelligence platform for large codebases. It indexes all of your repositories so you can search them together. Sourcegraph says more than 200 enterprise engineering teams trust it. Engineering teams use it to understand and oversee code. Sourcegraph says support and go-to-market teams use it too.

Click Connect in RevampKey and approve access on Sourcegraph's own sign-in page. Then ask in plain English. The agent can run keyword searches across your repositories, ask Deep Search questions, jump from a symbol to its definition and its references, and browse repositories, folders and files. It can also search commits and diffs, compare two revisions, and list the repositories a contributor has worked in.

Access follows Sourcegraph's rules. You can only read repositories your account is already allowed to see. Admins can turn off individual tools by name, or limit MCP use to certain roles with the MCP access permission. Admins can also turn off the MCP server for the whole instance. Admins set these controls on your Sourcegraph instance.

What you can do with Sourcegraph and an AI agent

Finding where a function is defined and used

You plan to change a function in a shared service, but you don't know who calls it. Ask the agent where the function is defined. It jumps to the definition, lists the places in your repositories that reference it, and reads the surrounding files so you can see how each call is used.

Getting a cited answer about how code works

A support engineer needs to know how database migrations work across services. They ask the question in plain English. The agent runs a Deep Search, reads the results, and returns an answer with the citations Sourcegraph provides, so you can see where each point came from.

Reviewing what changed between two versions

A release branch has drifted from main, and you need a summary. Give the agent the two revisions. It compares them, searches the commits for the changes that matter, and reads the diffs. Then it lists what changed and which commits made each change.

How to set up the Sourcegraph MCP server

Pick your app. RevampKey needs no config file; the others need one command or a config line.

About 1 minute · Sign in with Sourcegraph

  1. Install RevampKey for Mac, Windows or Linux and sign in.

  2. Open Connectors, search for Sourcegraph and click Connect. Approve access on Sourcegraph's own sign-in page. RevampKey never sees your password.

  3. Ask in plain language. The 3 Sourcegraph skills come with the connector. The agent asks before it changes anything.

  4. Download RevampKeyConnect Sourcegraph · 1 click

    Get RevampKey to connect Sourcegraph

    RevampKey is a free desktop app for Mac, Windows and Linux. Install it, sign in, and Sourcegraph is one click away with its skills already attached.

    Download RevampKey

    Not now? Use the skills in your current tool

    for s in essentials change-history-investigation code-search-audit; do
      curl -fsSL --create-dirs -o .claude/skills/sourcegraph-$s/SKILL.md https://revampkey.com/marketplace/sourcegraph/skills/$s/SKILL.md
    done

Using a different MCP client?

Add a new remote (HTTP) MCP server in its settings and paste this URL. Sign in with Sourcegraph the first time it connects.

Server URLhttps://sourcegraph.com/.api/mcp

Skip the config file

In RevampKey, Sourcegraph is one click: sign-in and the server and the 3 skills are set up for you.

Download RevampKey

Sourcegraph agent skills

Playbooks that teach the agent how to do real Sourcegraph work, step by step. RevampKey adds them when you connect; any Agent Skills tool can use them.

See all 3 skills in detail →

What to ask once Sourcegraph is connected

Plain words work. Copy one to try it.

  • “Which repos have 'billing' in their name?”
  • “Where is parseInvoice defined, and where is it called?”
  • “Find every file that contains the string legacy_auth across all repos.”
  • “Ask Deep Search how we handle database migrations across services.”
  • “Show me the commits that changed the retry logic in the payments code last month.”
  • “Between v4.1.0 and v4.3.0, our export started dropping rows with null dates. Find the commit that changed this and explain why.”Investigate when and why code behaviour changed in Sourcegraph
  • “Find every place we still call the legacy payments client across the backend repos, and tell me which are real calls versus tests or comments.”Audit a code pattern across repositories

What the agent can do in Sourcegraph

13 tools in 5 groups. Reading needs no approval; RevampKey asks before every change.

Code search
Search across your indexed repositories for exact text with keyword search. Keyword search returns exact, deterministic results. You can also ask questions in plain English with natural language search.keyword_searchnls_search
Deep Search
Ask complex questions in plain English and get grounded answers with citations. The agent can also read the results of a Deep Search to pull out the relevant parts.deepsearchdeepsearch_read
Code navigation
Jump from a symbol to its definition. List the places in your repositories that reference it. Use this to trace a function before you change code.go_to_definitionfind_references
Repositories and files
List repositories whose names match a substring, browse folders, and read file contents. You can read a file at a given revision or a specific line range.list_reposlist_filesread_file
Commits, diffs and contributors
Search commit history and code changes in diffs. Compare two revisions. List the repositories a given contributor has worked in.commit_searchdiff_searchcompare_revisionsget_contributor_repos

All 13 Sourcegraph MCP tools

Show all 13 tools13 read

Read (13) Run without asking

  • commit_search
  • compare_revisions
  • deepsearch
  • deepsearch_read
  • diff_search
  • find_references
  • get_contributor_repos
  • go_to_definition
  • keyword_search
  • list_files
  • list_repos
  • nls_search
  • read_file

Sourcegraph MCP in RevampKey vs other tools

RevampKeyClaude CodeCursorVS Code
SetupOne clickOne terminal commandEdit mcp.jsonEdit mcp.json
Sign-inIn the app/mcp → AuthenticateBrowser promptBrowser prompt
Sourcegraph skillsAdded on connectCopy into .claude/skillsCopy into the projectCopy into the project
Needs a terminalNoYesNoNo

Sourcegraph MCP server FAQ

What do I need to connect Sourcegraph to RevampKey?

You need a Sourcegraph account on an instance where the MCP server is enabled. Sourcegraph's docs say the MCP server is supported on Enterprise plans. Click Connect in RevampKey, then approve access on Sourcegraph's own sign-in page. Your account also needs the MCP access permission. The built-in User role grants it by default unless an admin removes it.

What can the agent do in Sourcegraph, and what can't it do?

The agent can search code, read files, follow definitions and references, and look through commits and diffs. All 13 Sourcegraph tools find and read information. None of them edits, creates, sends or deletes anything in Sourcegraph. The agent asks before it changes anything.

Who can see my code through the agent?

The agent only reads what your own Sourcegraph account can already read. Repository permissions still apply. Admins can turn off the MCP server, disable single tools, or limit MCP access by role. Check the agent's answers against the code it cites before you act on them.

What is Deep Search in Sourcegraph?

Deep Search is a Sourcegraph feature that takes complex questions in natural language. It returns grounded answers with citations. Keyword search works differently. It returns exact, deterministic and exhaustive matches, so you can find every place a string appears in your code.

What is the Sourcegraph MCP server URL?

The Sourcegraph MCP server URL is https://sourcegraph.com/.api/mcp. It uses the Streamable HTTP transport, so any client that supports remote MCP servers can connect to it.

How does the Sourcegraph MCP server authenticate?

With Sourcegraph's own sign-in (OAuth). You approve access in your browser; no password is shared with the client.

What can an AI agent do with the Sourcegraph MCP server?

It exposes 13 tools: 13 that read and 0 that create or change things. In RevampKey the agent asks before it runs any tool that changes data.

Are there agent skills for Sourcegraph?

Yes. 3 SKILL.md playbooks teach an agent how to do real Sourcegraph work step by step. RevampKey installs them when you connect Sourcegraph; for Claude Code, Cursor or Codex you can copy them into your project.

Connect Sourcegraph in under a minute

Download RevampKey for Mac, Windows or Linux, sign in, and Sourcegraph is one click away, with its skills already attached, along with every other connector in the marketplace.

Download RevampKeyConnect Sourcegraph · 1 click

Get RevampKey to connect Sourcegraph

RevampKey is a free desktop app for Mac, Windows and Linux. Install it, sign in, and Sourcegraph is one click away with its skills already attached.

Download RevampKey

Not now? Use the skills in your current tool

for s in essentials change-history-investigation code-search-audit; do
  curl -fsSL --create-dirs -o .claude/skills/sourcegraph-$s/SKILL.md https://revampkey.com/marketplace/sourcegraph/skills/$s/SKILL.md
done