Prototype · Preview: every server in the official registry, synced every 30 minutes. Sign in with Google to write reviews.Prototype · updated every 30 min
PopNx MCPMCP servers for people who use AI · explained in plain words

Code Index

by achreftliliversion 1.0.6i★ 1iRuns on your computer
Registry nameio.github.achreftlili/code-index

How to install

What it does

SQLite-backed hybrid (vector + FTS) code search index for Claude Code over MCP.

  • Connects Runs on your computer
  • Account or key No key needed
  • Category Developer tools

Install

Pick the AI app you use, then copy the settings.

Passed 2/3 checks · Runs on your computer · ✓ Commands checked Nov 14, 2026

First: which AI do you use?

Pick your app and the steps appear below.

Works with Claude, with some setup first

Install Python (uv) on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone

Let AI install it

Copy this message into a Claude chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server Code Index for Claude on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "code-index": { "command": "uvx", "args": [ "mcp-code-index" ] } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the Code Index tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install uv (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    uv --version
    • A version number such as uv … = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

  2. Open the Claude desktop app’s settings file

    SettingsDeveloperEdit Config

  3. Paste these settings and save the file

    {
      "mcpServers": {
        "code-index": {
          "command": "uvx",
          "args": [
            "mcp-code-index"
          ]
        }
      }
    }
  4. Quit Claude and open it again

  5. Try it

    Use Code Index and tell me what you can do for me, then show me one thing

    ✓ If Claude says it is using Code Index or shows a Code Index tool in the answer, you are connected

6 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

  • CODE_INDEX_EMBEDDER Embedder backend. Only 'jina' (local jina-embeddings-v2-base-code via sentence-transformers) is supported; the variable exists for future expansion.
  • CODE_INDEX_EMBED_MODEL HuggingFace model id. Defaults to 'jinaai/jina-embeddings-v2-base-code'. Override only if you know the model is dim-compatible.
  • CODE_INDEX_EMBED_DIM Embedding dimension. Defaults to 768 (matches jina-embeddings-v2-base-code). Must match the model's output dim.
  • CODE_INDEX_DB Path to the SQLite index database. Defaults to .claude/index.db relative to the working directory.
  • CODE_INDEX_EMBED_BATCH Encode batch size (default 32). Lower (e.g. 8 or 4) to reduce peak memory if the GPU OOMs on large files.
  • CODE_INDEX_EMBED_DEVICE Torch device override: 'cpu', 'mps', or 'cuda'. Unset = auto-detect. Set 'cpu' to avoid Apple-Silicon MPS out-of-memory errors.

Descriptions are as written by the maker.

Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version

ChatGPT cannot connect Code Index yet

Code Index runs on your computer, but ChatGPT can only connect servers that run on the web

What you can do instead

A · Use an app that can connect Code Index

  • Install Python (uv) on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone
  • Install Python (uv) on your computer first (one time)
  • Install Python (uv) on your computer first (one time)
  • Install Python (uv) on your computer first (one time)

B · Others in Developer tools that work with ChatGPT

Picked from the most used in the same category, only ones that connect by address with no key

Works with Claude Code, with some setup first

Install Python (uv) on your computer first (one time)

Let AI install it

Copy this message into a Claude Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server Code Index for Claude Code on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): claude mcp add --scope user code-index -- uvx mcp-code-index 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the Code Index tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install uv (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    uv --version
    • A version number such as uv … = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

  2. Open Terminal

    Mac: press Command+Space and type Terminal · Windows: open PowerShell

  3. Paste this command and press Enter

    claude mcp add --scope user code-index -- uvx mcp-code-index
  4. Type /mcp in Claude Code

    You should see Code Index listed as connected

  5. Try it

    Use Code Index and tell me what you can do for me, then show me one thing

    ✓ If Claude Code says it is using Code Index or shows a Code Index tool in the answer, you are connected

6 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

  • CODE_INDEX_EMBEDDER Embedder backend. Only 'jina' (local jina-embeddings-v2-base-code via sentence-transformers) is supported; the variable exists for future expansion.
  • CODE_INDEX_EMBED_MODEL HuggingFace model id. Defaults to 'jinaai/jina-embeddings-v2-base-code'. Override only if you know the model is dim-compatible.
  • CODE_INDEX_EMBED_DIM Embedding dimension. Defaults to 768 (matches jina-embeddings-v2-base-code). Must match the model's output dim.
  • CODE_INDEX_DB Path to the SQLite index database. Defaults to .claude/index.db relative to the working directory.
  • CODE_INDEX_EMBED_BATCH Encode batch size (default 32). Lower (e.g. 8 or 4) to reduce peak memory if the GPU OOMs on large files.
  • CODE_INDEX_EMBED_DEVICE Torch device override: 'cpu', 'mps', or 'cuda'. Unset = auto-detect. Set 'cpu' to avoid Apple-Silicon MPS out-of-memory errors.

Descriptions are as written by the maker.

Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with Cursor, with some setup first

Install Python (uv) on your computer first (one time)

Let AI install it

Copy this message into a Cursor chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server Code Index for Cursor on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "code-index": { "command": "uvx", "args": [ "mcp-code-index" ] } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the Code Index tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install uv (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    uv --version
    • A version number such as uv … = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

  2. Click this button to open Cursor

    Open in Cursor

    Cursor asks you to confirm; click Install

  3. Open the AI chat in Cursor in Agent mode

  4. Try it

    Use Code Index and tell me what you can do for me, then show me one thing

    ✓ If Cursor says it is using Code Index or shows a Code Index tool in the answer, you are connected

6 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

  • CODE_INDEX_EMBEDDER Embedder backend. Only 'jina' (local jina-embeddings-v2-base-code via sentence-transformers) is supported; the variable exists for future expansion.
  • CODE_INDEX_EMBED_MODEL HuggingFace model id. Defaults to 'jinaai/jina-embeddings-v2-base-code'. Override only if you know the model is dim-compatible.
  • CODE_INDEX_EMBED_DIM Embedding dimension. Defaults to 768 (matches jina-embeddings-v2-base-code). Must match the model's output dim.
  • CODE_INDEX_DB Path to the SQLite index database. Defaults to .claude/index.db relative to the working directory.
  • CODE_INDEX_EMBED_BATCH Encode batch size (default 32). Lower (e.g. 8 or 4) to reduce peak memory if the GPU OOMs on large files.
  • CODE_INDEX_EMBED_DEVICE Torch device override: 'cpu', 'mps', or 'cuda'. Unset = auto-detect. Set 'cpu' to avoid Apple-Silicon MPS out-of-memory errors.

Descriptions are as written by the maker.

Menu names checked against Cursor’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with VS Code, with some setup first

Install Python (uv) on your computer first (one time)

Let AI install it

Copy this message into a VS Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server Code Index for VS Code on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "servers": { "code-index": { "type": "stdio", "command": "uvx", "args": [ "mcp-code-index" ] } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the Code Index tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install uv (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    uv --version
    • A version number such as uv … = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

  2. Click this button to open VS Code

    Open in VS Code

    VS Code asks you to confirm; click Install

  3. Open the AI chat in VS Code in Agent mode

  4. Try it

    Use Code Index and tell me what you can do for me, then show me one thing

    ✓ If VS Code says it is using Code Index or shows a Code Index tool in the answer, you are connected

6 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

  • CODE_INDEX_EMBEDDER Embedder backend. Only 'jina' (local jina-embeddings-v2-base-code via sentence-transformers) is supported; the variable exists for future expansion.
  • CODE_INDEX_EMBED_MODEL HuggingFace model id. Defaults to 'jinaai/jina-embeddings-v2-base-code'. Override only if you know the model is dim-compatible.
  • CODE_INDEX_EMBED_DIM Embedding dimension. Defaults to 768 (matches jina-embeddings-v2-base-code). Must match the model's output dim.
  • CODE_INDEX_DB Path to the SQLite index database. Defaults to .claude/index.db relative to the working directory.
  • CODE_INDEX_EMBED_BATCH Encode batch size (default 32). Lower (e.g. 8 or 4) to reduce peak memory if the GPU OOMs on large files.
  • CODE_INDEX_EMBED_DEVICE Torch device override: 'cpu', 'mps', or 'cuda'. Unset = auto-detect. Set 'cpu' to avoid Apple-Silicon MPS out-of-memory errors.

Descriptions are as written by the maker.

Menu names checked against VS Code’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Other apps that use MCP, such as Windsurf, Zed or Gemini CLI, each add servers differently. See how in the app list.

See every app that uses MCP →

JSON settings are under “For developers” below

Stuck? Ask people who use Code Index💬 Discussion →
For developers: Terminal commands and JSON settings

Installed on your computer

Claude Code

claude mcp add --scope user code-index -- uvx mcp-code-index

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "code-index": {
      "command": "uvx",
      "args": [
        "mcp-code-index"
      ]
    }
  }
}

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "code-index": {
      "command": "uvx",
      "args": [
        "mcp-code-index"
      ]
    }
  }
}

VS Code (mcp.json)

{
  "servers": {
    "code-index": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mcp-code-index"
      ]
    }
  }
}

Values you fill in

  • CODE_INDEX_EMBEDDER env
    Embedder backend. Only 'jina' (local jina-embeddings-v2-base-code via sentence-transformers) is supported; the variable exists for future expansion.
  • CODE_INDEX_EMBED_MODEL env
    HuggingFace model id. Defaults to 'jinaai/jina-embeddings-v2-base-code'. Override only if you know the model is dim-compatible.
  • CODE_INDEX_EMBED_DIM env
    Embedding dimension. Defaults to 768 (matches jina-embeddings-v2-base-code). Must match the model's output dim.
  • CODE_INDEX_DB env
    Path to the SQLite index database. Defaults to .claude/index.db relative to the working directory.
  • CODE_INDEX_EMBED_BATCH env
    Encode batch size (default 32). Lower (e.g. 8 or 4) to reduce peak memory if the GPU OOMs on large files.
  • CODE_INDEX_EMBED_DEVICE env
    Torch device override: 'cpu', 'mps', or 'cuda'. Unset = auto-detect. Set 'cpu' to avoid Apple-Silicon MPS out-of-memory errors.

Descriptions are as written by the maker.

These settings are generated from the maker’s registry entry. If the README says otherwise, follow the README.

