Sourcegraph plugin for Claude Code that adds:
- Sourcegraph MCP server connectivity (code search, navigation, Deep Search)
searching-sourcegraphskill for disciplined search workflows (with supporting workflows and query patterns)
- Claude Code version 1.0.33 or later (
claude --version) - A Sourcegraph instance with MCP enabled
- A Sourcegraph access token with
mcpscope
Set the required environment variables in your shell profile (.zshrc, .bashrc, etc.):
export SOURCEGRAPH_ENDPOINT="https://sourcegraph.example.com"
export SOURCEGRAPH_ACCESS_TOKEN="<your-token>"Add this repository as a marketplace, then install the plugin:
# From a local clone
claude plugin marketplace add ./sourcegraph-claudecode-plugin
# Or directly from GitHub
claude plugin marketplace add sourcegraph-community/sourcegraph-claudecode-pluginThen install:
claude plugin install sourcegraph@sourcegraph-claudecode-pluginRestart Claude Code after installing.
Load the plugin for a single session without installing permanently:
claude --plugin-dir ./sourcegraph-claudecode-pluginRun /reload-plugins after making changes during a session.
If you only want the Sourcegraph MCP tools without the skills, add the server directly:
claude mcp add --transport http sourcegraph \
"${SOURCEGRAPH_ENDPOINT}/.api/mcp" \
--header "Authorization: token ${SOURCEGRAPH_ACCESS_TOKEN}"After installing, confirm everything loaded:
/helpshould listsourcegraph:searching-sourcegraph/mcpshould show thesourcegraphMCP server as connected
.
├── .claude-plugin/
│ ├── plugin.json
│ └── marketplace.json
├── .mcp.json
├── skills/
│ └── searching-sourcegraph/
│ ├── SKILL.md
│ ├── query-patterns.md
│ ├── examples/
│ │ └── common-searches.md
│ └── workflows/
│ ├── implementing-feature.md
│ ├── understanding-code.md
│ ├── debugging-issue.md
│ ├── fixing-bug.md
│ └── code-review.md
└── README.md
The plugin installs one skill: searching-sourcegraph. Claude auto-invokes it when you need to search or navigate code via Sourcegraph. It includes workflows for implementing features, understanding code, debugging issues, fixing bugs, and code review.
- Endpoint:
${SOURCEGRAPH_ENDPOINT}/.api/mcp - Transport: HTTP (
"type": "http") - Auth header:
Authorization: token <token>