Skip to content

Warn MCP clients when a project index predates the current extraction version #1852

Description

@cbeaulieu-gt

Summary

Surface a clear MCP warning when the selected project's index was built with an older extraction version than the running CodeGraph engine.

Context

getIndexBuildInfo() and isIndexStale() already provide a local compatibility check, and codegraph status reports when a full rebuild is recommended. MCP clients do not currently receive that warning through the default tool surface.

This is a smaller manual guardrail related to #1798, which proposes automatic background rebuilding. It does not implement automatic rebuilding. It also differs from #1243/#1253, which detects a newer published CodeGraph release rather than a stale project index.

Related work: #1842 and #1851.

Acceptance Criteria

  • The first successful MCP tool response for a stale project warns that the index predates the running extraction engine.
  • The warning appears once per project per MCP session.
  • Explicit projectPath calls independently warn for each stale project.
  • The message includes available build-version details and instructs the user to run codegraph index.
  • codegraph_status always reports build-version details and whether reindexing is recommended.
  • Current and uninitialized indexes do not produce the warning.
  • MCP initialization remains nonblocking and preserves the existing fast-handshake contract.
  • Detection is entirely local: no network request and no automatic reindex.
  • Direct, proxy/daemon, and multi-project behavior have regression coverage.
  • User-facing documentation or changelog text describes the warning.

Out of Scope

🤖 Generated by Codex on behalf of @cbeaulieu-gt

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions