index_repository
Index a code repository into a persistent knowledge graph for code intelligence. Supports semantic modes, cross-repo linking, and async background indexing.
Instructions
Index a repository. full/moderate add semantics; fast omits them; cross-repo-intelligence links services. Reports coverage gaps. Waits for the whole index by default; a large repo can exceed a client's per-call deadline. async:true starts (or joins) the index in the daemon and returns at once; poll with status:true (same repo_path) until state is succeeded, failed or cancelled. async needs a daemon that outlives the call: an MCP session or daemon start.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | full: all+semantic; moderate: filtered+semantic; fast: filtered only; cross-repo-intelligence: link services. | full |
| name | No | Name override; Non-ASCII bytes are encoded; unsafe characters normalized. | |
| async | No | Start the index in the background and return immediately; it keeps running if this call is cancelled or times out. Not with status or cross-repo-intelligence. Refused for a one-shot cli call that is the only client of a temporary daemon (run daemon start). | |
| status | No | Report the running or last index job (queued/running/succeeded/failed/cancelled) instead of indexing. Pass the same repo_path (and name, if any) as the index call. | |
| repo_path | Yes | Repository path | |
| persistence | No | Write .codebase-memory/graph.db.zst. | |
| doc_candidates | No | Doc-code candidates; default: the doc_candidates setting, else on for full, off for moderate/fast. | |
| target_projects | No | Cross-repo targets; ["*"] means all. |