@insforge/install 0.0.20 → 0.0.22
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/README.md +18 -1
- package/dist/index.js +18 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,6 +14,9 @@ npx @insforge/install --client roocode --env API_KEY=YOUR_API_KEY --env API_BASE
|
|
|
14
14
|
npx @insforge/install --client codex --env API_KEY=YOUR_API_KEY --env API_BASE_URL=http://localhost:7130
|
|
15
15
|
npx @insforge/install --client trae --env API_KEY=YOUR_API_KEY --env API_BASE_URL=http://localhost:7130
|
|
16
16
|
|
|
17
|
+
# Install dev version for testing (uses @insforge/mcp@dev)
|
|
18
|
+
npx @insforge/install --client cursor --env API_KEY=YOUR_API_KEY --env API_BASE_URL=http://localhost:7130 --dev
|
|
19
|
+
|
|
17
20
|
# With custom base URL (e.g., production server)
|
|
18
21
|
npx @insforge/install --client cursor --env API_KEY=YOUR_API_KEY --env API_BASE_URL=https://api.insforge.com
|
|
19
22
|
```
|
|
@@ -38,6 +41,7 @@ npx @insforge/install --client cursor --env API_KEY=YOUR_API_KEY --env API_BASE_
|
|
|
38
41
|
--env KEY=VALUE Environment variables (can be used multiple times)
|
|
39
42
|
API_KEY is required
|
|
40
43
|
API_BASE_URL is optional (default: http://localhost:7130)
|
|
44
|
+
--dev Install dev version (@insforge/mcp@dev) instead of latest
|
|
41
45
|
```
|
|
42
46
|
|
|
43
47
|
## Examples
|
|
@@ -49,6 +53,9 @@ npx @insforge/install --client claude-code --env API_KEY=your-api-key-here --env
|
|
|
49
53
|
|
|
50
54
|
# Install for Windsurf with production server
|
|
51
55
|
npx @insforge/install --client windsurf --env API_KEY=your-api-key --env API_BASE_URL=https://api.insforge.com
|
|
56
|
+
|
|
57
|
+
# Install dev version for internal testing
|
|
58
|
+
npx @insforge/install --client cursor --env API_KEY=your-api-key --env API_BASE_URL=http://localhost:7130 --dev
|
|
52
59
|
```
|
|
53
60
|
|
|
54
61
|
### What This Does
|
|
@@ -56,10 +63,20 @@ npx @insforge/install --client windsurf --env API_KEY=your-api-key --env API_BAS
|
|
|
56
63
|
The installer will:
|
|
57
64
|
1. Create or update the MCP configuration file for your chosen client
|
|
58
65
|
2. Add the Insforge MCP server with your API credentials
|
|
59
|
-
3. Configure it to run via `npx @insforge/mcp@latest`
|
|
66
|
+
3. Configure it to run via `npx @insforge/mcp@latest` (or `@insforge/mcp@dev` with `--dev` flag)
|
|
60
67
|
|
|
61
68
|
After installation, restart your AI client to load the Insforge MCP server.
|
|
62
69
|
|
|
70
|
+
### Dev vs Production Versions
|
|
71
|
+
|
|
72
|
+
- **Production** (default): `npx @insforge/install --client <client> ...`
|
|
73
|
+
- Installs `@insforge/mcp@latest` - stable, tested version
|
|
74
|
+
- Recommended for general use
|
|
75
|
+
|
|
76
|
+
- **Development** (`--dev` flag): `npx @insforge/install --client <client> ... --dev`
|
|
77
|
+
- Installs `@insforge/mcp@dev` - latest features, may be unstable
|
|
78
|
+
- For team testing and early access to new features
|
|
79
|
+
|
|
63
80
|
## License
|
|
64
81
|
|
|
65
82
|
MIT
|
package/dist/index.js
CHANGED
|
@@ -24,6 +24,10 @@ import {
|
|
|
24
24
|
type: "string",
|
|
25
25
|
description: "Environment variables as key=value pairs (can be used multiple times). API_KEY is required.",
|
|
26
26
|
array: true
|
|
27
|
+
}).option("dev", {
|
|
28
|
+
type: "boolean",
|
|
29
|
+
description: "Install dev version (@insforge/mcp@dev) instead of latest",
|
|
30
|
+
default: false
|
|
27
31
|
});
|
|
28
32
|
}
|
|
29
33
|
async function handler(argv) {
|
|
@@ -51,10 +55,9 @@ import {
|
|
|
51
55
|
envVars.API_BASE_URL = "http://localhost:7130";
|
|
52
56
|
}
|
|
53
57
|
const name = "insforge";
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const config = readConfig(argv.client);
|
|
58
|
+
const mcpVersion = argv.dev ? "@insforge/mcp@dev" : "@insforge/mcp@latest";
|
|
59
|
+
try {
|
|
60
|
+
const config = readConfig(argv.client);
|
|
58
61
|
|
|
59
62
|
// Handle different config structures for different clients
|
|
60
63
|
if (argv.client === "claude-code") {
|
|
@@ -62,7 +65,7 @@ import {
|
|
|
62
65
|
const homeDir = os.homedir();
|
|
63
66
|
const isWindows = process.platform === 'win32';
|
|
64
67
|
const claudePath = isWindows
|
|
65
|
-
? path.join(homeDir, '
|
|
68
|
+
? path.join(homeDir, 'AppData', 'Roaming', 'npm', 'claude')
|
|
66
69
|
: path.join(homeDir, '.claude', 'local', 'claude');
|
|
67
70
|
|
|
68
71
|
const envArgs = Object.entries(envVars)
|
|
@@ -84,8 +87,8 @@ import {
|
|
|
84
87
|
}
|
|
85
88
|
|
|
86
89
|
// Now add the MCP server
|
|
87
|
-
const command = `"${claudePath}" mcp add ${name} ${envArgs} -- npx -y
|
|
88
|
-
logger.info(
|
|
90
|
+
const command = `"${claudePath}" mcp add ${name} ${envArgs} -- npx -y ${mcpVersion}`;
|
|
91
|
+
logger.info(`Adding insforge MCP server (${mcpVersion})...`);
|
|
89
92
|
execSync(command, {
|
|
90
93
|
stdio: 'inherit',
|
|
91
94
|
shell: true
|
|
@@ -117,8 +120,8 @@ import {
|
|
|
117
120
|
}
|
|
118
121
|
|
|
119
122
|
// Now add the MCP server using codex CLI with --env flags
|
|
120
|
-
const command = `codex mcp add ${name} ${envArgs} -- npx -y
|
|
121
|
-
logger.info(
|
|
123
|
+
const command = `codex mcp add ${name} ${envArgs} -- npx -y ${mcpVersion}`;
|
|
124
|
+
logger.info(`Adding insforge MCP server (${mcpVersion})...`);
|
|
122
125
|
execSync(command, {
|
|
123
126
|
stdio: 'inherit',
|
|
124
127
|
shell: true
|
|
@@ -131,7 +134,7 @@ import {
|
|
|
131
134
|
if (!config.mcpServers) config.mcpServers = {};
|
|
132
135
|
config.mcpServers[name] = {
|
|
133
136
|
command: "npx",
|
|
134
|
-
args: ["-y",
|
|
137
|
+
args: ["-y", mcpVersion],
|
|
135
138
|
env: {
|
|
136
139
|
API_KEY: envVars.API_KEY,
|
|
137
140
|
API_BASE_URL: envVars.API_BASE_URL
|
|
@@ -142,7 +145,7 @@ import {
|
|
|
142
145
|
if (!config.mcpServers) config.mcpServers = {};
|
|
143
146
|
config.mcpServers[name] = {
|
|
144
147
|
command: "npx",
|
|
145
|
-
args: ["-y",
|
|
148
|
+
args: ["-y", mcpVersion],
|
|
146
149
|
env: {
|
|
147
150
|
API_KEY: envVars.API_KEY,
|
|
148
151
|
API_BASE_URL: envVars.API_BASE_URL
|
|
@@ -153,7 +156,7 @@ import {
|
|
|
153
156
|
if (!config.mcpServers) config.mcpServers = {};
|
|
154
157
|
config.mcpServers[name] = {
|
|
155
158
|
command: "npx",
|
|
156
|
-
args: ["-y",
|
|
159
|
+
args: ["-y", mcpVersion],
|
|
157
160
|
env: {
|
|
158
161
|
API_KEY: envVars.API_KEY,
|
|
159
162
|
API_BASE_URL: envVars.API_BASE_URL
|
|
@@ -161,10 +164,9 @@ import {
|
|
|
161
164
|
};
|
|
162
165
|
writeConfig(config, argv.client);
|
|
163
166
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}
|
|
167
|
+
logger.box(green(`Successfully installed Insforge MCP server in ${argv.client}.`));
|
|
168
|
+
} catch (e) {
|
|
169
|
+
logger.error(red(e.message));
|
|
168
170
|
}
|
|
169
171
|
}
|
|
170
172
|
|