# reflex-search/reflex [Health: Active]

**Category:** 🔎 Search & Data Extraction  
**Repository:** https://github.com/reflex-search/reflex  
**GitHub Stars:** 82  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/reflex-search-reflex

## Description
Local full-text code search for AI coding agents. Trigram-indexed, sub-100ms queries across large codebases, offline, 18 languages.

## Tools
Capabilities this server exposes over MCP:

- **search_code** — Full-text or symbol search with line numbers and context; `regex: true` for regular expressions; `mode: "count"` for match and file counts only
- **list_locations** — Fast file+line discovery (minimal tokens)
- **find_references** — Symbol definition + all usage sites in a single call; the primary code-navigation tool for AI agents
- **get_dependencies** — Imports of a file; `reverse: true` for the files that import it, `depth: N` to follow imports N levels
- **analyze** — Import-graph analysis: `kind` = `summary`, `hotspots`, `circular`, `unused` or `islands
- **search_ast** — Structure-aware search via Tree-sitter AST queries (slow; always pass `glob`)
- **gather_context** — Codebase structure and project-type summary
- **index_project** — Force an index run (rarely needed: every tool updates the index first)
- **check_index_status** — Report whether the index matches the files on disk, without updating it

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/reflex-search/reflex), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
npm install -g reflex-search
```

2. Add to Claude Code:

```sh
claude mcp add-json --scope user reflex '{"type":"stdio","command":"rfx","args":["mcp"],"alwaysLoad":true}'
```

3. Add to Claude Code:

```sh
claude mcp add-json --scope project reflex '{"type":"stdio","command":"rfx","args":["mcp"],"alwaysLoad":true}'
```

## Documentation

## What reflex-search/reflex does

reflex-search/reflex connects AI coding assistants to a local index of a project’s source files. Its MCP interface supports full-text and symbol search, file-and-line discovery, reference lookup, dependency inspection, import-graph analysis, AST queries, and codebase summaries. The project also provides a standalone `rfx` command-line interface for interactive searches, scripts, and JSON output.

The server is designed for offline use and returns deterministic results from the local checkout. It supports 18 languages and is particularly useful when an agent needs to find every use of a symbol, inspect module relationships, or search a large repository without loading unnecessary file content.

## How it works

Reflex builds a trigram-based index for fast text queries and uses Tree-sitter for symbol and syntax-aware operations. Search results can include line numbers and context, while location-only queries reduce returned content when an agent only needs file paths and line numbers.

The index is maintained automatically. Before answering, MCP tools update changed files or create a missing index; `index_project` can force a rebuild. `check_index_status` reports whether the index matches the files on disk without changing it. The `--no-update` option makes the MCP process answer from the existing index instead.

Identifiers match as whole names by default. Substring matching, case-insensitive search, regular expressions, result counts, generated-file inclusion, and lock-file inclusion are available through tool options. Generated and lock files remain excluded from normal results unless explicitly requested.

## Setup and configuration

Install the CLI with either npm or Cargo:

```bash
npm install -g reflex-search
cargo install reflex-search
```

From a project directory, create an index with `rfx index`. To expose the MCP interface, register a stdio server using command `rfx` and argument `mcp`. Claude Code can be configured with a user-wide or project-specific MCP registration. Other MCP-compatible clients can use the same stdio command and argument arrangement.

Most tools appear by default. Additional tools can be enabled in `~/.reflex/config.toml`:

```toml
[mcp]
extra_tools = ["search_ast", "gather_context"]
```

The index-management tools can be exposed with `rfx mcp --no-update`.

## Tools and capabilities

- `search_code` performs full-text or symbol searches, including regular expressions and count-only results.
- `list_locations` returns compact file-and-line matches.
- `find_references` combines a symbol definition with its usage sites.
- `get_dependencies` lists imports or reverse dependents, with configurable traversal depth.
- `analyze` reports import-graph summaries, hotspots, circular dependencies, unused components, or isolated sections.
- `search_ast` runs Tree-sitter AST queries; supplying a `glob` is required.
- `gather_context` summarizes project structure and type.
- `index_project` forces indexing, while `check_index_status` checks index freshness without updating it.

## Limitations and notes

AST queries are slower than ordinary indexed searches and should be narrowed with a glob. A one-off scan of a mid-sized repository may still be better served by ripgrep. Reflex is intended for cases where linear search is insufficient, such as symbol navigation, dependency analysis, and exhaustive searches across large trees.

The MCP tool list is intentionally limited by default because each advertised schema adds tokens to agent turns. Older names for counting, dependency, and import-graph operations remain accepted but are deprecated in favor of the consolidated tools and their options.

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

