seroost_set_index
Configure the root directory for semantic code search indexing to enable natural language queries across your codebase.
Instructions
Configure the target directory for Seroost indexing. This sets the root path that will be indexed when the index command is run. Must be called before indexing to specify which codebase directory to search.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to the directory containing the codebase to index. This directory and all its subdirectories will be searchable after indexing. |
Implementation Reference
- src/commands.ts:4-8 (handler)Core handler function that executes the tool logic by spawning the 'seroost' binary with arguments ['-i', path] via runSeroost.export function setIndex(path: string){ const args = ['-i', path]; return runSeroost(args) }
- src/index.ts:57-63 (schema)Zod input schema defining the 'path' parameter as a string with description.{ path: z .string() .describe( "Absolute path to the directory containing the codebase to index. This directory and all its subdirectories will be searchable after indexing." ), },
- src/index.ts:54-87 (registration)Full MCP server.tool registration for 'seroost_set_index', including name, description, schema, and thin async handler wrapper that delegates to setIndex.server.tool( "seroost_set_index", "Configure the target directory for Seroost indexing. This sets the root path that will be indexed when the index command is run. Must be called before indexing to specify which codebase directory to search.", { path: z .string() .describe( "Absolute path to the directory containing the codebase to index. This directory and all its subdirectories will be searchable after indexing." ), }, async ({ path }) => { try { let output = await setIndex(path); return { content: [ { type: "text", text: output ? "success" : "no output returned", }, ], }; } catch (error) { return { content: [ { type: "text", text: "failure", }, ], }; } } );
- src/commands.ts:24-45 (helper)Helper utility function that spawns the 'seroost' child process, captures stdout/stderr, and resolves with output on success.function runSeroost(args: string[]) { return new Promise((resolve, reject) => { const proc = spawn("seroost", args); let out = ""; let err = ""; proc.stdout.on("data", (d) => (out += d.toString())); proc.stderr.on("data", (d) => (err += d.toString())); proc.on("close", (code) => { if (code === 0) { try { resolve(out); } catch { reject(new Error("Invalid JSON from Seroost: " + out)); } } else { reject(new Error(err || "Seroost failed")); } }); }); }