-
Notifications
You must be signed in to change notification settings - Fork 9
feat(install): register the Claude Code MCP server at user scope #369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
gbrlcustodio
wants to merge
4
commits into
dev
Choose a base branch
from
feat/claude-code-user-scope-install
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b7d1f1f
feat(install): register the Claude Code MCP server at user scope
gbrlcustodio 62aa4a9
refactor(install): drop a dead guard in the drift hook
gbrlcustodio db3aadb
fix(pr-review): point drift nudge at install.sh, not /pipefy:install
gbrlcustodio 5ee8302
fix(pr-review): gate drift nudge on a registered user-scope server
gbrlcustodio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| #!/bin/sh | ||
| # SessionStart nudge: when install.sh has registered a user-scope `pipefy` | ||
| # server (the persistent pipefy-mcp-server binary, which shadows the plugin's | ||
| # bundled uvx entry), plugin auto-updates no longer reach that running server. | ||
| # This compares the installed binary's version against the plugin's declared | ||
| # version and, on drift, tells the user to re-run install.sh (the path that | ||
| # actually reinstalls the binary and re-registers the user-scope server; | ||
| # /pipefy:install only installs the CLI). | ||
| # | ||
| # No-op unless that user-scope override is registered: users on the pure | ||
| # plugin/uvx path have no installed binary, and users who installed the binary | ||
| # only for another client (e.g. --client cursor) still run the plugin's uvx | ||
| # server here, so there is nothing shadowing the plugin to nudge about. | ||
| set -eu | ||
|
|
||
| # Cheap pre-filter: no installed binary means nothing could shadow the plugin. | ||
| command -v pipefy-mcp-server >/dev/null 2>&1 || exit 0 | ||
|
|
||
| # The precise trigger is a user-scope `pipefy` server whose command is that | ||
| # binary. `command -v` alone is not enough: --client cursor also puts the | ||
| # binary on PATH without registering a Claude Code override, so the plugin's | ||
| # uvx server still runs here and there is nothing to sync. Fall through to no | ||
| # nudge if python3 is missing or the config cannot be read. | ||
| python3 - <<'PY' || exit 0 | ||
| import json | ||
| import os | ||
| import sys | ||
|
|
||
| try: | ||
| servers = json.load(open(os.path.expanduser("~/.claude.json"))).get("mcpServers", {}) | ||
| except (OSError, ValueError): | ||
| sys.exit(1) | ||
| entry = servers.get("pipefy") if isinstance(servers, dict) else None | ||
| command = entry.get("command") if isinstance(entry, dict) else None | ||
| sys.exit(0 if command == "pipefy-mcp-server" else 1) | ||
| PY | ||
|
|
||
| # Cheap checks first; only spawn the binary (Python cold start) once we have a | ||
| # plugin version to compare against. | ||
| manifest="${CLAUDE_PLUGIN_ROOT:-}/.claude-plugin/plugin.json" | ||
| [ -f "$manifest" ] || exit 0 | ||
| plugin=$(sed -n 's/.*"version"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' "$manifest" | head -n1) | ||
| [ -n "$plugin" ] || exit 0 | ||
|
|
||
| installed=$(pipefy-mcp-server --version 2>/dev/null | tr -d '[:space:]') | ||
| [ -n "$installed" ] || exit 0 | ||
|
|
||
| if [ "$installed" != "$plugin" ]; then | ||
| echo "Pipefy: the installed MCP server ($installed) differs from this plugin ($plugin). Re-run the installer to sync: curl -fsSL https://raw.githubusercontent.com/pipefy/ai-toolkit/main/install.sh | sh -s -- --client claude-code" | ||
| fi | ||
| exit 0 | ||
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
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.
Uh oh!
There was an error while loading. Please reload this page.