Add index discovery mode to support online index creation#15
Draft
richhankins wants to merge 27 commits intomainfrom
Draft
Add index discovery mode to support online index creation#15richhankins wants to merge 27 commits intomainfrom
richhankins wants to merge 27 commits intomainfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview
This PR adds dynamic index discovery to the context-connectors MCP server, enabling agents to see new indexes as they're added by users without restarting the MCP server.
Two Modes
ctxc mcp stdio -i pytorch -i reactctxc mcp stdio --discoveryTool Availability
searchenumenumlist_filesenumenumread_fileenumenumlist_indexesindex_repodelete_indexNote: In Discovery mode, users manage indexes via CLI (
ctxc index ...commands), not via MCP tools.Key Changes
1. Dynamic MultiIndexRunner
readonlyfromindexNamesandindexesrefreshIndexList()method to reload from storeinvalidateClient(name)to clear cached SearchClient2. list_indexes Tool
3. Mode-Based Tool Descriptions
enumin tool schemas for zero-tool-call discoveryenum, agent must calllist_indexes4. CLI Flag
--discoveryflag for explicit mode selection-iflags use CompositeStoreReader in fixed modeBenefits
Example Workflow
Testing
Future Work
Discovery mode is an incremental step. A future PR can add full agent-managed mode with:
index_repoanddelete_indextools