At a glance

Downloads per weeki
105/wk
Connection
Runs on your computer
Latest versioni
1.0.6
Published to registryi
May 15, 2026
Code last changedi
May 15, 2026
Maker
achreftlili
Packages
pypi: mcp-code-index
Registry status
Active

Which apps can use it

Based on how this server connects and on each app’s own docs, checked Nov 10, 2026.

Run on your computer in

ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast

All apps, with pros and cons →

Related guides

What it can do

Runs on your computer; the tool list appears in your AI app after you install it.

Basic checksi

We check information anyone can see; we have not read the code. Checks that do not apply are left out of the count. · Checked Nov 15, 2026

  • ✓ Pass

    Maker matches the repo

    The registry name was verified with the GitHub account achreftlili, which owns the repo

  • ! Caution

    Still maintained

    Code last changed 6 months ago, more than 6 months ago

  • ✓ Pass

    Has a licence

    Uses MIT

  • – Not applicable

    Endpoint responds

    This one runs on your computer; there is no internet endpoint

  • – Not applicable

    Sign-in with OAuth

    Runs on your computer and uses local settings instead

  • … Not checked yet

    No hidden instructions in tool descriptions

    Runs on your computer; we can only read tool lists from internet endpoints

Published vulnerabilities (OSV.dev)

Not checked yet

What we check → · JSON

Makers: ask for a re-check or report wrong info

Discussion

Ask, share a tip or report that it does not work. Sorted by what people marked helpful.

No posts yet. Be the first to ask or share.

Posts here are written by users, not the PopNx team.

Sign in to post

User reviews

No reviews yet

Sign in to write a review

Compared with others in Developer toolsi

  • More stars than 69% of the other 5921 servers in this category
  • Published to the registry more recently than 11% of the other 5921 servers in this category
  • Basic checks equal to or better than 44% of the other 5921 servers in this category

Compared with every active server in this category in the registry. Stars count only when the publisher owns the repo.

Common questions

Is Code Index safe?

It passed 2 of 3 applicable basic checks. We have not read the code. Before adding a key or token, see what access the server asks for and use a key with only the permissions you need.

