@skedulo/memory-hub-mcp 0.2.26 → 0.2.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -67,7 +67,7 @@ if [ -z "$TOKEN" ]; then
67
67
  else
68
68
  nohup "$CLAUDE_PLUGIN_ROOT/memory-hub-hook/mcp-server.sh" login </dev/null >"$STATE_DIR/login.log" 2>&1 &
69
69
  fi
70
- emit_context "This is the first session with Memory Hub, so a browser tab is opening on the Skedulo sign-in (the first time it can take a minute). Tell the user to sign in there; memory starts working from their next message. If no tab opened, call memory_login. Once they're signed in, offer once to stop Memory Hub's approval prompts with /memory-hub:setup."
70
+ emit_context "This is the first session with Memory Hub, so a browser tab is opening on the Skedulo sign-in (the first time it can take a minute). Tell the user to sign in there; memory starts working from their next message. If no tab opened, call memory_login. Once they're signed in, offer once to stop Memory Hub's approval prompts and turn on auto-update with /memory-hub:setup."
71
71
  else
72
72
  emit_context "Memory Hub isn't signed in, so memory is off. Offer once to sign the user in; if they agree, call memory_login, which opens a Skedulo sign-in in their browser."
73
73
  fi
@@ -98,6 +98,26 @@ every Memory Hub tool, including deleting and sharing memories. Do nothing witho
98
98
  first time Claude asks before a Memory Hub tool, or to change it later in the Claude app's
99
99
  settings for the Memory Hub extension.
100
100
 
101
+ ## 4b. Turn on auto-update (plugin installs only)
102
+
103
+ Skip this if you already offered it in this session, or when `${CLAUDE_PLUGIN_ROOT}` is empty.
104
+
105
+ Claude Code does not update plugins from this marketplace unless auto-update is on, so new hooks and
106
+ skills would never arrive. Ask the person once whether the Memory Hub plugin should update itself.
107
+ Do nothing without a yes. On yes, with the same safe merge as step 4:
108
+
109
+ ```bash
110
+ bash -c 'settings="$HOME/.claude/settings.json"
111
+ [ -f "$settings" ] || echo "{}" > "$settings"
112
+ jq -e ".extraKnownMarketplaces[\"memory-hub\"].autoUpdate == true" "$settings" >/dev/null 2>&1 && { echo "already on"; exit 0; }
113
+ cp "$settings" "$settings.bak-$(date +%Y%m%d%H%M%S)" \
114
+ && jq ".extraKnownMarketplaces[\"memory-hub\"] = ((.extraKnownMarketplaces[\"memory-hub\"] // {source: {source: \"github\", repo: \"Skedulo/se-ai-memory-hub\", ref: \"main\"}}) + {autoUpdate: true})" "$settings" > "$settings.new" \
115
+ && mv "$settings.new" "$settings"'
116
+ ```
117
+
118
+ Say it applies from their next session. If `jq` is missing, tell them to turn it on in `/plugin` →
119
+ Marketplaces → memory-hub instead.
120
+
101
121
  ## 5. Auto-capture (Claude Code only)
102
122
 
103
123
  Auto-capture saves what a session learned when it ends, by running `claude` in the background.
