🔍

Sourcegraph MCP Server

Updated June 2026

The Sourcegraph MCP server, built by najva-ai, provides najva-ai's Sourcegraph MCP Server is a Python server that gives AI assistants AI-enhanced code search across large, multi-repo codebases using Sourcegraph's query engine. It is community-built and best for Search.

by najva-ai

About

najva-ai's Sourcegraph MCP Server is a Python server that gives AI assistants AI-enhanced code search across large, multi-repo codebases using Sourcegraph's query engine. It exposes three tools: `search` (run Sourcegraph queries with full advanced syntax — regex patterns, `lang:`/`file:`/`repo:` filters, and boolean operators — across sourcegraph.com or a self-hosted instance), `search_prompt_guide` (generate a context-aware guide that helps the model construct effective queries for a stated objective), and `fetch_content` (retrieve file contents or explore directory structures inside a repository). Auth is via a `SRC_ENDPOINT` environment variable (required — e.g. https://sourcegraph.com) plus an optional `SRC_ACCESS_TOKEN` for private instances. The server runs locally over SSE / Streamable-HTTP (default ports 8000/8080) and is installed from source with UV (`uv sync && uv run python -m src.main`), pip (`pip install -e .`), or a bundled Dockerfile; clients like Cursor connect by pointing `.cursor/mcp.json` at the local `http://localhost:8080/sourcegraph/mcp/` URL. It's ideal for agents that need to find and understand code patterns across many repositories rather than a single local checkout.

Installation

source
uv sync && uv run python -m src.main

Frequently Asked Questions

What is Sourcegraph MCP Server?
Sourcegraph is an MCP server built by najva-ai. najva-ai's Sourcegraph MCP Server is a Python server that gives AI assistants AI-enhanced code search across large, multi-repo codebases using Sourcegraph's query engine. It exposes three tools: `search` (run Sourcegraph queries with full advanced syntax — regex patterns, `lang:`/`file:`/`repo:` filters, and boolean operators — across sourcegraph.com or a self-hosted instance), `search_prompt_guide` (generate a context-aware guide that helps the model construct effective queries for a stated objective), and `fetch_content` (retrieve file contents or explore directory structures inside a repository). Auth is via a `SRC_ENDPOINT` environment variable (required — e.g. https://sourcegraph.com) plus an optional `SRC_ACCESS_TOKEN` for private instances. The server runs locally over SSE / Streamable-HTTP (default ports 8000/8080) and is installed from source with UV (`uv sync && uv run python -m src.main`), pip (`pip install -e .`), or a bundled Dockerfile; clients like Cursor connect by pointing `.cursor/mcp.json` at the local `http://localhost:8080/sourcegraph/mcp/` URL. It's ideal for agents that need to find and understand code patterns across many repositories rather than a single local checkout.
Who built Sourcegraph MCP Server?
Sourcegraph MCP Server was built by najva-ai.
Is Sourcegraph MCP Server free?
Yes, Sourcegraph MCP Server has a free option. The MCP server is free and open-source. Sourcegraph: Free for public code. Cody Pro: $9/user/mo. Enterprise: Custom pricing.
How do I install Sourcegraph MCP Server?
Install Sourcegraph MCP Server with source: uv sync && uv run python -m src.main
What does Sourcegraph MCP Server integrate with?
Sourcegraph MCP Server integrates with Claude Desktop, Cursor, VS Code, Windsurf, Cline.

Repo Health

Local install

Local/stdio install — runs on your machine, so there is no remote endpoint to verify live. Trust signal below is from the source repo.

Repo recency not yet available for this server.

Quick Info

Install Type
source
Author
najva-ai
Categories
2
Integrations
5

Sponsored

Better Stack

Free Plan

Get alerted when your APIs, browser tests, payment pipelines, or MCP server dependencies go down. Used by 100K+ developers.

Start monitoring free →