What keys or codes does it need?

The registry does not list a required key, though some servers ask you to sign in on first use.

Does it run on my computer or in the cloud?

It runs on your computer. Your AI app starts it when needed, and data does not pass through the maker’s servers (unless it calls an online service itself).

Is it still maintained?

The GitHub repo last changed 6 months ago, and the latest version (1.0.6) reached the registry 6 months ago.

Which apps can use it?

Apps that support MCP, such as Claude Desktop, Claude Code, Cursor and VS Code. You also need Python (uv) on your computer.

What can I use instead?

In the same category: GitDiagram, Appllama, Cloudflare MCP, Omnara, Repowise

Similar alternatives

Same category, other makers, commands already checked. Official ones first, then by stars.

Reading a card:↓ Downloads per weeki★ GitHub starsiThree pillars: reviews · checks · usageiUpdated = latest version published to the registryi

GitDiagram

Architecture diagrams, explanations and Mermaid source for public GitHub repositories.

by ahmedkhaleel2004Widely used★ 18.9KUpdated 2 months ago

Runs in the cloud✓ service owner · gitdiagram.comTried by the PopNx team

Appllama

Study screens, flows and paywalls from top-earning iOS apps, then build from what wins.

by AppllamaWidely used★ 5.2KUpdated 3 months ago

Runs in the cloud✓ service owner · appllama.io

Cloudflare MCP

Cloudflare MCP servers

by cloudflareWidely used★ 4.5KUpdated 14 months ago

Runs in the cloud✓ service owner · mcp.cloudflare.comTried by the PopNx team

Omnara

Deploy durable AI agents with Omnara, an open-source managed-agent platform.

by omnara-aiWidely used★ 3.4KUpdated 2 months ago

Runs in the cloud✓ service owner · omnara.com

Repowise

Codebase intelligence for AI coding agents: graph, git history, docs, decisions, code health.

by repowise-devWidely used↓ 6.5K/wk★ 8.1K Stars for the whole repoUpdated 2 days ago

Computer or cloud✓ service owner · repowise.dev
  • GitDiagram — Runs in the cloud, nothing to install · No key needed
  • Appllama — Runs in the cloud, nothing to install · No key needed
  • Cloudflare MCP — Runs in the cloud, nothing to install · No key needed · In Claude’s directory
  • Omnara — Runs in the cloud, nothing to install · No key needed
  • Repowise — Cloud or install on your computer · No key needed

README from the maker

Open the README

Copied from the maker’s repo as written. PopNx MCP has not reviewed or endorsed it. HTML, images and scripts are removed. Links lead off this site.

code-index

A local, SQLite-backed code index for Claude Code, exposed over MCP. It replaces blind Read / Grep / Glob exploration with targeted retrieval — "where is parseAuthToken defined", "what calls Indexer.reindex_all", "find the rate-limiting code" — answered in milliseconds against an offline index.

No API keys. No external services. The embedder runs locally on your machine.

How it works (30-second tour)

  1. Parse your repo with tree-sitter (Python, TypeScript/JavaScript, Go, Rust).
  2. Chunk code per symbol and expand identifiers (getUserAuthToken → get user auth token) so search matches both styles.
  3. Embed each chunk locally with jina-embeddings-v2-base-code (768-dim) via sentence-transformers.
  4. Store symbols, chunks, vectors, and call/import edges in .claude/index.db (SQLite + sqlite-vec + FTS5).
  5. Serve 14 retrieval tools + 1 admin tool over MCP (see Tools).
  6. Stay fresh via an optional PostToolUse hook that incrementally re-indexes touched files.

Tools

