Skip to content

MCP auto-update — GitHub poll, account_status prompt, telemetry funnel#55

Merged
milstan merged 1 commit into
mainfrom
milstan/mcp-auto-updates
May 20, 2026
Merged

MCP auto-update — GitHub poll, account_status prompt, telemetry funnel#55
milstan merged 1 commit into
mainfrom
milstan/mcp-auto-updates

Conversation

@milstan
Copy link
Copy Markdown
Contributor

@milstan milstan commented May 20, 2026

Summary

  • MCP server self-polls api.github.com/repos/leadbay/leadclaw/releases/latest (ETag-aware, 24h throttle, in-flight guard) and surfaces an update_available block on leadbay_account_status when a newer version ships.
  • Agent is instructed (via buildServerInstructions) to prompt the user via ask_user_input_v0 with three options → leadbay_acknowledge_update({ action, version }) records the choice: install returns the .mcpb URL for Claude Desktop's native installer, remind_tomorrow snoozes 24h, skip suppresses the version permanently. State persists to ~/.leadbay/update-state.json (0o600, atomic, symlink-rejecting).
  • Five PostHog events build the funnel: mcp_update_check, mcp_update_prompted, mcp_update_install_clicked, mcp_update_dismissed, mcp_version_updated (fires on next boot under a newer VERSION).
  • Check fires at boot AND on every tool call so long-running Claude Desktop sessions still pick up releases. Opt-out: LEADBAY_UPDATE_CHECK_DISABLED=1.
  • +37 unit tests (240 → 241 incl. in-flight-guard test), pnpm -r typecheck + pnpm -r test green.

Test plan

  • Manually verify boot-time check populates ~/.leadbay/update-state.json
  • Stub local VERSION below latest release tag; confirm update_available lands on leadbay_account_status
  • Exercise each acknowledge action and confirm corresponding PostHog event
  • Click an .mcpb link in Claude Desktop and confirm the native installer opens
  • After upgrade, confirm mcp_version_updated fires on the next boot

🤖 Generated with Claude Code

The MCP server now self-checks GitHub releases (24h throttle, ETag-aware)
and surfaces an `update_available` block on leadbay_account_status when a
newer version is published. The agent prompts the user via ask_user_input_v0
with three options; leadbay_acknowledge_update records the choice
(install → .mcpb URL for Claude Desktop's native installer, remind_tomorrow
→ 24h snooze, skip → permanent suppression). State persists to
~/.leadbay/update-state.json. Five PostHog events build the funnel:
mcp_update_check, mcp_update_prompted, mcp_update_install_clicked,
mcp_update_dismissed, mcp_version_updated.

The check fires both at boot AND on every tool call (fire-and-forget with
in-flight guard) so long-running Claude Desktop sessions still pick up
releases. Opt-out: LEADBAY_UPDATE_CHECK_DISABLED=1.

+37 tests covering state persistence, semver compare, ETag/304 path,
suppression filters, in-flight guard, and the acknowledge tool's branches.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@milstan milstan merged commit 222ae16 into main May 20, 2026
1 check passed
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.

1 participant