localnest_index_project
Build or refresh semantic indexes for codebases to enable AI agents to search and analyze projects locally, keeping all data on your machine.
Instructions
Build or refresh semantic index for a project or across all roots.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | No | ||
| all_roots | No | ||
| force | No | ||
| max_files | No | ||
| response_format | No | json |
Implementation Reference
- src/mcp/tools/retrieval.js:193-212 (handler)The handler implementation for localnest_index_project which invokes vectorIndex.indexProject.
async ({ project_path, all_roots, force, max_files }, extra) => { await emitProgress(extra, 0, max_files, 'index_project started'); const out = await vectorIndex.indexProject({ projectPath: project_path, allRoots: all_roots, force, maxFiles: max_files, onProgress: async ({ scanned = 0, total = max_files, phase = 'indexing' }) => { await emitProgress(extra, scanned, total, phase); } }); await emitProgress( extra, out.scanned_files || out.total_files || max_files, out.scanned_files || out.total_files || max_files, 'index_project completed' ); return normalizeIndexProjectResult(out, max_files); } ); - src/mcp/tools/retrieval.js:175-192 (registration)Registration of localnest_index_project tool in src/mcp/tools/retrieval.js.
registerJsonTool( 'localnest_index_project', { title: 'Index Project', description: 'Build or refresh semantic index for a project or across all roots.', inputSchema: { project_path: z.string().optional(), all_roots: z.boolean().default(false), force: z.boolean().default(false), max_files: z.number().int().min(1).max(200000).default(20000) }, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false } },