MCP auto-update — GitHub poll, account_status prompt, telemetry funnel#55
Merged
Conversation
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>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
api.github.com/repos/leadbay/leadclaw/releases/latest(ETag-aware, 24h throttle, in-flight guard) and surfaces anupdate_availableblock onleadbay_account_statuswhen a newer version ships.buildServerInstructions) to prompt the user viaask_user_input_v0with three options →leadbay_acknowledge_update({ action, version })records the choice:installreturns the.mcpbURL for Claude Desktop's native installer,remind_tomorrowsnoozes 24h,skipsuppresses the version permanently. State persists to~/.leadbay/update-state.json(0o600, atomic, symlink-rejecting).mcp_update_check,mcp_update_prompted,mcp_update_install_clicked,mcp_update_dismissed,mcp_version_updated(fires on next boot under a newer VERSION).LEADBAY_UPDATE_CHECK_DISABLED=1.pnpm -r typecheck+pnpm -r testgreen.Test plan
~/.leadbay/update-state.jsonVERSIONbelow latest release tag; confirmupdate_availablelands onleadbay_account_status.mcpblink in Claude Desktop and confirm the native installer opensmcp_version_updatedfires on the next boot🤖 Generated with Claude Code