
Code Index
Replaces blind grep and file-reading loops with a SQLite-backed code index that understands symbols, call graphs, and semantic search. Parses Python, TypeScript, JavaScript, Go, and Rust repos with tree-sitter, embeds chunks locally using jina-embeddings-v2-base-code, and serves 14 retrieval tools over MCP: symbol_lookup for exact names, code_search for conceptual queries, callers and callees for navigating dependencies, file_outline and module_outline for structure, and trace for full call graphs. Optional PostToolUse hook keeps the index fresh on every Edit or Write. No API keys, fully offline after the initial 600MB model download. Reach for this when your codebase is large enough that Claude wastes time searching instead of reasoning.
- tools
- 15
- transport
- STDIO
- env vars
- 6
- last updated
- May 14, 2026
Tools
15 toolsPublic tool metadata for what this MCP can expose to an agent.
code_searchHybrid (vector + FTS) search for conceptual queries (e.g., "auth flow", "where do we parse JSON").
Hybrid (vector + FTS) search for conceptual queries (e.g., "auth flow", "where do we parse JSON").
No parameter schema in public metadata yet.
symbol_lookupExact-name lookup of functions / classes / methods / types. Prefer over code_search for identifiers.
Exact-name lookup of functions / classes / methods / types. Prefer over code_search for identifiers.
No parameter schema in public metadata yet.
file_outlineSymbols (with signatures) in a file, in source order. Use instead of Read when you only need shape.
Symbols (with signatures) in a file, in source order. Use instead of Read when you only need shape.
No parameter schema in public metadata yet.
module_outlineSymbols across a directory subtree in one call. Use instead of looping file_outline.
Symbols across a directory subtree in one call. Use instead of looping file_outline.
No parameter schema in public metadata yet.
where_am_iGiven path + line, returns the innermost symbol and the full enclosing chain.
Given path + line, returns the innermost symbol and the full enclosing chain.
No parameter schema in public metadata yet.
get_symbol_bodyFull chunk for a symbol_id from symbol_lookup / code_search / file_outline.
Full chunk for a symbol_id from symbol_lookup / code_search / file_outline.
No parameter schema in public metadata yet.
get_symbol_bodiesBatch version of get_symbol_body (up to 20 ids per call).
Batch version of get_symbol_body (up to 20 ids per call).
No parameter schema in public metadata yet.
callersSymbols that CALL the given symbol. depth (1-5) expands transitively.
Symbols that CALL the given symbol. depth (1-5) expands transitively.
No parameter schema in public metadata yet.
calleesSymbols that the given symbol CALLS. depth (1-5) expands transitively.
Symbols that the given symbol CALLS. depth (1-5) expands transitively.
No parameter schema in public metadata yet.
referencesNon-call uses (subclasses, free identifier references). Companion to callers / callees.
Non-call uses (subclasses, free identifier references). Companion to callers / callees.
No parameter schema in public metadata yet.
traceBuild a call-graph tree from an entry symbol; flat=true returns nodes/edges for cheap LLM scans.
Build a call-graph tree from an entry symbol; flat=true returns nodes/edges for cheap LLM scans.
No parameter schema in public metadata yet.
file_importsFiles this file imports (direction=imports) or that import it (direction=imported_by).
Files this file imports (direction=imports) or that import it (direction=imported_by).
No parameter schema in public metadata yet.
recent_changesFiles touched in the last N git commits.
Files touched in the last N git commits.
No parameter schema in public metadata yet.
propose_renamev1: same-file rename. Returns an edit list the agent applies via its own Edit tool; refuses on clash.
v1: same-file rename. Returns an edit list the agent applies via its own Edit tool; refuses on clash.
No parameter schema in public metadata yet.
adminAdmin operations: op=init builds or refreshes the index; op=setup_check diagnoses hook wiring, embedder and host; op=install_hook wires the auto-reindex PostToolUse hook; op=stats gives read-only index statistics; op=verify runs an integrity sweep.
Admin operations: op=init builds or refreshes the index; op=setup_check diagnoses hook wiring, embedder and host; op=install_hook wires the auto-reindex PostToolUse hook; op=stats gives read-only index statistics; op=verify runs an integrity sweep.
No parameter schema in public metadata yet.
Sponsors
Configuration
CODE_INDEX_EMBEDDEREmbedder backend. Only 'jina' (local jina-embeddings-v2-base-code via sentence-transformers) is supported; the variable exists for future expansion.
CODE_INDEX_EMBED_MODELHuggingFace model id. Defaults to 'jinaai/jina-embeddings-v2-base-code'. Override only if you know the model is dim-compatible.
CODE_INDEX_EMBED_DIMEmbedding dimension. Defaults to 768 (matches jina-embeddings-v2-base-code). Must match the model's output dim.
CODE_INDEX_DBPath to the SQLite index database. Defaults to .claude/index.db relative to the working directory.
CODE_INDEX_EMBED_BATCHEncode batch size (default 32). Lower (e.g. 8 or 4) to reduce peak memory if the GPU OOMs on large files.
CODE_INDEX_EMBED_DEVICETorch device override: 'cpu', 'mps', or 'cuda'. Unset = auto-detect. Set 'cpu' to avoid Apple-Silicon MPS out-of-memory errors.
Readme
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)
- Parse your repo with tree-sitter (Python, TypeScript/JavaScript, Go, Rust).
- Chunk code per symbol and expand identifiers (
getUserAuthToken→get user auth token) so search matches both styles. - Embed each chunk locally with
jina-embeddings-v2-base-code(768-dim) via sentence-transformers. - Store symbols, chunks, vectors, and call/import edges in
.claude/index.db(SQLite + sqlite-vec + FTS5). - Serve 14 retrieval tools + 1 admin tool over MCP (see Tools).
- Stay fresh via an optional
PostToolUsehook that incrementally re-indexes touched files.
Tools
Retrieval
Details
- Repository
- github.com/achreftlili/code-index
- Categories
- Databases, AI & LLM Tools, Search & Web Crawling
- Package
mcp-code-index- Transport
- STDIO
- Registry
- MCP registry, active