@insforge/install 0.0.26 → 0.0.28
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/.claude/settings.local.json +6 -0
- package/.mcp.json +15 -0
- package/dist/index.js +11 -35
- package/dist/utils.js +3 -3
- package/package.json +1 -1
package/.mcp.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"insforge": {
|
|
4
|
+
"command": "npx",
|
|
5
|
+
"args": [
|
|
6
|
+
"-y",
|
|
7
|
+
"@insforge/mcp@latest"
|
|
8
|
+
],
|
|
9
|
+
"env": {
|
|
10
|
+
"API_KEY": "ik_fff113df777823a0518b8067e4f4f49bb11661904af26b9fda2ac80892b0558c",
|
|
11
|
+
"API_BASE_URL": "http://localhost:7130"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -58,44 +58,20 @@ import {
|
|
|
58
58
|
const mcpVersion = argv.dev ? "@insforge/mcp@dev" : "@insforge/mcp@latest";
|
|
59
59
|
try {
|
|
60
60
|
const config = readConfig(argv.client);
|
|
61
|
-
|
|
61
|
+
|
|
62
62
|
// Handle different config structures for different clients
|
|
63
63
|
if (argv.client === "claude-code") {
|
|
64
|
-
//
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
.filter(([key]) => key !== 'CLIENT_NAME')
|
|
73
|
-
.map(([key, value]) => `-e ${key}=${value}`)
|
|
74
|
-
.join(' ');
|
|
75
|
-
|
|
76
|
-
try {
|
|
77
|
-
// First try to remove existing insforge MCP if it exists
|
|
78
|
-
try {
|
|
79
|
-
execSync(`"${claudePath}" mcp remove ${name}`, {
|
|
80
|
-
stdio: 'pipe',
|
|
81
|
-
shell: true
|
|
82
|
-
});
|
|
83
|
-
logger.info("Removed existing insforge MCP installation.");
|
|
84
|
-
} catch (removeError) {
|
|
85
|
-
// It's okay if remove fails - the MCP might not exist
|
|
86
|
-
logger.info("No existing insforge MCP found");
|
|
64
|
+
// Claude Code uses mcpServers at root level
|
|
65
|
+
if (!config.mcpServers) config.mcpServers = {};
|
|
66
|
+
config.mcpServers[name] = {
|
|
67
|
+
command: "npx",
|
|
68
|
+
args: ["-y", mcpVersion],
|
|
69
|
+
env: {
|
|
70
|
+
API_KEY: envVars.API_KEY,
|
|
71
|
+
API_BASE_URL: envVars.API_BASE_URL
|
|
87
72
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
const command = `"${claudePath}" mcp add ${name} ${envArgs} -- npx -y ${mcpVersion}`;
|
|
91
|
-
logger.info(`Adding insforge MCP server (${mcpVersion})...`);
|
|
92
|
-
execSync(command, {
|
|
93
|
-
stdio: 'inherit',
|
|
94
|
-
shell: true
|
|
95
|
-
});
|
|
96
|
-
} catch (error) {
|
|
97
|
-
throw new Error(`Failed to add MCP server via Claude CLI: ${error.message}`);
|
|
98
|
-
}
|
|
73
|
+
};
|
|
74
|
+
writeConfig(config, argv.client);
|
|
99
75
|
} else if (argv.client === "codex") {
|
|
100
76
|
// Use Codex CLI for Codex
|
|
101
77
|
const homeDir = os.homedir();
|
package/dist/utils.js
CHANGED
|
@@ -28,9 +28,9 @@ var platformPaths = {
|
|
|
28
28
|
var platform = process.platform;
|
|
29
29
|
var { baseDir, vscodePath } = platformPaths[platform];
|
|
30
30
|
var clientPaths = {
|
|
31
|
-
"claude-code": {
|
|
32
|
-
type: "file",
|
|
33
|
-
path: path.join(
|
|
31
|
+
"claude-code": {
|
|
32
|
+
type: "file",
|
|
33
|
+
path: path.join(process.cwd(), ".mcp.json")
|
|
34
34
|
},
|
|
35
35
|
cursor: {
|
|
36
36
|
type: "file",
|