mcpField
S
Sourcegull

Sourcegull

Remote
github.com/sourcegullOther1Updated 1d ago
Repository

About Sourcegull

Sourcegull is a self-hosted code search and intelligence service written in Rust, for teams managing GitLab, GitHub, and Gitea repositories and their coding agents. Indexed search, cross-repository navigation, and permission syncing let agents retrieve relevant code and history on demand.

Key features

  1. 01Search across GitLab, GitHub, and Gitea
  2. 02Literal, regex, keyword, and structural search
  3. 03Cross-repository symbol, definition, and reference navigation
  4. 04Enforce permissions synced from code hosts
  5. 05Trends, watches, and bulk repository changes
  6. 06gull CLI and GraphQL API

Use cases

  1. 01Find code across multiple code hosts
  2. 02Let coding agents inspect symbols and commit history
  3. 03Search code within repository permissions
  4. 04Apply bulk changes and track merge requests

MCP support

Sourcegull provides an MCP server for coding agents to search code, read files, and inspect symbols, definitions, references, and Git history. Results follow the caller’s permissions and are sized for model context.

Configuration

Remote servers need no local install. Pick your client, then copy the config or install in one click.

Endpointhttps://{sourcegull_host}/.api/mcp
Copy install command
Claude CodeTerminal
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Claude Desktopclaude_desktop_config.json
Windsurf~/.codeium/windsurf/mcp_config.json

Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.

Tools

Details

From the project README

README image
SourceGull

Find code across thousands of repositories in milliseconds, with up to 50× fewer tokens. For you and your agents.
Self-hosted code search and code intelligence for GitLab, GitHub and Gitea, written in Rust. Every feature is open source under Apache-2.0, including SSO, SCIM, RBAC and audit logs. There is no paid tier, and there will not be one.

Quick install · Production install · Documentation · Query language · AI agents (MCP) · Architecture · Development

Licence: Apache-2.0 Rust 1.85+ Docker and Helm

Typing the query lang:rust serde::Deserialize; 119 results from axum, serde and tokio arrive in a few milliseconds

Fast search, fewer tokens

Agents connected over MCP read only the lines that answer their question, with up to 50× fewer tokens than cloning and grepping (token usage).

Sourcegull uses a trigram index of its own. After a push, only the changed paths are written to a delta shard, so new commits are searchable within seconds without rebuilding the repository's index. Small repositories are packed together into compound shards, which keeps instances with thousands of repositories fast. Revisions that are not indexed (any branch, tag or commit) are searched straight from git. Results stream as they are found.

How it compares with the alternatives on the same GitLab: Benchmark.

Everything is free

Every feature is in this repository under Apache-2.0. There is no enterprise edition, no licence key and no paid tier, and the project will not add one. That includes the features that other code search products usually sell separately:

Also included: literal, regexp, keyword (BM25) and structural search; notebooks; code ownership; saved searches and search contexts; a GraphQL API, the gull CLI and outbound webhooks; Grafana dashboards and documented alerts. See the documentation.

Code navigation in tokio: the hover card for asyncify, and its definition and 55 references in the panel below

Ready for production

  • One Rust binary, and PostgreSQL (16 or newer) is its only stateful dependency. Nothing is sent to a vendor cloud.
  • No telemetry. Usage analytics stay on the instance.
  • Docker Compose for one host, a Helm chart for Kubernetes. Every release is tested by upgrading from the previous one.
  • Repository storage spreads across several repo nodes, which you can add or remove without downtime.
  • Stored secrets are encrypted, and the keys rotate without a restart.
  • Grafana dashboards and Prometheus alerts are included.
  • Configuration as code: sign-in, code host connections and site admins come from files in git, and secrets come from the environment.
  • GitLab (gitlab.com and self-managed) has every feature. GitHub (github.com and Enterprise Server) and Gitea support repository sync, permission sync, webhooks and sign-in.
  • Several code hosts at once: connect gitlab.com, a self-managed GitLab, GitHub and Gitea side by side, and one search covers all of them, each with its own permissions.

Quick install

