CodeLens logo

CodeLens

Branch-aware local code search, symbol indexing, and static relationship analysis through MCP and a CLI.

Install CodeLens

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "fodx-codelens": {
      "command": "npx",
      "args": [
        "-y",
        "@fodx/codelens"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Install not yet sandbox-tested— the server itself is confirmed live (we called its tools/list endpoint). The stdio install command is a separate, ongoing check.

Overview

CodeLens builds a separate SQLite index for each repository branch or worktree, combining FTS5 search, tree-sitter symbols, and static source-graph edges. Its MCP tools support discovery, file expansion, dependency analysis, architecture navigation, change impact checks, and saved investigation contexts without using a chat LLM. Reach for it when an agent needs compact, explainable repository context before reading or modifying code.

Use cases

  • Search a branch before opening files
  • Trace static relationships between symbols
  • Assess blast radius before changing shared code
  • Map working-tree changes to affected tests
  • Save and reload an investigation context

Key features

  • Branch-isolated SQLite indexes
  • FTS5, symbol, and graph-based search
  • Static callers, dependencies, and impact analysis
  • Architecture groups, paths, and reading tours
  • Exact on-disk source expansion
  • Persistent named working contexts

Tools19

What CodeLens lets your agent do. Expand a tool for its parameters.

Verified live~3.7k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

11/11 checks healthy over the last 41d

What it can do

From the 19 tools this server returned when we ran it.

Can delete or modify data · 2Read-only tools · 17
Network at startup3 connections
Files written at startup7
Install scriptsNone
npm provenanceSigned build
Package age130 days
Maintainers1

Observed 2026-10-27 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 6d ago via OSV.dev · @fodx/codelens (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars4Stargazers on the source repository.
npm downloads577Package downloads in the last 30 days.
Last commit1mo agoMost recent push to the default branch.
Tools exposed19Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How CodeLens works

What CodeLens does

CodeLens indexes a repository's current branch or worktree into SQLite and exposes the resulting code model through an MCP server and command-line interface. The index combines lexical search with tree-sitter symbol extraction and source relationships such as imports, tests, calls, inheritance, definitions, and file membership. Each branch or worktree has its own index, preventing results from crossing branch boundaries.

Results are returned as compact handles and ranked matches rather than large blocks of raw source. The server can connect code to repository-local Markdown references, preserve named working contexts across index rebuilds, and maintain separate indexes for multiple repositories. Retrieval is deterministic and does not require a chat model.

How it works

Use cl_current first to inspect repository, branch, index, and freshness state. cl_refresh scans files and rebuilds or updates the active index. Search tools can automatically refresh changed files before answering, while responses identify pending or stale data when work is limited by freshness or execution bounds.

cl_search combines FTS5 BM25 ranking, symbol-name matches, and graph proximity. cl_explore packages search results by file with previews, collapsed signatures, and a relationship map for broader questions. After locating a target, cl_expand reads the current file directly from disk, so its content is not taken from potentially stale stored text.

Graph-oriented tools operate on static evidence. cl_related expands relationships, cl_path finds bounded chains between files or symbols, and cl_impact estimates callers, callees, affected files, tests, and documents. cl_diff maps working-tree changes to indexed symbols and related code. cl_overview groups dependency communities, hubs, cross-group links, and cycles, while cl_tour creates a bounded, evidence-backed reading sequence.

Setup and configuration

The installer supports macOS, Linux, and Windows and requires Node.js 22.5 or newer. It installs the codelens launcher, builds the application, and can configure detected MCP hosts automatically. Use the shell installer on macOS or Linux and the PowerShell installer on Windows, then open a new terminal.

codelens install can target all detected hosts or selected hosts, and can write either global or project-local configuration. The installer supports Claude Code, Cursor, Gemini CLI, Kiro, opencode, and Codex CLI. codelens --check-install verifies SQLite FTS5 and parser grammars without changing indexes. Native dependencies include better-sqlite3, tree-sitter, and language grammar packages; restricted npm install scripts may require reviewed approval and a rebuild.

Tools and capabilities

  • Check index state with cl_current, statistics with cl_stats, and runtime health with cl_doctor.
  • Refresh indexes with cl_refresh, search with cl_search, and explore repositories with cl_explore or cl_map.
  • Inspect relationships with cl_related, cl_path, cl_impact, cl_diff, cl_overview, and cl_tour.
  • Read exact source ranges using cl_expand.
  • Save and reload named investigation sets through cl_save and cl_load.
  • Review aggregate tool usage with cl_usage, remove expired indexes with cl_prune, and explicitly delete eligible indexes with cl_drop.

Limitations and notes

The graph describes static relationships, not runtime execution. Symbol resolution may omit unsupported language constructs, and broad file dependencies can appear separately from proven symbol callers. Relationship confidence is a conservative chain heuristic rather than a probability. Results can be truncated or stale, so callers should inspect freshness, gaps, and truncation fields.

cl_diff analyzes base-commit changes against the working tree, including untracked files; it is not limited to staged changes and is not a safety verdict. Removed code has unknown historical impact. Parser failures leave text search available but can remove symbols and parser-derived graph edges for affected languages. Saved contexts use a separate database and survive core-index rebuilds, while inactive indexes are subject to automatic TTL cleanup.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about CodeLens

CodeLens is an MCP server that connects AI clients to local repository indexes and static code relationships. Its main tools search code, expand exact file ranges, inspect imports and callers, analyze change impact, map architecture, and save investigation contexts. Indexing uses SQLite, FTS5, tree-sitter, and deterministic graph analysis without a chat LLM.

Run the platform installer, then use `codelens install` to configure detected MCP clients or selected targets. Node.js 22.5 or newer is required. Run `codelens --check-install` after installation to test SQLite FTS5 and language parser dependencies.

Yes, CodeLens supports Cursor through its installer. Use `codelens install --target cursor` and choose global or project-local configuration with the location option. Cursor's generated configuration attaches the server to the active workspace.

No, CodeLens performs retrieval and static graph analysis deterministically without a chat LLM. The MCP client supplies its own model, while CodeLens provides indexed search results, source ranges, relationship evidence, and analysis data.

Call `cl_current` first to inspect the active repository, branch, index, and freshness status. If it reports indexing, wait and retry rather than immediately refreshing. Use `cl_refresh` when the current branch needs a new or updated index.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewCodeLens AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/fodx-codelens?style=directory)](https://allmcps.com/mcp/fodx-codelens)
HTML Embed
<a href="https://allmcps.com/mcp/fodx-codelens"><img src="https://allmcps.com/api/badge/fodx-codelens?style=directory" alt="CodeLens on AllMCPs" /></a>