Codara
Semantic code search and read-only codebase retrieval for coding agents, over MCP.

Overview | Architecture | Install | MCP tools | CLI | Configuration | Development
Overview
Codara is a stdio MCP server that gives Claude Code, Codex, Antigravity (agy), and Pi three capabilities they lack out of the box:
- Semantic search. Find code by meaning. Codara embeds your repository with Voyage AI and ranks chunks by cosine similarity.
- Incremental indexing. One SQLite file per repository. Unchanged files are skipped and identical chunks reuse their stored embeddings.
- Read-only retrieval. Ask a question and a separate agent CLI investigates the repository, under read-only flags and a git change guard.
Exact-match search stays with the client agent's built-in grep.
Architecture

The MCP client talks to codara-mcp over stdio. Only the codara index subprocess writes the index at <repo>/.codara/index-v2.sqlite; every other tool reads it. codebase_retrieval delegates to an agent CLI through coding-agent-cli. Open docs/diagrams/architecture.html for the full-size view.
Data flow

Indexing walks the repository, chunks changed files into 30-line windows with 15 lines of overlap, embeds only new chunks, and upserts them into SQLite. Search embeds the query, scores it against the cached matrix, and flags hits whose files changed since indexing. Open docs/diagrams/data-flow.html for the full-size view.
Install
Requires Python 3.12+, uv, and a VOYAGE_API_KEY for indexing and search.
Install Codara as a plugin for your agent:
| Agent | Commands |
|---|
| Claude Code | claude plugin marketplace add sitien173/codara
claude plugin install codara-mcp@codara-mcp |
| Codex | codex plugin marketplace add https://github.com/sitien173/codara.git
codex plugin add codara-mcp@codara-mcp |
| Pi | pi install https://github.com/sitien173/codara |
| Antigravity | Clone the repository, then agy plugin install <clone>/plugin |
Each plugin starts the server with uvx --from git+https://github.com/sitien173/codara codara-mcp.
To run from a local checkout instead:
git clone https://github.com/sitien173/codara.git
cd codara
uv sync
uv run codara-mcp
python -m codara_mcp starts the same server.
[!TIP]
Build the index once before searching: uv run codara index <repository>, or call the index_update tool from your agent.
MCP tools
| Tool | Parameters | Result |
|---|
semantic_search | repository_path, query, path=".", top_k=10 (1-50), context_lines=0 (0-20) | hits: {path, start_line, end_line, score, stale, text}; index: {generation, last_indexed}; truncation metadata |
index_status | repository_path | {exists, model_key, files, chunks, embeddings, stale, next_step} |
index_update | repository_path, rebuild=false | {files_scanned, files_changed, files_deleted, chunks_embedded, chunks_reused, duration_ms} |
codebase_retrieval | repository_path, query | {answer, driver, duration_ms, repo_modified, git_check} plus truncation metadata |
semantic_search reads the index only and returns no hits for a path outside the repository. index_status compares file metadata and does not hash files. Only index_update writes the index.
Tool errors use these codes: INVALID_PATH, INVALID_ARGUMENT, INDEX_MISSING, INDEX_MODEL_MISMATCH, INDEX_BUSY, MISSING_API_KEY, EMBED_FAILED, TIMEOUT, RETRIEVAL_BUSY, REPO_MODIFIED, BINARY_NOT_FOUND, and INTERNAL_ERROR.
Retrieval safety
codebase_retrieval runs the configured agent CLI with driver-specific read-only flags, then compares git status and file hashes before and after the run. Any change returns REPO_MODIFIED. At most two retrievals run at once by default, and a retrieval started inside another retrieval is refused.
[!WARNING]
The git check is a guard, not an operating-system sandbox. It does not cover ignored files or paths outside the repository. The agy CLI has no flag to disable MCP servers, so that driver can still reach them.
CLI