Skip to content

fix: Expose an MCP tool for incremental index refresh#405

Open
linze0721 wants to merge 3 commits into
zilliztech:masterfrom
linze0721:berserk/7368c510-3d76-41e5-ae16-462eae4765ad
Open

fix: Expose an MCP tool for incremental index refresh#405
linze0721 wants to merge 3 commits into
zilliztech:masterfrom
linze0721:berserk/7368c510-3d76-41e5-ae16-462eae4765ad

Conversation

@linze0721

Copy link
Copy Markdown

Summary

Adds a first-class MCP tool sync_index so clients can incrementally refresh existing indexes via Context.reindexByChange, without force=true full reindex or out-of-band ~/.context/.sync-trigger touches.

Changes

Area What changed
packages/mcp/src/sync.ts New syncIndex({ path?, wait? }) and runSyncLocked; handleSyncIndex delegates to shared lock + per-codebase reindexByChange using 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.ts handleSyncIndex validates optional absolute path against indexed snapshot, invokes SyncManager.syncIndex, returns JSON tool result.
packages/mcp/src/index.ts Registers sync_index in ListTools + CallTool dispatch (optional path, wait default true).
packages/mcp/src/sync-index.test.ts Unit tests for tool wiring, path validation, wait/lock behavior, stats shape (10 tests in MCP package suite).
packages/mcp/README.md, CONTRIBUTING.md Document sync_index parameters and behavior; clarify CLAUDE_CONTEXT_TRIGGER_WATCHER watches only ~/.context/.sync-trigger, not project directories.

Verification

pnpm --filter @zilliz/claude-context-core build && pnpm --filter @zilliz/claude-context-mcp test

All tests passed.

Git

  • Branch: berserk/7368c510-3d76-41e5-ae16-462eae4765ad
  • Commit: 6b055ca
  • Pushed to origin

Addresses zilliztech/claude-context#394 (related #238).

Commit

6b055ca

Branch

berserk/7368c510-3d76-41e5-ae16-462eae4765ad

Fixes #394

Berserk Agent added 3 commits June 28, 2026 03:41
Signed-off-by: Berserk Agent <berserk@agent.local>
Signed-off-by: Berserk Agent <berserk@agent.local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose an MCP tool for incremental index refresh

1 participant