sticky-note-cli 3.1.23 → 3.1.24

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.
package/bin/cli.js CHANGED
@@ -1145,11 +1145,39 @@ async function cmdInit() {
1145
1145
  debugLog("git add --force .claude/ failed: " + (err.message || err));
1146
1146
  }
1147
1147
 
1148
+ // Copy the sticky-note-mcp.js wrapper to .claude/ so Claude Code can launch it
1149
+ // without npx/cmd-shim chains that break on Windows.
1150
+ const mcpWrapperSrc = path.join(TEMPLATES_DIR, "sticky-note-mcp.js");
1151
+ const mcpWrapperDest = path.join(process.cwd(), ".claude", "sticky-note-mcp.js");
1152
+ if (fs.existsSync(mcpWrapperSrc)) {
1153
+ fs.copyFileSync(mcpWrapperSrc, mcpWrapperDest);
1154
+ print(" [OK] Copied .claude/sticky-note-mcp.js (MCP server entry point)");
1155
+ }
1156
+
1157
+ // Ensure sticky-note entry in .mcp.json uses the direct node invocation
1158
+ const initMcpEntry = { type: "stdio", command: "node", args: [".claude/sticky-note-mcp.js"] };
1159
+ try {
1160
+ const initMcpJsonPath = path.join(process.cwd(), ".mcp.json");
1161
+ let initMcpJson = { mcpServers: {} };
1162
+ if (fs.existsSync(initMcpJsonPath)) {
1163
+ initMcpJson = readJsonSafe(initMcpJsonPath, { mcpServers: {} });
1164
+ initMcpJson.mcpServers = initMcpJson.mcpServers || {};
1165
+ }
1166
+ const existing = initMcpJson.mcpServers["sticky-note"];
1167
+ if (!existing || existing.command !== "node" || JSON.stringify(existing.args) !== JSON.stringify(initMcpEntry.args)) {
1168
+ initMcpJson.mcpServers["sticky-note"] = initMcpEntry;
1169
+ fs.writeFileSync(initMcpJsonPath, JSON.stringify(initMcpJson, null, 2) + "\n");
1170
+ print(" [OK] .mcp.json: sticky-note MCP server configured");
1171
+ }
1172
+ } catch (err) {
1173
+ debugLog("Could not update .mcp.json: " + (err.message || err));
1174
+ }
1175
+
1148
1176
  // Register sticky-note MCP server in Copilot CLI's ~/.copilot/mcp-config.json
1149
1177
  const stickyMcpEntry = {
1150
1178
  type: "stdio",
1151
- command: "npx",
1152
- args: ["-y", "sticky-note-cli", "mcp-server"],
1179
+ command: "node",
1180
+ args: [".claude/sticky-note-mcp.js"],
1153
1181
  tools: ["*"],
1154
1182
  };
1155
1183
  if (ensureMcpInCopilotCliConfig("sticky-note", stickyMcpEntry)) {
@@ -1163,25 +1191,19 @@ async function cmdInit() {
1163
1191
  }
1164
1192
  }
1165
1193
 
1166
- // Register sticky-note MCP server in Claude Code's global settings (~/.claude/settings.json)
1194
+ // Remove sticky-note from ~/.claude/settings.json — the project-level .mcp.json
1195
+ // is the right home for project-specific MCP servers on Claude Code. A duplicate
1196
+ // global entry can cause Claude Code to skip the server entirely on Windows.
1167
1197
  const claudeGlobalSettingsPath = path.join(os.homedir(), ".claude", "settings.json");
