Code Index logo

Code Index

Indexes local code in SQLite for semantic search, symbol lookup, call tracing, file outlines, and targeted code retrieval over MCP.

Install Code Index

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

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "code-index-2": {
      "command": "uvx",
      "args": [
        "--with",
        "sentence-transformers<5",
        "--with",
        "numpy<2",
        "--from",
        "mcp-code-index",
        "code-index-hook"
      ]
    }
  }
}

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

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

uvx --with sentence-transformers<5 --with numpy<2 --from mcp-code-index code-index-hook

Process exited before answering initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

Code Index MCP server builds a local SQLite index of repository symbols, embeddings, files, and call/import relationships. It combines vector search with full-text search, while also exposing exact symbol lookup, outlines, call-graph inspection, and bounded symbol retrieval over standard MCP stdio. Reach for it when an agent needs targeted code navigation across Python, TypeScript/JavaScript, Go, or Rust without repeatedly scanning whole files. An optional Claude Code hook incrementally reindexes files changed through agent edits.

Use cases

  • Search a repository for conceptual code paths
  • Locate exact function, class, or type definitions
  • Trace callers and callees across symbols
  • Inspect file and module structure without reading whole files
  • Reindex files changed by Claude Code edits

Key features

  • Hybrid vector and full-text code search
  • Exact symbol lookup and bounded symbol retrieval
  • File, module, and source-location outlines
  • Caller, callee, reference, and call-tree analysis
  • SQLite-backed local index with optional incremental reindexing
  • Same-file rename proposal generation

Tools14

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

Self-reported~335 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.

15/19 checks healthy over the last 112d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 7d ago via OSV.dev · mcp-code-index (PyPI)

Adoption & maintenance

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

GitHub stars1Stargazers on the source repository.
Last commit6mo agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Tools exposed14Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Code Index works

What Code Index MCP server does

Code Index MCP server turns a local repository into a searchable code index for MCP-compatible agents. It parses Python, TypeScript/JavaScript, Go, and Rust source with tree-sitter, breaks code into symbol-oriented chunks, expands identifiers for search, and stores the resulting metadata in .claude/index.db.

The index contains symbol records, local embeddings, full-text search data, and call/import relationships. Search runs without API keys or external services after the embedding model has been downloaded and cached. Results are returned as bounded JSON, with full symbol content available through dedicated retrieval tools rather than being inserted into every search response.

How it works

During initialization, the server parses the repository and creates embeddings with the local jina-embeddings-v2-base-code model through sentence-transformers. SQLite, sqlite-vec, and FTS5 support vector and keyword retrieval. Conceptual questions such as locating authentication or JSON parsing logic use hybrid search; exact function, class, method, and type names should use symbol lookup instead.

The server also records relationships between symbols and files. Agents can inspect callers, callees, non-call references, call trees, imports, reverse imports, and files changed in recent Git commits. A location query can identify the innermost symbol and its enclosing chain for a given path and line.

Setup and configuration

The runtime requires Python 3.10 or newer with loadable SQLite extension support, plus uv/uvx or pip. The first initialization needs roughly 600 MB of disk space for the embedding model. Python 3.13 includes the needed SQLite capability by default; Python 3.10–3.12 may require a python.org installation or a pyenv build configured with loadable SQLite extensions.

Install the package with uvx or pip, then register code-index-mcp as a stdio MCP server. From an MCP client, call the administrative init operation to build the index. The default database path is .claude/index.db. Optional environment variables can select the embedding device, change embedding batch size, or override the database location.

An optional PostToolUse hook watches Claude Code Edit, Write, and MultiEdit operations and incrementally reindexes touched files. Without the hook, changes made outside the agent can leave the index stale until initialization runs again.

Tools and capabilities

The retrieval interface includes code_search, symbol_lookup, file_outline, module_outline, where_am_i, get_symbol_body, and batched symbol-body retrieval. Relationship tools include callers, callees, references, trace, and file_imports. recent_changes reports files touched in recent commits, while propose_rename produces a same-file edit list and rejects name clashes.

Administrative operations support initialization, setup diagnostics, hook installation, statistics, and integrity verification. A hidden development ranking diagnostic can be enabled with CODE_INDEX_DEBUG=1.

Limitations and notes

propose_rename is limited to same-file renames and does not apply edits itself; the agent must use its own edit capability. The embedding model must be downloaded on first use, although later operation can be offline. Index freshness is not automatic for arbitrary editor saves, moves, or checkouts unless the optional hook is configured or initialization is run again. Python support also depends on a SQLite build that can load extensions.

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 Code Index

Code Index is an MCP server that connects MCP-compatible coding agents to a local SQLite code index. Its main tools provide hybrid conceptual search, exact symbol lookup, file and module outlines, symbol bodies, call and reference tracing, import analysis, recent changes, and same-file rename proposals.

Install it with uvx or pip, then register the code-index-mcp command as a stdio MCP server. The documented Claude Code setup uses uvx with the mcp-code-index package; after connecting, call the init operation inside a repository to create its index.

Yes, Code Index works with Cursor because it speaks standard MCP over stdio. Configure Cursor to launch the package with uvx or the installed code-index-mcp command, connect the server, and call init from the client to bootstrap the repository index.

Code Index can use an optional Claude Code PostToolUse hook to incrementally reindex files changed by Edit, Write, or MultiEdit operations. Changes made by an IDE, checkout, move, or other process require running init again unless they are handled by another supported workflow.

Code Index parses Python, TypeScript/JavaScript, Go, and Rust with tree-sitter.

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 PreviewCode Index AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/code-index-2?style=directory)](https://allmcps.com/mcp/code-index-2)
HTML Embed
<a href="https://allmcps.com/mcp/code-index-2"><img src="https://allmcps.com/api/badge/code-index-2?style=directory" alt="Code Index on AllMCPs" /></a>