Skip to content

codegraph upgrade should run automatically on MCP server start (or offer a check) #1243

Description

@PancakeZik

Problem

The recommended MCP config points at the local codegraph binary:

{
  "command": "codegraph",
  "args": ["serve", "--mcp"]
}

This means the MCP server stays on whatever version was last manually upgraded via codegraph upgrade. There is no mechanism to notify the user that a newer version is available, or to self-update on startup.

In practice this leads to version drift: users discover they're running an old version only when something breaks or when they happen to check manually. The codegraph prompt-hook (which also uses the local binary) compounds this, since both the MCP server and the hook silently stay on the old version together.

A common workaround is to use npx @colbymchenry/codegraph@latest serve --mcp in the MCP config, but this diverges from the official docs, adds cold-start latency (npm registry check), and splits the install from the prompt-hook binary (which still uses the local codegraph).

Expected behavior

One of:

  1. Check on serve start: when codegraph serve --mcp starts, check the latest release in the background. If a newer version exists, emit a notice in the MCP server instructions or log (not blocking). Something like "CodeGraph X.Y.Z available, run codegraph upgrade to update."

  2. Auto-upgrade option: a flag like codegraph serve --mcp --auto-upgrade that runs the upgrade logic before starting the server, so the MCP config always launches the latest version without needing npx.

  3. Startup hook in codegraph upgrade: register a systemd user timer, cron job, or similar that periodically checks for updates (opt-in during codegraph install).

Option 1 seems lowest-friction: no behavioral change, just visibility.

Environment

  • CodeGraph 1.4.0, bundle install (Linux x64)
  • MCP config: "command": "codegraph", "args": ["serve", "--mcp"]
  • Also uses codegraph prompt-hook in Claude Code UserPromptSubmit hooks

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