fetch_content
Retrieve file contents or explore directory structures from repositories.
How to use it
fetch_content is exposed by the Sourcegraph MCP MCP server. Add the server to your MCP client (Claude Desktop, Cursor, Windsurf and others), and the fetch_content 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)
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
The search query string (required)
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.