# Code Index

A local MCP server indexes source trees and searches them with Zoekt. Use it when an agent needs to locate code across a project.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 7
- Author: trondhindenes
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/trondhindenes/code-index-mcp
- Updated: 2025-11-30
- HTML: https://affpapa.org/en/nevibecode/mcp/trondhindenes-code-index

## What it does

Code Index keeps a separate index for each directory you add and exposes code search through Zoekt. Queries can use regular expressions, file and language filters, Boolean operators, and case-sensitive matching. Results use a compact grep-style format with file paths, line numbers, and matched text.

The server provides `index_directory`, `search_code`, `list_indexes`, `delete_index`, and `index_info`. Index data is stored in the user profile, with `CODE_INDEX_DIR` available to change that location. It runs on macOS and Linux, while indexing skips hidden directories, build folders, binaries, and common document files.

For Claude Code, install the binary with Go and register it using `claude mcp add --scope user --transport stdio code-index /path/to/code-index-mcp`. Files under skipped directories are outside the search index, so results will not include code from `node_modules` or `dist`.

## Install

### Claude Code (native platform)

**Install**
- The MCP registry has no launch command for it: see the repository README

## When to use it
- index a local source directory
- search code with a regular expression
- filter matches by language or file name
- list the directories already indexed
- remove one directory index

## Example prompts
- Index `/Users/me/projects/myapp` so I can search its source code.
- Find every `MyFunc` match in `.go` files and include the matching line numbers.
- Search Python files for the `Model` class while excluding test files.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 392262
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33989
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81163
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119231
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47577
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43902

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
