# zoekt-mcp [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/radiovisual/zoekt-mcp  
**GitHub Stars:** 2  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/zoekt-mcp

## Description
Fast indexed code search for AI agents, powered by Sourcegraph Zoekt.

## Tools
Capabilities this server exposes over MCP:

- **search_code** — {query, file_count, match_count, duration_ns, files: [{repo, file, language, branches, matches: [{line, text, ranges, symbols}]}]}
- **list_repos** — {count, repos: [{name, url, branches, index_time}]}
- **get_file** — {repo, path, branch, content}

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "zoekt-mcp": {
    "command": "uvx",
    "args": ["zoekt-mcp"],
    "env": {
      "ZOEKT_URL": "",
      "ZOEKT_REPOS_DIR": ""
    }
  }
}
```

**Requires environment variables:** `ZOEKT_URL`, `ZOEKT_REPOS_DIR` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What zoekt-mcp does

zoekt-mcp MCP server exposes Sourcegraph Zoekt through three MCP tools: `search_code`, `list_repos`, and `get_file`. It is intended for AI agents that need to locate code in indexed repositories and then inspect the contents of selected files.

`search_code` returns search timing, file and match counts, and matching files. Each file result can include its repository, path, language, branches, matching lines, text ranges, and symbols. Queries can use Zoekt search syntax, including repository scoping such as `repo:project-a`, and symbol-oriented searches such as `sym:getVideoId`.

`list_repos` reports the repositories known to the backend, including names, URLs, branches, and index times. `get_file` retrieves file content for a repository, path, and branch. Together, these tools support a search-then-read workflow without requiring the agent to scan a source tree directly.

## How it works

The MCP component is a Python application built with FastMCP. MCP clients start it as a subprocess over stdio, and it communicates with a separately running `zoekt-webserver` over HTTP JSON. The tools map to the backend's search, repository-listing, and file-printing endpoints.

The backend uses a Zoekt index stored in a Docker volume. A one-shot indexer reads a directory supplied to the Compose stack and makes each top-level subdirectory available as a searchable repository. This allows one backend to index multiple codebases and lets searches run across all indexed repositories or be narrowed with a repository qualifier.

The MCP process does not manage the backend lifecycle. You must start the Docker Compose stack yourself and configure the MCP process with the backend URL. The zoekt-mcp MCP server can be obtained from PyPI through `uvx` or run from the published GitHub Container Registry image; cloning the repository is not required for those installation paths.

## Setup and configuration

The backend requires Docker with Compose v2. Download the release Compose file and its indexing helper, set `ZOEKT_REPOS_DIR` to a parent directory containing the repositories to index, and run `docker compose up -d`. On macOS and Windows, the directory must be available through Docker Desktop file sharing.

The MCP client needs either `uv`/`uvx` or Docker. With uvx, configure the client to run `uvx zoekt-mcp`; with the container method, run `ghcr.io/radiovisual/zoekt-mcp:latest` using interactive stdio. Set `ZOEKT_URL` to the Zoekt webserver address, such as `http://localhost:6070`. When the MCP process runs inside Docker on Docker Desktop, use `host.docker.internal` rather than `localhost` to reach a host-side backend.

The README provides configurations for Claude Code, Claude Desktop, and Cursor. Server versions can be pinned in either installation path by selecting a package version or container tag. Restart the client after adding the MCP configuration so the tools are loaded.

## Tools and capabilities

- `search_code`: Search the Zoekt index and return structured file matches, lines, ranges, symbols, counts, and duration.
- `list_repos`: Enumerate repositories available from the configured Zoekt backend with branch and index metadata.
- `get_file`: Retrieve the content of a specified file and branch from a repository.
- Repository scoping: Restrict searches with Zoekt qualifiers such as `repo:project-a`.
- Symbol-aware queries: Search for definitions or references using Zoekt symbol query syntax when indexed symbol data is available.

## Limitations and notes

The backend must be running separately; zoekt-mcp does not start, stop, or refresh the Docker services. Search results depend on the contents of the Zoekt index, so changes to source repositories require the indexing workflow to run again. The server communicates with a Zoekt webserver rather than indexing files itself. Docker Desktop users must account for host networking and file-sharing rules when choosing the backend directory and URL.

_Full upstream README: https://allmcps.com/mcp/zoekt-mcp/readme_