Retrieval
ToolPurpose
code_searchHybrid (vector + FTS) search for conceptual queries (e.g., "auth flow", "where do we parse JSON").
symbol_lookupExact-name lookup of functions / classes / methods / types. Prefer over code_search for identifiers.
file_outlineSymbols (with signatures) in a file, in source order. Use instead of Read when you only need shape.
module_outlineSymbols across a directory subtree in one call. Use instead of looping file_outline.
where_am_iGiven path + line, returns the innermost symbol and the full enclosing chain.
get_symbol_bodyFull chunk for a symbol_id from symbol_lookup / code_search / file_outline.
get_symbol_bodiesBatch version of get_symbol_body (up to 20 ids per call).
callersSymbols that CALL the given symbol. depth (1-5) expands transitively.
calleesSymbols that the given symbol CALLS. depth (1-5) expands transitively.
referencesNon-call uses (subclasses, free identifier references). Companion to callers / callees.
traceBuild a call-graph tree from an entry symbol; flat=true returns nodes/edges for cheap LLM scans.
file_importsFiles this file imports (direction=imports) or that import it (direction=imported_by).
recent_changesFiles touched in the last N git commits.
propose_renamev1: same-file rename. Returns an edit list the agent applies via its own Edit tool; refuses on clash.
Admin
Tool / opPurpose
admin op=initBuild or refresh the index. Incremental by default; force=true rebuilds from scratch.
admin op=setup_checkDiagnose hook wiring + embedder + host. Round-trip-tests the hook end-to-end.
admin op=install_hookWire the auto-reindex PostToolUse hook into .claude/settings.json. Idempotent.
admin op=statsRead-only: file counts by language, symbol totals, embed model fingerprint, last-index time.
admin op=verifyIntegrity sweep: orphan rows, parse-failure files, dangling edges.

embed_query_debug is a dev-only ranking diagnostic, hidden from list_tools unless CODE_INDEX_DEBUG=1 is set.

All tools return bounded JSON; large bodies use get_symbol_body rather than inlining whole files.

Requirements

  • Python 3.10+ with loadable SQLite extension support (required by sqlite-vec).
  • Python 3.13 has this enabled by default.
  • On 3.10–3.12, install via the python.org installer or via pyenv with PYTHON_CONFIGURE_OPTS=--enable-loadable-sqlite-extensions pyenv install 3.12.x.
  • Homebrew Python often ships without the extension hook — use one of the two methods above instead.
  • `uv` / `uvx` (install) — recommended runner. Or pip if you prefer a permanent install.
  • ~600 MB free disk for the embedding model on first init.

Quick start (Claude Code)

One command, no API keys:

claude mcp add-json -s user code-index "$(cat <<'JSON'

{ "type": "stdio", "command": "uvx", "args": ["--refresh", "--from", "mcp-code-index", "code-index-mcp"] } JSON )"

Then open Claude Code in any repo and ask:

_"Build the code index for this repo."_

Claude calls the init MCP tool, which writes .claude/index.db. From then on, ask things like _"where is parseAuthToken defined?"_ or _"what calls Indexer.reindex_all?"_ — Claude routes them through symbol_lookup / callers / code_search instead of grepping.

What `--refresh` does — fetches the latest PyPI release on every Claude

Code launch. Convenient during preview; drop it once you want to pin a

version (saves ~1s of startup).

Project-only install — drop -s user to register the server in the

current project's .claude/settings.json instead of the global ~/.claude.json.

First-run model download — the first init pulls

jina-embeddings-v2-base-code (~600 MB) into ~/.cache/huggingface and

caches it forever. Subsequent runs are fully offline. If your network

blocks Hugging Face, pre-warm the cache from a machine that has access.

Already installed without `--refresh`? Run claude mcp remove code-index

first, then re-run the command above.

Alternative: permanent install (no uvx)
pip install mcp-code-index

claude mcp add -s user code-index -- code-index-mcp

Optional: keep the index live as you edit

Without a hook, the index drifts when files change outside the agent (mv, git checkout, IDE saves) until you call init again. With one, every Edit / Write / MultiEdit Claude performs triggers an incremental reindex of the touched file.

Easiest path: ask Claude. On first use in a new project, ask _"set up the code-index"_ — Claude calls setup_check → install_hook → init. The hook command is derived from how the MCP server was launched (uvx-aware), so it uses the same Python toolchain. Hook output goes to .claude/code-index-hook.log so failures are debuggable.

Manual install — add this block to the project's .claude/settings.json under hooks.PostToolUse (the version you want depends on how you launch the server — install_hook derives the right one for you):

{

"matcher": "Edit|Write|MultiEdit", "hooks": [ { "type": "command", "command": "uvx --with 'sentence-transformers<5' --with 'numpy<2' --from mcp-code-index code-index-hook" } ] }