1168
1198
  try {
1169
1199
  const claudeGlobal = readJsonSafe(claudeGlobalSettingsPath, {});
1170
- if (!claudeGlobal.mcpServers) claudeGlobal.mcpServers = {};
1171
- const correctMcpEntry = { type: "stdio", command: "npx", args: ["-y", "sticky-note-cli", "mcp-server"] };
1172
- const existing = claudeGlobal.mcpServers["sticky-note"];
1173
- const isStale = existing && JSON.stringify(existing.args) !== JSON.stringify(correctMcpEntry.args);
1174
- if (!existing || isStale) {
1175
- claudeGlobal.mcpServers["sticky-note"] = correctMcpEntry;
1200
+ if (claudeGlobal.mcpServers && claudeGlobal.mcpServers["sticky-note"]) {
1201
+ delete claudeGlobal.mcpServers["sticky-note"];
1176
1202
  fs.writeFileSync(claudeGlobalSettingsPath, JSON.stringify(claudeGlobal, null, 2) + "\n");
1177
- print(isStale
1178
- ? " [OK] Updated sticky-note MCP entry in ~/.claude/settings.json (fixed args)"
1179
- : " [OK] Registered sticky-note MCP server in ~/.claude/settings.json (Claude Code)");
1180
- } else {
1181
- print(" ⏭️ sticky-note already registered in ~/.claude/settings.json");
1203
+ print(" [OK] Removed sticky-note from ~/.claude/settings.json (now project-local via .mcp.json)");
1182
1204
  }
1183
1205
  } catch (err) {
1184
- print(" ⏭️ Could not update ~/.claude/settings.json: " + (err.message || err));
1206
+ debugLog("Could not update ~/.claude/settings.json: " + (err.message || err));
1185
1207
  }
1186
1208
 
1187
1209
  // Done!
@@ -1364,33 +1386,43 @@ function cmdUpdate() {
1364
1386
  // non-fatal
1365
1387
  }
1366
1388
 
1367
- // Fix stale MCP entry in ~/.claude/settings.json (old -p flag broke Windows)
1368
- const correctMcpArgs = ["-y", "sticky-note-cli", "mcp-server"];
1369
- try {
1370
- const globalSettingsPath = path.join(os.homedir(), ".claude", "settings.json");
1371
- const globalSettings = readJsonSafe(globalSettingsPath, {});
1372
- const mcpEntry = globalSettings.mcpServers && globalSettings.mcpServers["sticky-note"];
1373
- if (mcpEntry && JSON.stringify(mcpEntry.args).includes("-p")) {
1374
- globalSettings.mcpServers["sticky-note"].args = correctMcpArgs;
1375
- fs.writeFileSync(globalSettingsPath, JSON.stringify(globalSettings, null, 2) + "\n");
1376
- print(" [OK] ~/.claude/settings.json: fixed sticky-note MCP args (Windows compat)");
1377
- }
1378
- } catch (_) { /* non-fatal */ }
1389
+ // Copy sticky-note-mcp.js wrapper (or update it to latest)
1390
+ const mcpWrapperSrc = path.join(TEMPLATES_DIR, "sticky-note-mcp.js");
1391
+ const mcpWrapperDest = path.join(process.cwd(), ".claude", "sticky-note-mcp.js");
1392
+ if (fs.existsSync(mcpWrapperSrc)) {
1393
+ fs.copyFileSync(mcpWrapperSrc, mcpWrapperDest);
1394
+ print(" [OK] .claude/sticky-note-mcp.js (MCP entry point updated)");
1395
+ }
1379
1396
 
1380
- // Fix stale MCP entry in project .mcp.json (same -p flag issue)
1397
+ // Migrate .mcp.json to use "node .claude/sticky-note-mcp.js" instead of npx subcommand.
1398
+ // The old npx approach goes through multiple .cmd shim layers on Windows, causing
1399
+ // Claude Code to silently skip the server. The node approach is a direct single process.
1400
+ const correctMcpEntry = { type: "stdio", command: "node", args: [".claude/sticky-note-mcp.js"] };
1381
1401
  try {
1382
1402
  const mcpJsonPath = path.join(process.cwd(), ".mcp.json");
1383
1403
  if (fs.existsSync(mcpJsonPath)) {
1384
1404
  const mcpJson = readJsonSafe(mcpJsonPath, {});
1385
1405
  const projectEntry = mcpJson.mcpServers && mcpJson.mcpServers["sticky-note"];
1386
- if (projectEntry && JSON.stringify(projectEntry.args).includes("-p")) {
1387
- mcpJson.mcpServers["sticky-note"].args = correctMcpArgs;
1406
+ if (projectEntry && (projectEntry.command !== "node" || JSON.stringify(projectEntry.args) !== JSON.stringify(correctMcpEntry.args))) {
1407
+ mcpJson.mcpServers["sticky-note"] = correctMcpEntry;
1388
1408
  fs.writeFileSync(mcpJsonPath, JSON.stringify(mcpJson, null, 2) + "\n");
1389
- print(" [OK] .mcp.json: fixed sticky-note MCP args (Windows compat)");
1409
+ print(" [OK] .mcp.json: migrated sticky-note to direct node invocation (Windows MCP fix)");
1390
1410
  }
1391
1411
  }
1392
1412
  } catch (_) { /* non-fatal */ }
1393
1413
 
1414
+ // Remove sticky-note from ~/.claude/settings.json — it belongs in .mcp.json only.
1415
+ // A duplicate global entry causes Claude Code to silently skip the server on Windows.
1416
+ try {
1417
+ const globalSettingsPath = path.join(os.homedir(), ".claude", "settings.json");
1418
+ const globalSettings = readJsonSafe(globalSettingsPath, {});
1419
+ if (globalSettings.mcpServers && globalSettings.mcpServers["sticky-note"]) {
1420
+ delete globalSettings.mcpServers["sticky-note"];
1421
+ fs.writeFileSync(globalSettingsPath, JSON.stringify(globalSettings, null, 2) + "\n");
1422
+ print(" [OK] ~/.claude/settings.json: removed sticky-note (now project-local via .mcp.json)");
1423
+ }
1424
+ } catch (_) { /* non-fatal */ }
1425
+
1394
1426
  print(`\n ✨ Scripts updated to v${VERSION}`);
1395
1427
 
1396
1428
  // Update instruction files (section-based: only replaces between markers)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sticky-note-cli",
3
- "version": "3.1.23",
3
+ "version": "3.1.24",
4
4
  "description": "Human-to-human handoff for AI coding assistants. Git-backed shared memory for Claude Code and Copilot CLI.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ // sticky-note MCP server entry point
3
+ // Auto-generated by sticky-note-cli init/update. Do not edit manually.
4
+ // Runs the sticky-note MCP server in-process using the installed package.
5
+ require("sticky-note-cli/bin/mcp-server.js");