A local MCP server that builds and queries an offline SQLite code index for repositories, using tree-sitter parsing, local embeddings, and call/reference graphs to answer code-location and dependency questions quickly. It also supports incremental reindexing via an optional Claude Code hook.
From the registry: SQLite-backed hybrid (vector + FTS) code search index for Claude Code over MCP.
$ PYTHON_CONFIGURE_OPTS=--enable-loadable-sqlite-extensions pyenv install <python-version>Please install the `code-index` MCP server into my current AI client (that's you).
Required prerequisites (do these first if not already done):
- **Install Python 3.10+ with loadable SQLite extension support** — Python 3.10 or newer is required, and the Python build must support loadable SQLite extensions for sqlite-vec. Python 3.13 enables this by default. For Python 3.10–3.12, use the python.org installer or install via pyenv with loadable SQLite extensions enabled. Homebrew Python may not work for this requirement. Run: `PYTHON_CONFIGURE_OPTS=--enable-loadable-sqlite-extensions pyenv install <python-version>`
- **Install uv / uvx** — Install uv/uvx, which is the recommended way to run the MCP server. (https://docs.astral.sh/uv/getting-started/installation/)
- **Ensure disk space for first model download** — The first index initialization downloads the jina-embeddings-v2-base-code model and needs about 600 MB of free disk space. Subsequent runs are offline using the cached model.
Canonical MCP server config (stdio transport):
- command: `uvx`
- args: ["--refresh","--from","mcp-code-index","code-index-mcp"]
- optional environment variables:
- `CODE_INDEX_EMBED_DEVICE`: Force the embedding device. Useful values include cpu, mps, or cuda. Set to cpu if Apple Silicon MPS runs out of memory. (example: `<cpu|mps|cuda>`)
- `CODE_INDEX_EMBED_BATCH`: Embedding batch size. Lower this to reduce peak GPU memory usage. (example: `<batch-size>`)
- `CODE_INDEX_DB`: Override the SQLite index database path. (example: `<path-to-index-db>`)
- `CODE_INDEX_EMBEDDER`: Embedding backend selection. Only jina is supported currently. (example: `<embedder-name>`)
- `CODE_INDEX_EMBED_MODEL`: Hugging Face model ID for embeddings. Only override if using a compatible 768-dimensional model. (example: `<huggingface-model-id>`)
- `CODE_INDEX_EMBED_DIM`: Embedding output dimension. Must match the configured embedding model. (example: `<embedding-dimension>`)
- `CODE_INDEX_DEBUG`: Enable the dev-only embed_query_debug tool in list_tools output. (example: `1`)
Note: Preferred install path is stdio via uvx. After connecting the server, call the admin init tool from inside the MCP client to build the local index. A permanent alternative install exists via pip install mcp-code-index and command code-index-mcp, but uvx is the simplest portable path.
Add this MCP server to my current client's config in the correct format for you. If you need secrets or credentials I haven't provided, ASK me — do not invent values or leave raw placeholders. After adding it, tell me how to verify the server is connected.CODE_INDEX_EMBED_DEVICEForces the embedding device (cpu, mps, cuda).CODE_INDEX_EMBED_BATCHSets the embedding batch size to reduce memory use.CODE_INDEX_DBOverrides the SQLite index file path.CODE_INDEX_EMBEDDERSelects the embedder backend; currently only jina is supported.CODE_INDEX_EMBED_MODELOverrides the Hugging Face embedding model id.CODE_INDEX_EMBED_DIMSets the embedding dimension to match the model output.CODE_INDEX_DEBUGEnables the dev-only embed_query_debug tool in list_tools.MCP server for searching Airweave collections with natural language queries.