@insforge/install 0.0.15 → 0.0.17

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 +11 -36
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -56,42 +56,17 @@ import {
56
56
 
57
57
  // Handle different config structures for different clients
58
58
  if (argv.client === "claude-code") {
59
- // Use Claude CLI for Claude Code
60
- const envArgs = Object.entries(envVars)
61
- .filter(([key]) => key !== 'CLIENT_NAME')
62
- .map(([key, value]) => {
63
- // Properly quote values for cross-platform compatibility
64
- const quotedValue = value.includes(' ') ? `"${value}"` : value;
65
- return `--env ${key}=${quotedValue}`;
66
- })
67
- .join(' ');
68
-
69
- try {
70
- // Find claude CLI path
71
- const claudePath = process.env.HOME ? `${process.env.HOME}/.claude/local/claude` : 'claude';
72
-
73
- // First try to remove existing insforge MCP if it exists
74
- try {
75
- execSync(`${claudePath} mcp remove ${name}`, {
76
- stdio: 'pipe',
77
- shell: true
78
- });
79
- logger.info("Removed existing insforge MCP installation.");
80
- } catch (removeError) {
81
- // It's okay if remove fails - the MCP might not exist
82
- logger.info("No existing insforge MCP found");
59
+ // Directly write to config file for Claude Code
60
+ if (!config.mcpServers) config.mcpServers = {};
61
+ config.mcpServers[name] = {
62
+ command: "npx",
63
+ args: ["-y", "@insforge/mcp@latest"],
64
+ env: {
65
+ API_KEY: envVars.API_KEY,
66
+ API_BASE_URL: envVars.API_BASE_URL
83
67
  }
84
-
85
- // Now add the MCP server
86
- const command = `${claudePath} mcp add ${name} ${envArgs} -- npx -y @insforge/mcp@latest`;
87
- logger.info("Adding insforge MCP server...");
88
- execSync(command, {
89
- stdio: 'inherit',
90
- shell: true
91
- });
92
- } catch (error) {
93
- throw new Error(`Failed to add MCP server via Claude CLI: ${error.message}`);
94
- }
68
+ };
69
+ writeConfig(config, argv.client);
95
70
  } else if (argv.client === "codex") {
96
71
  // Use Codex CLI for Codex
97
72
  const envArgs = Object.entries(envVars)
@@ -153,7 +128,7 @@ import {
153
128
  config.mcpServers[name] = {
154
129
  command: "npx",
155
130
  args: ["-y", "@insforge/mcp@latest"],
156
- env: {
131
+ a env: {
157
132
  API_KEY: envVars.API_KEY,
158
133
  API_BASE_URL: envVars.API_BASE_URL
159
134
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insforge/install",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "CLI tool for installing Insforge MCP servers across different AI clients",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",