@aiwerk/mcp-bridge 2.8.8 → 2.8.10
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/dist/bin/mcp-bridge.js +5 -5
- package/package.json +2 -1
- package/scripts/postinstall.cjs +45 -0
package/dist/bin/mcp-bridge.js
CHANGED
|
@@ -215,7 +215,7 @@ function cmdInit(logger) {
|
|
|
215
215
|
try {
|
|
216
216
|
const addArgs = ["mcp", "add", "-s", "user", "mcp-bridge", "--", bridgeCmd, ...bridgeArgs];
|
|
217
217
|
execFileSync("claude", addArgs, { stdio: "pipe" });
|
|
218
|
-
process.stdout.write("✓ Registered with Claude Code (user scope)\n");
|
|
218
|
+
process.stdout.write("✓ Registered with Claude Code (user scope) → ~/.claude.json\n Restart Claude Code to activate.\n");
|
|
219
219
|
registered = true;
|
|
220
220
|
}
|
|
221
221
|
catch {
|
|
@@ -236,11 +236,11 @@ function cmdInit(logger) {
|
|
|
236
236
|
if (!cursorConfig.mcpServers["mcp-bridge"]) {
|
|
237
237
|
cursorConfig.mcpServers["mcp-bridge"] = { command: bridgeCmd, args: bridgeArgs };
|
|
238
238
|
writeFileSync(cursorConfigPath, JSON.stringify(cursorConfig, null, 2) + "\n", "utf-8");
|
|
239
|
-
process.stdout.write(
|
|
239
|
+
process.stdout.write(`✓ Registered with Cursor → ${cursorConfigPath}\n Restart Cursor to activate.\n`);
|
|
240
240
|
registered = true;
|
|
241
241
|
}
|
|
242
242
|
else {
|
|
243
|
-
process.stdout.write(
|
|
243
|
+
process.stdout.write(`✓ Cursor already configured → ${cursorConfigPath}\n`);
|
|
244
244
|
registered = true;
|
|
245
245
|
}
|
|
246
246
|
}
|
|
@@ -261,11 +261,11 @@ function cmdInit(logger) {
|
|
|
261
261
|
if (!wsConfig.mcpServers["mcp-bridge"]) {
|
|
262
262
|
wsConfig.mcpServers["mcp-bridge"] = { command: bridgeCmd, args: bridgeArgs };
|
|
263
263
|
writeFileSync(windsurfConfigPath, JSON.stringify(wsConfig, null, 2) + "\n", "utf-8");
|
|
264
|
-
process.stdout.write(
|
|
264
|
+
process.stdout.write(`✓ Registered with Windsurf → ${windsurfConfigPath}\n Restart Windsurf to activate.\n`);
|
|
265
265
|
registered = true;
|
|
266
266
|
}
|
|
267
267
|
else {
|
|
268
|
-
process.stdout.write(
|
|
268
|
+
process.stdout.write(`✓ Windsurf already configured → ${windsurfConfigPath}\n`);
|
|
269
269
|
registered = true;
|
|
270
270
|
}
|
|
271
271
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiwerk/mcp-bridge",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.10",
|
|
4
4
|
"description": "Standalone MCP server that multiplexes multiple MCP servers into one interface",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/src/index.js",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"build": "tsc",
|
|
45
45
|
"test": "node --import tsx --test tests/*.test.ts",
|
|
46
46
|
"typecheck": "tsc --noEmit",
|
|
47
|
+
"postinstall": "node scripts/postinstall.cjs",
|
|
47
48
|
"prepublishOnly": "tsc && bash scripts/validate-recipes.sh && node -e \"const v=require('./package.json').version;const fs=require('fs');const cl=fs.readFileSync('CHANGELOG.md','utf8');if(!cl.includes('['+v+']')){console.error('ERROR: CHANGELOG.md missing entry for v'+v);process.exit(1)}\"",
|
|
48
49
|
"validate-recipe": "npx tsx bin/validate-recipe.ts",
|
|
49
50
|
"lint": "eslint src/",
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// Only run auto-init on global installs, not when installed as a dependency
|
|
4
|
+
// npm sets npm_config_global=true for global installs
|
|
5
|
+
const isGlobal = process.env.npm_config_global === "true" ||
|
|
6
|
+
process.env.npm_lifecycle_event === "postinstall" &&
|
|
7
|
+
!process.env.npm_package_name; // not set when we ARE the package being installed as dep
|
|
8
|
+
|
|
9
|
+
// Also check: if our parent is another package's node_modules, skip
|
|
10
|
+
const isNested = __dirname.includes("node_modules") &&
|
|
11
|
+
__dirname.split("node_modules").length > 2;
|
|
12
|
+
|
|
13
|
+
if (isNested) {
|
|
14
|
+
// We're a nested dependency (e.g., inside openclaw-mcp-bridge), skip
|
|
15
|
+
process.exit(0);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const { execSync } = require("child_process");
|
|
19
|
+
const { existsSync } = require("fs");
|
|
20
|
+
const { join } = require("path");
|
|
21
|
+
const os = require("os");
|
|
22
|
+
|
|
23
|
+
const configDir = join(os.homedir(), ".mcp-bridge");
|
|
24
|
+
const configPath = join(configDir, "config.json");
|
|
25
|
+
|
|
26
|
+
// Only auto-init if config doesn't exist yet (fresh install)
|
|
27
|
+
if (existsSync(configPath)) {
|
|
28
|
+
console.log("[mcp-bridge] Config already exists, skipping auto-init.");
|
|
29
|
+
process.exit(0);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
// Find our own binary
|
|
34
|
+
const binPath = join(__dirname, "..", "dist", "bin", "mcp-bridge.js");
|
|
35
|
+
if (!existsSync(binPath)) {
|
|
36
|
+
// Not built yet (source install), skip
|
|
37
|
+
process.exit(0);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
console.log("[mcp-bridge] Running auto-init...");
|
|
41
|
+
execSync(`node "${binPath}" init`, { stdio: "inherit" });
|
|
42
|
+
} catch (err) {
|
|
43
|
+
// Don't fail the install if init fails
|
|
44
|
+
console.log("[mcp-bridge] Auto-init skipped (non-fatal):", err.message || err);
|
|
45
|
+
}
|