To try Sourcegull or run it for a small team on one host, download the Compose bundle of the latest release and start PostgreSQL and Sourcegull with the published image, ghcr.io/sourcegull/sourcegull (linux/amd64):

curl -fsSL https://github.com/sourcegull/sourcegull/releases/latest/download/sourcegull-compose.tar.gz | tar -xz
cd sourcegull-compose
echo "POSTGRES_PASSWORD=$(openssl rand -hex 24)" > .env
docker compose up -d

Open http://localhost:7080. The first user to sign up becomes the site admin. Add a GitLab, GitHub or Gitea connection under Site admin → Code host connections, and repositories start cloning and indexing.

Production deployments

docs/install.md is the install guide. For production, use one of these:

Running either one is covered by the docs on upgrades (Compose, Helm), backups, monitoring and configuration as code.

AI agents (MCP)

/.api/mcp is a Model Context Protocol server. Coding agents search code, read files, find symbols, definitions and references, and read history (log, commits, compare, blame) with the caller's permissions, in output sized for a model's context. Connect an agent in the sidebar gives copy-paste setup for Claude Code, Cursor, VS Code, Codex, Gemini CLI, Zed, JetBrains and others, with a one-click token. For Claude Code:

claude mcp add --transport http sourcegull https://sourcegull.example.com/.api/mcp \
  --header "Authorization: Bearer <token>"

Tools and examples: docs/mcp.md.

How it works

One binary, sourcegull, runs in roles: web (UI, APIs, search fan-out), repo (git storage, index shards and search, partitioned across nodes), worker (background jobs) and blob (blob store); sourcegull supervise runs them all in one process. sourcegull executor runs sandboxed jobs in Docker or Kubernetes. PostgreSQL holds the data, job queues, leases and caches; there is no Redis. Each repo node indexes and searches its own repositories; web parses the query, applies permissions, fans it out to the nodes and merges the result streams. Details in docs/architecture.md.

Build from source

Everything runs in Docker; nothing to install but Docker with Compose.

docker compose up -d          # Postgres, Sourcegull built from this checkout, UI dev server
open http://localhost:5173    # UI with hot reload; API on :7080
scripts/dev test              # the test suite against the dev Postgres
scripts/dev check             # rustfmt, clippy -D warnings, UI type check and tests
scripts/dev help              # e2e tests, benchmarks, a local GitLab with seed data, ...

More in docs/development.md.

Alternatives

SourcegullSourcegraphSourcebotZoektOpenGrokHoundGitLab code search
Licence🟢 Apache-2.0💰 proprietary💰 proprietary, free to 5 users🟢 Apache-2.0🟢 CDDL-1.0🟢 MIT💰 GitLab tiers
Every feature free🟢🔴🔴🟢🟢🟢🔴
Written inRustGo, TypeScriptTypeScript (Zoekt inside)GoJavaGoRuby, Go
Indexed regex search🟢💰🟢 to 5 users🟢🟢🟢💰 default branch only
Unindexed revisions (any branch, tag, commit)🟢💰🔴🔴🔴🔴🟡 any branch, one project at a time
Structural and BM25 keyword search🟢💰🔴🔴🔴🔴🔴
Code hosts🟢 GitLab, GitHub, Gitea💰 many🟢 many, to 5 users🟡 mirror tools🟡 local checkouts (many VCS)🟢 git and others🟢 GitLab only
Precise code navigation (SCIP), cross-repository🟢💰🔴🔴🔴🔴🟡 within one project
Repository permissions synced from the code host🟢💰💰🔴🔴🔴🟢 built in
SSO, SCIM, RBAC, audit log🟢💰💰 SSO free to 5 users, rest paid🔴🔴🔴💰 partly paid
Bulk changes across repositories🟢💰🔴🔴🔴🔴🔴
Trends, watches, search jobs🟢💰🔴🔴🔴🔴🔴
MCP server for AI agents🟢💰🟢 to 5 users🔴🔴🔴🟡 free, cross-project code search paid
Hosted AI assistant🔴💰🟢 to 5 users🔴🔴🔴💰

🟢 free · 💰 paid · 🟡 incomplete · 🔴 not available

  • Sourcegraph is the most complete code intelligence platform, self-hosted under a commercial licence.
  • Sourcebot builds a web UI, an MCP server and an AI assistant on Zoekt. It is closed source since version 6. The free plan stops at 5 users, permission syncing and analytics are in paid plans, and SCIM and audit logs are in the Enterprise plan.
  • Zoekt is a fast trigram search engine and nothing else. It answers literal queries faster than Sourcegull; Sourcegull indexes faster, needs less disk and answers regexps faster (below).
Benchmark: the same GitLab, one product at a time

Each product indexed the same 1,007 public projects from one GitLab CE 19.4 instance: 7 large repositories at pinned releases (Linux, LLVM, Go, Rust, Kubernetes, GitLab, TensorFlow; 4.4 GB of source) and 1,000 generated repositories with history (0.84 GB). Every product ran alone, from a fresh install, next to GitLab on one host with 6 CPUs and 24 GB of memory.

All repositories searchablePeak memory (indexing)Memory (idle)DiskSelective literalCommon literalRegexNo match
Sourcegull3 min 21 s3.7 GB2.2 GB3.7 GB54 / 69 ms (724)48 / 54 ms (1000)84 / 88 ms (1000)29 / 35 ms (0)
Sourcegraph 5.0.610 min 08 s5.2 GB3.2 GB13.4 GB22 / 33 ms (640)24 / 30 ms (902)121 / 242 ms (883)12 / 20 ms (0)
Sourcebot 5.1.165 min 31 s8.5 GB1.9 GB13.9 GB77 / 90 ms (660)101 / 113 ms (971)309 / 332 ms (978)18 / 21 ms (0)
Zoekt9 min 05 s3.9 GB1.7 GB13.9 GB16 / 23 ms (724)29 / 34 ms (1000)361 / 390 ms (1000)8 / 10 ms (0)
Hound3 min 02 s6.2 GB5.9 GB9.4 GB336 / 351 ms (724)766 / 851 ms (2188)788 / 884 ms (2187)10 / 13 ms (0)
OpenGrok 1.1436 min 38 s9.0 GB5.1 GB18.4 GB973 / 998 ms (653)84 / 107 ms (1000)not supported20 / 27 ms (0)
  • Searchable: from adding the GitLab connection (or starting the product, when it reads its configuration from a file) until every repository is in the search index, cloning included.
  • Memory: all of the product's containers, databases included, as Docker reports them: the peak while indexing, and after two idle minutes. Disk: all of its volumes (git mirrors, index, databases).
  • Queries: p50 / p95 of 20 sequential requests after 3 warm-ups, over HTTP to each product's search API, at most 1,000 results; files returned in parentheses. Selective is kmalloc_array, common is func main, regex is func\s+main\(, and the last query matches nothing. Sourcegraph and Sourcebot stop at 1,000 line matches, so they return fewer files; Hound has no limit and returns every matching file.
  • Settings are the defaults, except: Zoekt (zoekt-indexserver and zoekt-mirror-gitlab built from commit c0b97d2) runs with -fetch_interval 1m (the default of one hour delays the first index by an hour) and -cpu_fraction 1.0; Hound runs 6 indexers. OpenGrok has no code host integration, so its time includes cloning every repository first (6 at a time, 86 s); its regexps match single tokens, so the regex query cannot be expressed.
  • Sourcegraph 5.0.6 is the single-container image from 2023, before the source was closed. Sourcebot 6 needs the deployment registered with the vendor before its API answers, so 5.1.16, the last release without that, was measured. GitLab's own code search is not included: GitLab CE searches code one project at a time, and instance-wide search needs exact code search (Zoekt) or advanced search (Elasticsearch or OpenSearch), both on Premium or Ultimate.

Contributing

Bug reports and pull requests are welcome. docs/development.md covers the Docker development setup, tests, benchmarks and conventions. Run scripts/dev check before sending a change.

Licence

Apache-2.0 (LICENSE-APACHE). Parts derived from third-party projects keep their licence and attribution; see NOTICE.

Sourcegull is independent and not affiliated with, sponsored or endorsed by Sourcegraph, Inc. or GitLab Inc. Product names are trademarks of their owners, named only to describe alternatives and compatibility.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.