query
The search query string (required)
How to use it
query is exposed by the Sourcegraph MCP MCP server. Add the server to your MCP client (Claude Desktop, Cursor, Windsurf and others), and the query tool becomes available to the model automatically. See the full listing for setup details and every tool this server provides.
Install Sourcegraph MCP
pip install git+https://github.com/akbad/sourcegraph-mcp.gitOther tools in Sourcegraph MCP (7)
Retrieve file contents or explore directory structures from repositories.
Maximum number of results to return (optional, default: 30, range: 1-100)
What you're trying to find or accomplish
File or directory path within the repo
Repo path (e.g., "github.com/org/project")
Search across codebases using Sourcegraph's advanced query syntax with support for regex, language filters, and boolean operators.