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_...) |
Capabilities
Features and capabilities supported by this server
| 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 | |
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/dalebrubaker/sourcegraph-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server