@insforge/install 0.0.5 → 0.0.8

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.
Files changed (2) hide show
  1. package/dist/index.js +23 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -59,12 +59,32 @@ import {
59
59
  // Use Claude CLI for Claude Code
60
60
  const envArgs = Object.entries(envVars)
61
61
  .filter(([key]) => key !== 'CLIENT_NAME')
62
- .map(([key, value]) => `-e ${key}=${value}`)
62
+ .map(([key, value]) => {
63
+ // Properly quote values for cross-platform compatibility
64
+ const quotedValue = value.includes(' ') ? `"${value}"` : value;
65
+ return `-e ${key}=${quotedValue}`;
66
+ })
63
67
  .join(' ');
64
68
 
65
69
  try {
66
- execSync(`claude mcp add ${name} ${envArgs} -- npx -y @insforge/insforge-mcp@latest`, {
67
- stdio: 'inherit'
70
+ // First try to remove existing insforge MCP if it exists
71
+ try {
72
+ execSync(`claude mcp remove ${name}`, {
73
+ stdio: 'pipe',
74
+ shell: true
75
+ });
76
+ logger.info("Removed existing insforge MCP installation.");
77
+ } catch (removeError) {
78
+ // It's okay if remove fails - the MCP might not exist
79
+ logger.info("No existing insforge MCP found or removal skipped.");
80
+ }
81
+
82
+ // Now add the MCP server
83
+ const command = `claude mcp add ${name} ${envArgs} -- npx -y @insforge/insforge-mcp@latest`;
84
+ logger.info("Adding insforge MCP server...");
85
+ execSync(command, {
86
+ stdio: 'inherit',
87
+ shell: true
68
88
  });
69
89
  } catch (error) {
70
90
  throw new Error(`Failed to add MCP server via Claude CLI: ${error.message}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insforge/install",
3
- "version": "0.0.5",
3
+ "version": "0.0.8",
4
4
  "description": "CLI tool for installing Insforge MCP servers across different AI clients",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",