Integration

Sourcegraph integration

Sourcegraph Code Search and Intelligence API for universal code search across all repositories, code navigation, batch changes, and code insights. Search billions of lines of code with regex, structural, and semantic queries. Navigate code with go-to-definition, find references, and cross-repository intelligence. Automate large-scale code changes across thousands of repositories.

Ask it in chat

Say what should happen.
The workflow builds itself.

When this happens, do that in Sourcegraph.Built from the 10 Sourcegraph tools below, on the connection you add once.

Common Sourcegraph use cases

  • API usage discovery
  • code viewing
  • impact analysis
  • IDE hover tooltips
  • repository browsing
  • IDE-like code navigation
  • tracking migration progress
  • security vulnerability fixes
  • displaying repository dashboards
  • monitoring batch change progress

What you can do with Sourcegraph

Each of these is one operation on one endpoint, available both as a workflow step and as a tool an AI agent can call on its own. Nothing bundles several operations into one action, so what a run did stays readable afterwards.

Most endpoints run on the free plan. A few, mainly the ones that publish on your behalf, need a paid plan.

Batch change, 2 operations

  • create_batch_changeCreate batch changePOSTCreates a batch spec defining target repositories, transformations, and commit details for a batch change.
  • list_batch_changesList batch changesPOSTLists batch changes with id, name, description, state, and changeset counts. Optionally filter by state.

Repository, 2 operations

  • get_repositoryGet repositoryPOSTRetrieves detailed repository information including branches, default branch, commit history, and metadata.
  • list_repositoriesList repositoriesPOSTLists repositories indexed by Sourcegraph with filtering options for name, clone status, and index status.

Definition, 1 operation

  • get_definitionGet definitionPOSTFinds the definition of a symbol at a code location. Supports cross-repository go-to-definition navigation.

File, 1 operation

  • get_file_contentGet file contentPOSTRetrieves file content from a repository at a specific revision. Returns file content, language, and metadata.

Graphql, 1 operation

  • searchSearchPOSTSearches code across all repositories with regex, structural, and semantic queries. Supports filters for repo, file, language, and content.

Hover, 1 operation

  • get_hoverGet hoverPOSTRetrieves hover information for a symbol including type signature, documentation, and definition preview.

Insight, 1 operation

  • get_code_insightsGet code insightsPOSTRetrieves code insights data tracking metrics like code patterns, dependencies, or custom queries over time.

Reference, 1 operation

  • get_referencesGet referencesPOSTFinds all references to a symbol across all indexed repositories. Returns locations where the symbol is used.

Use Sourcegraph from Claude Code, Cursor or Codex

Connect Sourcegraph in LiveContext, create an API key in Settings, then add the LiveContext MCP server to your client. Its Sourcegraph operations become tools the client can call, next to every other integration you connected.

Claude Code
claude mcp add --transport http livecontext https://livecontext.ai/mcp --header "X-API-Key: YOUR_API_KEY"
Codex (~/.codex/config.toml)
[mcp_servers.livecontext]
url = "https://livecontext.ai/mcp"

[mcp_servers.livecontext.http_headers]
"X-API-Key" = "YOUR_API_KEY"
Cursor, Claude Desktop and other JSON configs
{
  "mcpServers": {
    "livecontext": {
      "type": "http",
      "url": "https://livecontext.ai/mcp",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Set up the MCP server step by step

How to connect Sourcegraph

  1. Create your workspace

    Sign up free. Nothing to install.

  2. Connect Sourcegraph once

    Add your Sourcegraph connection in Settings. Every tool from this integration reuses it, and secrets are encrypted at rest and visible only to you.

  3. Describe the job in chat

    The workflow builds itself in front of you and picks the endpoints it needs. Drag the steps yourself on the canvas whenever you would rather be explicit.

Sourcegraph integration FAQ

What can you do with the Sourcegraph integration?

LiveContext exposes 10 operations on Sourcegraph, covering batch change, repository, definition and file. Common uses include API usage discovery, code viewing and impact analysis.

Popular integrations

Browse the whole catalog