codesearch MCP

codesearch searches code across several repositories with hybrid retrieval and runs fully offline, without a GPU or Docker.

  • 103 ★ on the repository
  • Last commit
MCP server

Minimal access

Why this level

  • Index and search run locally, but the optional hooks can block edits and grep.
All reasons and checks

flupkede/codesearch

Install

Manual install

curl -fsSLO https://github.com/flupkede/codesearch/releases/latest/download/install.sh && bash install.sh && rm install.sh

The Linux and macOS option from the README. Windows has `install.ps1`, and the agent runs `codesearch mcp`.

Access and checks

How we review

Minimal accessThe tool runs nothing and makes no network calls.

  • Index and search run locally, but the optional hooks can block edits and grep.

This is third-party code. Review the repository files before installing.

What it does

Rust-based MCP server that builds a local repository index and gives the agent semantic and literal search. Vector embeddings are fused with full-text BM25 through Reciprocal Rank Fusion, and code is split along function and class boundaries by tree-sitter for 17 languages. Beyond search there is symbol navigation: definitions, usages, imports and dependents. In `serve` mode one server holds a group of repositories and merges query results. Replies are compact by default; the agent fetches full code with a separate `get_chunk` call.

Who it is for. Developers whose agent works in a large codebase or several repositories and burns tokens scanning files.

Good fit when

  • The agent looks for where a function is implemented and grep by name is not enough.
  • Several repositories belong to one task and search must cover the whole group.
  • Before renaming a symbol you need the list of call sites (`find_impact`).
  • Code cannot go to cloud indexers and the machine has no GPU.
  • Search must be wired into OpenCode, Claude Code or Cursor with one `codesearch mcp` command.

Not a fit when

  • The file is known in advance and plain reading or grep is enough.
  • Large repositories cannot be indexed on a weak machine.
  • A full code knowledge graph is needed rather than lightweight search.

Example request

Find where this project handles payment retries and show which files depend on that function.

MCP

Transport
stdio, http
Authentication
not required

Limitations

The first indexing takes 2–5 minutes, later runs update only changed files. Switching the embedding model requires a full reindex with `--force`. Precise `find_impact` call-site search covers C# and TypeScript; other languages fall back to lexical `find`. The optional `grep-guard` and `edit-guard` hooks block grep and edits until codesearch is consulted, so enable them deliberately. The installer downloads a prebuilt binary from releases.

How to disable. Remove the `codesearch` entry from the agent's MCP configuration and stop `codesearch serve` if running. Delete the index in `~/.codesearch` and any installed hooks separately.

FAQ

How does serve differ from mcp?

`codesearch mcp` serves one repository and watches files itself. `codesearch serve` holds several repositories over HTTP and merges search results.

Is a GPU or Docker required?

No. The server runs on CPU, downloads no models at runtime and ships as a static binary.

Which tools does the agent see?

The main ones are `search`, `find`, `explore`, `get_chunk`, `find_impact` and `status`. Search runs in `semantic` and `literal` modes.

How do I change the embedding model?

Pass `--model` and rebuild the index with `--force`, for example `codesearch --model embeddinggemma-q4 index <path> --force`.

Where is the index stored?

The repository registry lives in `~/.codesearch/repos.json` and indexes are created locally. Listing and cleanup use `codesearch index list`, `rm` and `prune`.

Discussion

No questions or reviews yet.

A Rust MCP server and CLI with a call graph and hybrid semantic code search for Claude Code and Codex

MCP serverExtended access760Repository stars
Official

Local search and MCP server for agents: one Rust binary that indexes code, docs and logs

MCP serverBroad access18.9KRepository stars

An MCP server that indexes a local repository with tree-sitter and gives the agent code search, file lookup and a structure summary of a file

MCP serverExtended access1KRepository stars
Official

An MCP server and CLI for code research: search and understand your project and all of GitHub with fewer tokens

MCP serverExtended access959Repository stars

Source search ranks matches using code structure and gives agents relevant snippets without a separate search index.

CLIExtended access1.1KRepository stars

A local codebase index for agents: hybrid search, dependency graphs and change impact analysis

MCP serverExtended access3.4KRepository stars

Comparison with similar tools

Cards that share the main search query, and how they differ.

ToolOfficialAuthenticationRepository starsMain difference
codesearch (this card)nonot required103
Claude ContextyesAPI key12,689indexes code through an external vector database; codesearch keeps the index local and merges several repositories
Serenanonot required31,301offers symbol navigation through language servers; codesearch adds hybrid semantic search

README in short

One index per repository, semantic and literal search, symbol navigation and a `serve` mode for a group of repositories. Everything runs locally.

README badge

Report a problem