In other MCP-compatible agents

The server speaks standard MCP over stdio, so any client that supports MCP servers works (Cursor, Continue, Cody, Zed, etc.). Configure the client to launch uvx --refresh --from mcp-code-index code-index-mcp (or code-index-mcp after pip install mcp-code-index). Once connected, call the init tool from inside the client to bootstrap the index. Drop --refresh when you want to pin to a stable version instead of always pulling latest.

From source (development)
git clone https://github.com/achreftlili/code-index

cd code-index pip install -e . code-index init # CLI alternative to the init MCP tool code-index-mcp # starts the MCP server on stdio (for manual wiring)

Configuration

All settings are optional — the defaults work out of the box. Override them via environment variables. Inside Claude Code, set them in the env block of your code-index server entry in ~/.claude.json (then reconnect the MCP server).

Common knobs (most users only ever touch these):

VarDefaultWhen to set it
CODE_INDEX_EMBED_DEVICE_auto_Force the torch device: cpu, mps, or cuda. Set cpu on Apple Silicon if init fails with MPS out-of-memory.
CODE_INDEX_EMBED_BATCH32Encode batch size. Lower (e.g. 8 or 4) to cut peak GPU memory while staying on mps/cuda.
CODE_INDEX_DB.claude/index.dbOverride the SQLite index path (e.g. to share an index across sibling worktrees).

Advanced (rarely needed):

VarDefaultNotes
CODE_INDEX_EMBEDDERjinaOnly jina (local sentence-transformers) is supported today; the variable exists for future expansion.
CODE_INDEX_EMBED_MODELjinaai/jina-embeddings-v2-base-codeHuggingFace model id. Only override if you know the model is dim-compatible (768d).
CODE_INDEX_EMBED_DIM768Must match the embedding model's output dimension.

Troubleshooting

`init` fails with `MPS backend out of memory` on Apple Silicon. A large file produced a chunk batch bigger than your GPU's free VRAM. Quickest fix — re-run on CPU (slower but bulletproof):

"env": {

"CODE_INDEX_EMBED_DEVICE": "cpu" }

To stay on the GPU, shrink the batch instead: "CODE_INDEX_EMBED_BATCH": "8". Reconnect the MCP server (/mcp → reconnect, or restart Claude Code) so the new env takes effect. init is incremental — already-embedded files are skipped on the retry.

`init` fails with a Hugging Face network error on first run. Your network is blocking model downloads. Pre-warm the cache on a machine that has access:

huggingface-cli download jinaai/jina-embeddings-v2-base-code

then copy ~/.cache/huggingface/ to the offline machine

`sqlite3.OperationalError: not authorized` or `sqlite-vec` fails to load. Your Python build doesn't have loadable SQLite extensions. See Requirements — install via python.org or a pyenv build with PYTHON_CONFIGURE_OPTS=--enable-loadable-sqlite-extensions.

`code_search` / `symbol_lookup` returns stale paths after a refactor or branch checkout. The auto-reindex hook only fires on Claude's Edit / Write / MultiEdit. After bulk file moves outside the agent (mv, git checkout, IDE rename), re-run init (it's incremental). Or wire up the hook so the index keeps up with agent edits automatically.

Layout

src/code_index/

db.py SQLite schema, connection, sqlite-vec loading parser.py Tree-sitter wrapper, symbol + edge extraction imports.py Per-language import target → file path resolution chunker.py Per-symbol chunks, identifier expansion embedder.py Local Jina (sentence-transformers) backend indexer.py Pipeline: walk → parse → chunk → embed → write reindexer.py Per-root engine cache; one entry point for "reindex one file" retriever.py Hybrid search (vector + FTS5) with RRF watcher.py File watcher (watchdog) admin.py setup_check / install_hook / init logic (pure, no MCP state) mcp_server.py MCP wiring, shared helpers, schema fragments tool_registry.py Shared @_tool decorator + _TOOLS registry tools/ Per-domain MCP handlers (graph, paths, refactor, …) hook.py code-index-hook console script — the PostToolUse entry point cli.py init / r

Only the beginning is shown; read the rest in the repo