fix: Expose an MCP tool for incremental index refresh#405
Open
linze0721 wants to merge 3 commits into
Open
Conversation
added 3 commits
June 28, 2026 03:41
…liztech#394) Signed-off-by: Berserk Agent <berserk@agent.local>
Signed-off-by: Berserk Agent <berserk@agent.local>
Signed-off-by: Berserk Agent <berserk@agent.local>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Summary
Adds a first-class MCP tool
sync_indexso clients can incrementally refresh existing indexes viaContext.reindexByChange, withoutforce=truefull reindex or out-of-band~/.context/.sync-triggertouches.Changes
packages/mcp/src/sync.tssyncIndex({ path?, wait? })andrunSyncLocked;handleSyncIndexdelegates to shared lock + per-codebasereindexByChangeusing snapshot-stored splitter/ignore/custom extensions. Returns stats{ added, modified, removed }and clear outcomes when lock busy (wait: false) or path not indexed.packages/mcp/src/handlers.tshandleSyncIndexvalidates optional absolute path against indexed snapshot, invokesSyncManager.syncIndex, returns JSON tool result.packages/mcp/src/index.tssync_indexin ListTools + CallTool dispatch (optionalpath,waitdefault true).packages/mcp/src/sync-index.test.tspackages/mcp/README.md,CONTRIBUTING.mdsync_indexparameters and behavior; clarifyCLAUDE_CONTEXT_TRIGGER_WATCHERwatches only~/.context/.sync-trigger, not project directories.Verification
All tests passed.
Git
berserk/7368c510-3d76-41e5-ae16-462eae4765ad6b055caoriginAddresses zilliztech/claude-context#394 (related #238).
Commit
6b055ca
Branch
berserk/7368c510-3d76-41e5-ae16-462eae4765ad
Fixes #394