@@ -0,0 +1,120 @@
1
+ #!/usr/bin/env bash
2
+ # Removes Memory Hub from this computer. Memories already saved stay on the Skedulo tenant.
3
+ # Usage: uninstall-memory-hub.sh [--dry-run] [--yes]
4
+ set -u
5
+
6
+ DRY=false YES=false
7
+ for arg in "$@"; do
8
+ case "$arg" in
9
+ --dry-run) DRY=true ;;
10
+ --yes) YES=true ;;
11
+ -h | --help) sed -n '2,3p' "$0"; exit 0 ;;
12
+ *) echo "Unknown option: $arg" >&2; exit 2 ;;
13
+ esac
14
+ done
15
+
16
+ STAMP=$(date +%Y%m%d%H%M%S)
17
+ SETTINGS="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/settings.json"
18
+ CLAUDE_JSON="$HOME/.claude.json"
19
+ case "$(uname -s)" in
20
+ Darwin) DESKTOP_CONFIG="$HOME/Library/Application Support/Claude/claude_desktop_config.json" ;;
21
+ *) DESKTOP_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/Claude/claude_desktop_config.json" ;;
22
+ esac
23
+ DIRS=("${XDG_CONFIG_HOME:-$HOME/.config}/memory-hub" "${CLAUDE_CONFIG_DIR:-$HOME/.claude}/memory-hub-hook" "$HOME/.cache/memory-hub")
24
+
25
+ SETTINGS_FILTER='del(.env.MEMORY_HUB_MCP_TOKEN, .env.MEMORY_HUB_FUNCTION_URL, .env.MEMORY_HUB_AUTO_CAPTURE, .env.MEMORY_HUB_CLAUDE_BIN)
26
+ | del(.extraKnownMarketplaces["memory-hub"], .extraKnownMarketplaces["se-ai-memory-hub"])
27
+ | if (.permissions.allow | type) == "array" then .permissions.allow |= map(select(test("^mcp__(plugin_memory-hub_memory-hub|memory-hub|Memory_Hub)") | not)) else . end
28
+ | if (.hooks | type) == "object" then .hooks |= with_entries(.value |= (map(.hooks |= map(select((.command // "") | test("memory-hub-hook") | not))) | map(select((.hooks | length) > 0)))) else . end'
29
+ SERVER_FILTER='if .mcpServers then del(.mcpServers["memory-hub"]) else . end'
30
+
31
+ say() { printf '%s\n' "$*"; }
32
+
33
+ edit_json() {
34
+ local file="$1" filter="$2"
35
+ [ -f "$file" ] || return 0
36
+ local tmp
37
+ tmp=$(mktemp) || return 0
38
+ if ! jq "$filter" "$file" > "$tmp" 2>/dev/null; then
39
+ say " skipped $file: it isn't valid JSON"; rm -f "$tmp"; return 0
40
+ fi
41
+ if cmp -s <(jq -S . "$file") <(jq -S . "$tmp"); then rm -f "$tmp"; return 0; fi
42
+ if $DRY; then
43
+ say " would edit $file:"
44
+ diff <(jq -S . "$file") <(jq -S . "$tmp") | grep '^<' | sed -E 's/^< / - /; s/("MEMORY_HUB_MCP_TOKEN": ")[^"]*/\1(hidden)/'
45
+ rm -f "$tmp"
46
+ else
47
+ cp -p "$file" "$file.bak-memory-hub-$STAMP" && mv "$tmp" "$file" && say " edited $file (backup: $file.bak-memory-hub-$STAMP)"
48
+ fi
49
+ }
50
+
51
+ say "This removes Memory Hub from this computer:"
52
+ say " - the Claude Code plugin and its marketplace"
53
+ say " - the sign-in token, hook state and model cache"
54
+ say " - Memory Hub entries in Claude Code and Claude Desktop settings (with backups)"
55
+ say " - the global npm package"
56
+ say "Memories already in the hub are not deleted."
57
+ if ! $DRY && ! $YES; then
58
+ printf 'Continue? (y/N) '
59
+ read -r answer
60
+ case "$answer" in y | Y | yes) ;; *) say "Nothing changed."; exit 0 ;; esac
61
+ fi
62
+
63
+ if ! command -v jq >/dev/null 2>&1; then
64
+ say "jq isn't installed, so settings files are left as they are. Install jq and run this again to clean them."
65
+ JQ=false
66
+ else
67
+ JQ=true
68
+ fi
69
+
70
+ say "Plugin:"
71
+ if command -v claude >/dev/null 2>&1; then
72
+ for id in memory-hub@memory-hub memory-hub@se-ai-memory-hub; do
73
+ if claude plugin list 2>/dev/null | grep -q "❯ $id\$"; then
74
+ if $DRY; then say " would uninstall $id"; else claude plugin uninstall "$id" >/dev/null 2>&1 && say " uninstalled $id"; fi
75
+ fi
76
+ done
77
+ for name in memory-hub se-ai-memory-hub; do
78
+ if claude plugin marketplace list 2>/dev/null | grep -q "❯ $name\$"; then
79
+ if $DRY; then say " would remove marketplace $name"; else claude plugin marketplace remove "$name" >/dev/null 2>&1 && say " removed marketplace $name"; fi
80
+ fi
81
+ done
82
+ else
83
+ say " the claude command isn't on PATH; remove the plugin in the desktop app: + -> Plugins -> Manage plugins"
84
+ fi
85
+
86
+ say "Files:"
87
+ for dir in "${DIRS[@]}"; do
88
+ [ -e "$dir" ] || continue
89
+ if $DRY; then say " would delete $dir"; else rm -rf -- "$dir" && say " deleted $dir"; fi
90
+ done
91
+
92
+ if $JQ; then
93
+ say "Settings:"
94
+ edit_json "$SETTINGS" "$SETTINGS_FILTER"
95
+ edit_json "$CLAUDE_JSON" "$SERVER_FILTER"
96
+ edit_json "$DESKTOP_CONFIG" "$SERVER_FILTER"
97
+ fi
98
+
99
+ say "npm:"
100
+ if command -v npm >/dev/null 2>&1 && npm ls -g --depth=0 @skedulo/memory-hub-mcp >/dev/null 2>&1; then
101
+ if $DRY; then say " would uninstall the global @skedulo/memory-hub-mcp"; else npm uninstall -g @skedulo/memory-hub-mcp >/dev/null 2>&1 && say " uninstalled the global @skedulo/memory-hub-mcp"; fi
102
+ fi
103
+
104
+ SKILLS_DIR="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/skills"
105
+ FOUND=()
106
+ for name in memory-hub ask setup plan-ticket delegate-ticket fold-findings project-knowledge sweep-knowledge; do
107
+ [ -f "$SKILLS_DIR/$name/SKILL.md" ] && grep -q 'memory_' "$SKILLS_DIR/$name/SKILL.md" 2>/dev/null && FOUND+=("$SKILLS_DIR/$name")
108
+ done
109
+
110
+ say ""
111
+ say "Left for you:"
112
+ say " - Desktop extension: Claude desktop app -> Settings -> Extensions -> Memory Hub -> Uninstall"
113
+ if [ ${#FOUND[@]} -gt 0 ]; then
114
+ say " - Skill folders that look like Memory Hub copies (check, then delete):"
115
+ for path in "${FOUND[@]}"; do say " $path"; done
116
+ fi
117
+ say " - Optional: revoke your API token in Pulse Web (profile -> Settings -> Developer tools -> API tokens)"
118
+ say "Then restart Claude Code, and quit and reopen Claude Desktop."
119
+ $DRY && say "(dry run: nothing was changed)"
120
+ exit 0
package/dist/cli.js CHANGED
@@ -15,6 +15,11 @@ else if (command === 'setup') {
15
15
  process.exit(1);
16
16
  });
17
17
  }
18
+ else if (command === 'uninstall') {
19
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
20
+ const { runUninstall } = require('./uninstall');
21
+ process.exitCode = runUninstall(process.argv.slice(3));
22
+ }
18
23
  else if (command === 'login') {
19
24
  // eslint-disable-next-line @typescript-eslint/no-var-requires
20
25
  const { runLogin } = require('./login-tool');
@@ -124,6 +129,9 @@ else if (command === '--help' || command === '-h') {
124
129
  --no-auto-update pins this install instead. On macOS it offers to
125
130
  restart Claude Desktop at the end.
126
131
  memory-hub-mcp login sign in to Memory Hub in the browser and save the token on this machine
132
+ memory-hub-mcp uninstall [--dry-run] [--yes]
133
+ remove Memory Hub from this computer: the plugin, the sign-in token and
134
+ Memory Hub's settings entries, with backups. Saved memories stay in the hub.
127
135
  memory-hub-mcp capture on|off
128
136
  turn auto-capture on or off (on by default). In the background,
129
137
  Claude saves what each session learns and fixes hub memories you
@@ -7,6 +7,7 @@ const setup_1 = require("./setup");
7
7
  const SIGNED_IN = 'Signed in. Memory Hub works now, no restart needed.';
8
8
  const EXTENSION_ALLOW_NOTE = " If Claude asks before each Memory Hub tool, the user can choose Always allow, or change it later in the Claude app's settings for the Memory Hub extension.";
9
9
  const allowOffer = (rule) => ` Then offer once to stop Memory Hub's approval prompts (this covers all its tools, including deleting and sharing memories): if the user agrees, add "${rule}" to permissions.allow in ~/.claude/settings.json (merge it, keep a backup), and say it applies from their next session.`;
10
+ const AUTO_UPDATE_OFFER = ` Also offer once to turn on auto-update, so the Memory Hub plugin gets new versions by itself: if the user agrees, set extraKnownMarketplaces["${setup_1.MARKETPLACE_NAME}"].autoUpdate to true in ~/.claude/settings.json, adding the entry with source {"source": "github", "repo": "${setup_1.MARKETPLACE_REPO}", "ref": "${setup_1.MARKETPLACE_REF}"} if it is missing (merge it, keep a backup).`;
10
11
  const FIRST_CALL_WAIT_MS = 5000;
11
12
  const POLL_MS = 25;
12
13
  const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
@@ -55,7 +56,9 @@ function createLoginTool(deps) {
55
56
  const signedIn = () => {
56
57
  if (deps.extension)
57
58
  return `${SIGNED_IN}${EXTENSION_ALLOW_NOTE}`;
58
- return `${SIGNED_IN}${allowOffer(deps.viaPlugin ? setup_1.PLUGIN_ALLOW_RULE : setup_1.DIRECT_ALLOW_RULE)}`;
59
+ if (deps.viaPlugin)
60
+ return `${SIGNED_IN}${allowOffer(setup_1.PLUGIN_ALLOW_RULE)}${AUTO_UPDATE_OFFER}`;
61
+ return `${SIGNED_IN}${allowOffer(setup_1.DIRECT_ALLOW_RULE)}`;
59
62
  };
60
63
  const call = async () => {
61
64
  if (pending)
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runUninstall = exports.uninstallScriptPath = void 0;
4
+ const child_process_1 = require("child_process");
5
+ const fs_1 = require("fs");
6
+ const path_1 = require("path");
7
+ function uninstallScriptPath(distDir = __dirname) {
8
+ return (0, path_1.join)(distDir, '..', 'assets', 'uninstall-memory-hub.sh');
9
+ }
10
+ exports.uninstallScriptPath = uninstallScriptPath;
11
+ function runUninstall(argv, deps = {}) {
12
+ const script = deps.script ?? uninstallScriptPath();
13
+ const log = deps.log ?? ((line) => console.error(line));
14
+ if (!(0, fs_1.existsSync)(script)) {
15
+ log(`The uninstall script is missing from this install (${script}). Update with npx -y @skedulo/memory-hub-mcp@latest uninstall, or in a repo checkout run scripts/copy-assets.sh first.`);
16
+ return 1;
17
+ }
18
+ const result = (deps.spawn ?? child_process_1.spawnSync)('bash', [script, ...argv], { stdio: 'inherit' });
19
+ return result.status ?? 1;
20
+ }
21
+ exports.runUninstall = runUninstall;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skedulo/memory-hub-mcp",
3
- "version": "0.2.26",
3
+ "version": "0.2.28",
4
4
  "description": "MCP server for the Memory Hub: recall and save developer memory from Claude Code and Claude Desktop.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {