mcp-context-sync 1.0.10 → 1.0.11
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/README.md +9 -3
- package/package.json +3 -1
- package/scripts/preinstall.cjs +97 -0
package/README.md
CHANGED
|
@@ -24,10 +24,16 @@ context-sync install --all
|
|
|
24
24
|
context-sync doctor
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
##
|
|
27
|
+
## Supported Platforms
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
| Node version | macOS / Linux | Windows |
|
|
30
|
+
|-------------|---------------|---------|
|
|
31
|
+
| 18 LTS | ✓ | ✓ |
|
|
32
|
+
| 20 LTS | ✓ recommended | ✓ recommended |
|
|
33
|
+
| 22 LTS | ✓ recommended | ✓ recommended |
|
|
34
|
+
| 23+ | ✓ (may compile from source) | ✗ requires Build Tools¹ |
|
|
35
|
+
|
|
36
|
+
¹ Node 23+ on Windows has no prebuilt `better-sqlite3` binary. The installer will **abort with a clear message** instead of leaving broken shims. Fix: use Node 20/22 LTS, or install [Visual Studio Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) with "Desktop development with C++".
|
|
31
37
|
|
|
32
38
|
## What gets installed
|
|
33
39
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-context-sync",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "MCP server for synchronizing work context between AI coding agents (Claude Code, Codex, Gemini, Cursor)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -10,11 +10,13 @@
|
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"dist",
|
|
13
|
+
"scripts/preinstall.cjs",
|
|
13
14
|
"scripts/postinstall.cjs",
|
|
14
15
|
"README.md",
|
|
15
16
|
"LICENSE"
|
|
16
17
|
],
|
|
17
18
|
"scripts": {
|
|
19
|
+
"preinstall": "node scripts/preinstall.cjs",
|
|
18
20
|
"postinstall": "node scripts/postinstall.cjs",
|
|
19
21
|
"clean": "node -e \"const fs=require('fs');fs.rmSync('dist',{recursive:true,force:true})\"",
|
|
20
22
|
"build": "npm run clean && tsc",
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* preinstall check — runs BEFORE npm installs dependencies.
|
|
5
|
+
* Detects known-broken combinations (Node 23+/Windows/no Build Tools)
|
|
6
|
+
* and aborts with a clear message BEFORE npm leaves broken shims.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const nodeVersion = process.version;
|
|
10
|
+
const major = parseInt(nodeVersion.slice(1), 10);
|
|
11
|
+
const isWin = process.platform === 'win32';
|
|
12
|
+
|
|
13
|
+
// Node 18-22 on any platform: prebuilt binaries exist, no issues
|
|
14
|
+
if (major < 23) {
|
|
15
|
+
process.exit(0);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Node 23+ on non-Windows: usually has build tools, let it try
|
|
19
|
+
if (!isWin) {
|
|
20
|
+
console.warn(`\n ⚠ Node ${nodeVersion} detected. better-sqlite3 may need to compile from source.`);
|
|
21
|
+
console.warn(' If installation fails, use Node 20 or 22 LTS.\n');
|
|
22
|
+
process.exit(0);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Node 23+ on Windows: check if Build Tools are available
|
|
26
|
+
let hasBuildTools = false;
|
|
27
|
+
try {
|
|
28
|
+
const { execSync } = require('child_process');
|
|
29
|
+
|
|
30
|
+
// Method 1: Check for cl.exe (MSVC compiler)
|
|
31
|
+
try {
|
|
32
|
+
execSync('where cl.exe', { stdio: ['pipe', 'pipe', 'pipe'] });
|
|
33
|
+
hasBuildTools = true;
|
|
34
|
+
} catch {}
|
|
35
|
+
|
|
36
|
+
// Method 2: Check for MSBuild (Visual Studio Build Tools)
|
|
37
|
+
if (!hasBuildTools) {
|
|
38
|
+
try {
|
|
39
|
+
execSync('where msbuild', { stdio: ['pipe', 'pipe', 'pipe'] });
|
|
40
|
+
hasBuildTools = true;
|
|
41
|
+
} catch {}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Method 3: Check VS install path
|
|
45
|
+
if (!hasBuildTools) {
|
|
46
|
+
const fs = require('fs');
|
|
47
|
+
const vsPath = 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vswhere.exe';
|
|
48
|
+
if (fs.existsSync(vsPath)) {
|
|
49
|
+
try {
|
|
50
|
+
const output = execSync(`"${vsPath}" -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`, {
|
|
51
|
+
encoding: 'utf-8',
|
|
52
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
53
|
+
}).trim();
|
|
54
|
+
if (output) hasBuildTools = true;
|
|
55
|
+
} catch {}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
} catch {}
|
|
59
|
+
|
|
60
|
+
if (hasBuildTools) {
|
|
61
|
+
console.warn(`\n ⚠ Node ${nodeVersion} on Windows — no prebuilt binary for better-sqlite3.`);
|
|
62
|
+
console.warn(' Build Tools detected, will compile from source (may take a minute).\n');
|
|
63
|
+
process.exit(0);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Node 23+ on Windows without Build Tools — this WILL fail and leave broken shims
|
|
67
|
+
console.error('');
|
|
68
|
+
console.error('╔══════════════════════════════════════════════════════════════════╗');
|
|
69
|
+
console.error('║ mcp-context-sync: installation will fail on this environment ║');
|
|
70
|
+
console.error('╚══════════════════════════════════════════════════════════════════╝');
|
|
71
|
+
console.error('');
|
|
72
|
+
console.error(` Node: ${nodeVersion}`);
|
|
73
|
+
console.error(` Platform: Windows`);
|
|
74
|
+
console.error(' Build: Visual Studio Build Tools NOT found');
|
|
75
|
+
console.error('');
|
|
76
|
+
console.error(' better-sqlite3 has no prebuilt binary for Node 23+ on Windows,');
|
|
77
|
+
console.error(' and native compilation requires Visual Studio Build Tools.');
|
|
78
|
+
console.error(' Without them, npm will leave broken .cmd shims in your PATH.');
|
|
79
|
+
console.error('');
|
|
80
|
+
console.error(' ── Recommended fix (fastest) ──────────────────────────────────');
|
|
81
|
+
console.error('');
|
|
82
|
+
console.error(' Use Node 20 or 22 LTS:');
|
|
83
|
+
console.error('');
|
|
84
|
+
console.error(' nvm install 22');
|
|
85
|
+
console.error(' nvm use 22');
|
|
86
|
+
console.error(' npm install -g mcp-context-sync');
|
|
87
|
+
console.error('');
|
|
88
|
+
console.error(' ── Alternative fix ────────────────────────────────────────────');
|
|
89
|
+
console.error('');
|
|
90
|
+
console.error(' Install Visual Studio Build Tools:');
|
|
91
|
+
console.error(' https://visualstudio.microsoft.com/visual-cpp-build-tools/');
|
|
92
|
+
console.error(' Select "Desktop development with C++" workload');
|
|
93
|
+
console.error(' Then retry: npm install -g mcp-context-sync');
|
|
94
|
+
console.error('');
|
|
95
|
+
|
|
96
|
+
// Exit with error to PREVENT npm from proceeding
|
|
97
|
+
process.exit(1);
|