Skip to content

Index not auto-loaded from vector DB on MCP server restart #249

@Retengart

Description

@Retengart

Problem

Snapshot file (~/.context/mcp-codebase-snapshot.json) is loaded on startup, but actual Milvus/Zilliz collections are never verified against local state.

Current Behavior

  1. Index codebase → snapshot says "indexed", vector DB has data
  2. Restart MCP server
  3. loadCodebaseSnapshot() loads from JSON file ✓
  4. But vector DB collection existence never checked
  5. If cloud data was deleted (manually, TTL, etc.), local says "indexed" but search returns nothing

Expected Behavior

On startup, verify that collections listed in snapshot actually exist in vector DB. Remove from snapshot if collection missing.

Location

  • packages/mcp/src/index.ts:79-80 - loads snapshot but no DB verification
  • packages/mcp/src/snapshot.ts:440-467 - loadCodebaseSnapshot()

Suggested Fix

After loadCodebaseSnapshot(), iterate indexed codebases and call context.hasIndex() to verify collections exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions