Add dynamic MCP tools: list_indexes, index_repo, delete_index #15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds dynamic index management capabilities to the MCP server, allowing agents to create, list, and delete indexes on-demand.
New MCP Tools
list_indexesindex_repodelete_indexKey Changes
1. Dynamic MultiIndexRunner (
src/search/multi-index-runner.ts)readonly)refreshIndexList()to reload indexes after creation/deletioninvalidateClient(indexName)to clear cached SearchClient after updates2. MCP Server (
src/mcp/mcp-server.ts)index_repo/delete_index, automatically refreshes runner state3. Tool Descriptions (
src/mcp/tool-descriptions.ts)withIndexesReference()that appends "Use list_indexes to see available indexes."4. CLI (
src/bin/cmd-mcp.ts)Architecture: Three-Layer Context Model
This feature enables the "exploration layer" in our context hierarchy:
Testing
Configuration Note
For dynamic indexing to work, the MCP server must be started without
-iflags:ctxc mcp stdio # Uses writable FilesystemStoreWith
-iflags, it usesCompositeStoreReader(read-only) andindex_repo/delete_indexwill fail.Commits
4981a79- Support dynamic index list in MultiIndexRunner427a1bc- Add list_indexes tool to MCP server2ea4cdf- Add index_repo tool to MCP server6447099- Add delete_index tool to MCP server35f06b1- Allow MCP server to start with zero indexesPull Request opened by Augment Code with guidance from the PR author