The Sourcegraph MCP server gives an AI coding agent the code search, navigation and history of your company's Sourcegraph instance: sixteen tools, on three endpoints, supported on Enterprise plans. It answers a developer who is signed in to Sourcegraph and can already read the repositories. The colleagues who cannot read them are outside its reach, by design.
This guide is for developers, and for the CTO who decides what the rest of the company gets. Every fact about the server was read in Sourcegraph's documentation on 22 November 2026: the pages on the MCP server, its client integrations, its authentication, repository permissions and Deep Search. Reread the current version before you rely on a detail.
Keep one person in mind as you read: the support agent who has no account on your code host. Here is their question, asked through DeployIt with the Everyone profile.
A customer wants to change the billing address on an invoice we already issued. Can they?
Not on an issued invoice: its address is frozen when the invoice is created. The customer can change the address on their account, and it applies from the next invoice. To correct an issued one, an administrator cancels it and issues a new one.
What is the Sourcegraph MCP server?
It is the MCP interface of a Sourcegraph instance. The documentation describes it as giving AI agents and applications "programmatic access to your Sourcegraph instance's code search, navigation, and analysis capabilities". The address is your instance's, followed by one of three paths.
| Endpoint | What it serves |
|---|---|
/.api/mcp | The core tools: search, repositories, history, and reading existing Deep Search conversations |
/.api/mcp/all | The full suite of sixteen tools |
/.api/mcp/deepsearch | The Deep Search tools only |
The sixteen tools fall into five families:
- Files and repositories:
read_file,list_files,list_repos,list_refs. - Code search:
keyword_search,nls_search, andevaluator, which runs sandboxed Lua scripts over search results. - Code navigation:
go_to_definition,find_references. - History:
commit_search,diff_search,compare_revisions,get_contributor_repos. - Agents:
code_finder, a fast search agent whose usage is metered against the instance's entitlement, thendeepsearchanddeepsearch_read.
The default endpoint carries nine of them. The other seven are on /.api/mcp/all: compare_revisions, code navigation and the creation of a Deep Search conversation among them.
How do you connect the Sourcegraph MCP server to Claude Code?
One command, then a sign-in in the browser:
claude mcp add --transport http --scope user sourcegraph https://sourcegraph.example.com/.api/mcp
claude mcp login sourcegraph
Replace sourcegraph.example.com with the address of your instance. Without --scope user, Claude Code adds the server for the current project only.
The documentation describes three ways to authenticate: OAuth with a client that registers itself (on by default), OAuth with a client an administrator registered in advance, and a Sourcegraph access token in an Authorization header, for clients without OAuth. The integrations page covers nine clients, among them Claude Code, Codex, Cursor and GitHub Copilot. Claude's connector directory lists a Sourcegraph connector as well (seen on 22 November 2026).
Which questions does the Sourcegraph MCP server answer? A map
Seven questions, sorted by who asks. The tools named are the ones the documentation gives for the job.
| The question | Who asks | What answers |
|---|---|---|
| “Where do we build HTTP error responses?” | A developer | code_finder, or keyword_search then read_file |
| “Who calls this function, in every repository?” | A developer | find_references |
| “Which services still depend on the old logging package?” | A developer, an architect | deepsearch, a multi-step investigation across one or many repositories |
| “What changed between the last two release tags?” | A developer | list_refs, then compare_revisions |
| “Which commits touched the invoice export this month?” | A developer | commit_search, with its file and date filters |
| “Why does a customer see ‘invalid IBAN’ at sign-up?” | Support, with no access to the repository | Nothing within their reach: the server answers signed-in users, on the repositories they can read |
| “Who delivered what this quarter, and with what code score?” | Leadership | No tool is listed for statistics per developer; commit_search filters commits by author |
The first five rows are where this server is at home. An agent that could only search one checkout now searches every repository of the company, follows a symbol to its definition, and reads history by its content. For a developer, the gain is real. If those rows are your whole need, stop here and connect it.
The last two rows are another matter. They are not gaps in a search tool. They are questions from people it was never meant to serve.
Who can ask? An account, a permission, the repository
Three conditions, all in the documentation.
An Enterprise instance. The pages of the MCP server carry the mention: supported on Enterprise plans.
A signed-in user who holds the permission. Sourcegraph checks a permission named MCP#ACCESS before it serves a request. The built-in User role grants it by default, so every signed-in user can use MCP until an administrator decides otherwise.
Access to the repository. A user only reads data from the repositories they are already allowed to access in Sourcegraph. And Sourcegraph can be configured to enforce the same access as your code host: a person sees there what they see on GitHub or GitLab and nothing else, not even that a repository exists.
Put together: the server answers the people who can read the code, and what it hands them is the code. read_file returns the contents of a file with its line numbers; a search returns the matching lines. For a developer's tool, that is the right design.
For everyone else, it leaves a company two options. Support, sales and product stay outside, or they get an account and access to the repositories, and then they read the source. Few companies choose the second.
Sourcegraph MCP server or DeployIt: which one for which person?
| Sourcegraph MCP server | DeployIt | |
|---|---|---|
| What it is | The code search, navigation, history and Deep Search of a Sourcegraph instance, as MCP tools | An MCP server that answers questions about your product from its code |
| Who it answers | Signed-in Sourcegraph users, on the repositories they can already read | The whole company, through one link; a profile decides who receives code excerpts |
| What comes back | File contents, search matches, commits, diffs, Deep Search answers with their sources | An answer with its status; code excerpts for the Developers profile only |
| “What changed?” | commit_search, diff_search, compare_revisions: commits and diffs to read | recent_changes: what landed over 1 to 90 days, grouped into deliveries, with no name |
| Statistics per developer | No tool listed for it | stats_schema and stats_query, for the Leadership profile |
| Where you use it | Claude Code, Codex, Cursor, GitHub Copilot and the other documented clients | Claude on the web and on the desktop, and Claude Code |
They do not do the same job. One equips the developer's agent. The other answers the rest of the company, and leadership.
What DeployIt does here
DeployIt is an MCP server. Your company gets one link, https://mcp.deployit.ai/<company>/<code>; each person adds it to Claude (on the web, on the desktop or in Claude Code) and signs up with a name and an email, which is not verified; their questions are logged under that name. Everyone starts with the Everyone profile: questions about the product, answered from the code; a filter removes the code, the file paths and the names of team members it recognises from the answers, without proving their absence, and a leak test tells you what still gets through. An administrator gives the Developers profile (excerpts) or the Leadership profile (developer statistics) to whoever needs it. Repositories are connected from GitHub or GitLab; DeployIt makes no commit, branch or pull request, and only adds one webhook per repository.
A working copy of the code is kept while a repository is connected, hosted by DigitalOcean, in Amsterdam (Netherlands), in the European Union; at indexing, each source file is sent to OpenAI's model to be summarised, then the passages needed for an answer and the diffs of the commits that are scored. With your own model key, your questions go through your provider, under your contract; the reading of the code and the commit scores stay with OpenAI.
Two tools carry the last two rows of the map. ask_code investigates the code and labels its answer Verified, Backend only, Not found or Inconclusive: support knows what it can repeat to a customer. stats_query returns the facts from which Claude writes leadership's report: integrated commits, reviews by a colleague, tests, defects “to confirm”, and a code grade always given with its commit count. DeployIt tracks each developer; the company informs the people it tracks, and a grade set by a model is a clue, never on its own the reason for a decision.
Sign-up works from Claude, on the web and on the desktop, and from Claude Code. Cursor and Windsurf cannot sign up yet: if your developers live in Cursor, Sourcegraph's server is the one that reaches them.
What DeployIt does not replace
DeployIt is not a code search engine. It has no find_references, no search across thousands of repositories, no exhaustive inventory of the services that import a package. A developer with the Developers profile receives excerpts in an answer, not a way to browse the code. For that work, Sourcegraph is the right tool, and its MCP server puts it inside the agent.
The two live side by side without overlapping: Sourcegraph for those who write the code, DeployIt for those who ask what it does, and for leadership, who follows who delivered it.
For one developer with credentials of their own, see what the GitHub MCP server answers. For the tools that read documentation or a generated wiki rather than the code, see DeepWiki alternatives for private repos. The whole product is in DeployIt: ask your code from Claude.
Next step. Add https://mcp.deployit.ai/demo to your Claude connectors and ask the demo repository “What does this product do?”, then a question a customer would ask. For your own code, connect your repositories and add your company link to Claude in three steps; who sees what is on the home page.
Price. Free plan: 500 questions a month for the whole company, no card. Plans from €290 a month excluding tax for up to 25 tracked developers: see pricing.
Ask your code from Claude
Free to start, no card. Or try the demo first: add https://mcp.deployit.ai/demo to your Claude connectors.
Frequently asked questions
What is the Sourcegraph MCP server?
It gives AI agents programmatic access to the code search, navigation and analysis of your company's Sourcegraph instance, through the Model Context Protocol. It exposes sixteen tools on three endpoints, and Sourcegraph's documentation lists it as supported on Enterprise plans (checked on 22 November 2026).
How do I connect the Sourcegraph MCP server to Claude Code?
Run claude mcp add --transport http --scope user sourcegraph, followed by the address of your instance ending in /.api/mcp, then claude mcp login sourcegraph, and sign in through the browser. Without --scope user, Claude Code adds the server for the current project only. A Sourcegraph access token sent in an Authorization header works too (Sourcegraph's documentation, checked on 22 November 2026).
Who can use the Sourcegraph MCP server?
Signed-in users of the Sourcegraph instance who hold the MCP#ACCESS permission, which the built-in User role grants by default. Each of them only reads data from the repositories they are already allowed to access in Sourcegraph. An administrator can turn the server off, disable tools one by one, or reserve the permission for a custom role.
Can a support or sales team use the Sourcegraph MCP server?
Only if each person has an account on the Sourcegraph instance and access to the repositories, and then what they receive is code: file contents, search matches, diffs. Most companies do not open their repositories to support or sales. With DeployIt, those people sign up from Claude with the company link and ask without access to the repository; for the Everyone profile, a filter removes the code from the answers (filtered and tested; no filter is infallible).
Does the Sourcegraph MCP server say what changed in a repository?
It has three history tools: commit_search (by message, author, files and dates), diff_search (patterns in the changes) and compare_revisions (two revisions, on the full endpoint). They return commits and diffs for the agent to read. DeployIt's recent_changes tool lists what landed on the tracked branch over 1 to 90 days, grouped into deliveries, without anyone's name.