@insforge/install 0.0.16 → 0.0.18
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/index.js +10 -32
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -56,39 +56,17 @@ import {
|
|
|
56
56
|
|
|
57
57
|
// Handle different config structures for different clients
|
|
58
58
|
if (argv.client === "claude-code") {
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
.join(' ');
|
|
68
|
-
|
|
69
|
-
try {
|
|
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");
|
|
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
|
|
80
67
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const command = `claude mcp add ${name} ${envArgs} -- npx -y @insforge/mcp@latest`;
|
|
84
|
-
logger.info("Adding insforge MCP server...");
|
|
85
|
-
execSync(command, {
|
|
86
|
-
stdio: 'inherit',
|
|
87
|
-
shell: true
|
|
88
|
-
});
|
|
89
|
-
} catch (error) {
|
|
90
|
-
throw new Error(`Failed to add MCP server via Claude CLI: ${error.message}`);
|
|
91
|
-
}
|
|
68
|
+
};
|
|
69
|
+
writeConfig(config, argv.client);
|
|
92
70
|
} else if (argv.client === "codex") {
|
|
93
71
|
// Use Codex CLI for Codex
|
|
94
72
|
const envArgs = Object.entries(envVars)
|