sourcegraph-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| SOURCEGRAPH_URL | Yes | The URL of your SourceGraph instance (e.g., http://localhost:3370) | |
| SOURCEGRAPH_TOKEN | Yes | Your SourceGraph access token (e.g., sgp_...) |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| find_symbol_definitionA | Find where a symbol (function, class, method, variable, constant) is DEFINED in the codebase. Returns the exact file path and line number where the symbol is declared. This uses SourceGraph's indexed symbol search for fast lookups. Perfect for 'go to definition' or 'where is X defined?' queries. Returns: File path, line number, and column position of the definition. Examples:
Tips:
Note: To find where a symbol is USED (not defined), use find_symbol_references instead. |
| find_symbol_referencesA | Find all places where a symbol is USED/REFERENCED in the codebase. Returns file paths and line numbers for each usage. This searches for actual code references, not the definition. Use this to see where a function is called, a class is instantiated, a method is invoked, or a variable is accessed. Returns: File paths and line numbers showing code context for each reference. Examples:
Tips:
Note: To find where a symbol is DEFINED, use find_symbol_definition instead. |
| search_sourcegraphA | General code search across your SourceGraph instance. Use this for text-based searches, finding patterns, or when you need to search for more than just symbol definitions. Supports full SourceGraph query syntax including:
Examples:
Note: For finding symbol definitions or references specifically, use find_symbol_definition or find_symbol_references for faster, more accurate results. |
| search_sourcegraph_regexA | Search code using regular expressions. Automatically sets patternType to 'regexp' for regex queries. Use this for complex pattern matching. Examples:
Tips:
|
| get_sourcegraph_configA | Get current SourceGraph MCP server configuration. Shows the configured URL and whether an access token is set. Useful for debugging connection issues. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 5 tools
Each tool targets a distinct operation: symbol definition, symbol references, general text search, regex search, and server configuration. Even the two search tools are clearly differentiated by pattern type, minimizing ambiguity.
All tool names follow a consistent verb_noun pattern with underscores (e.g., find_symbol_definition, search_sourcegraph). The naming is descriptive and predictable across the set.
With 5 tools, the set is compact yet covers the core functionalities of code search: definition lookup, reference lookup, general search, regex search, and configuration. No redundancy or bloat.
The tool surface comprehensively covers the primary use cases for a code search server: locating symbol definitions, finding usages, performing text/regex searches, and retrieving config. No obvious missing operations for the intended domain.