@insforge/install 0.0.44 → 0.0.45
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 +32 -0
- package/dist/utils.js +4 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -234,6 +234,38 @@ import {
|
|
|
234
234
|
}
|
|
235
235
|
};
|
|
236
236
|
writeConfig(config, argv.client);
|
|
237
|
+
} else if (argv.client === "copilot") {
|
|
238
|
+
// Copilot uses "servers" instead of "mcpServers"
|
|
239
|
+
const fs = await import('fs');
|
|
240
|
+
const vscodeDir = path.join(process.cwd(), '.vscode');
|
|
241
|
+
const mcpConfigPath = path.join(vscodeDir, 'mcp.json');
|
|
242
|
+
|
|
243
|
+
if (!fs.existsSync(vscodeDir)) {
|
|
244
|
+
fs.mkdirSync(vscodeDir, { recursive: true });
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
let copilotConfig = { servers: {} };
|
|
248
|
+
if (fs.existsSync(mcpConfigPath)) {
|
|
249
|
+
try {
|
|
250
|
+
copilotConfig = JSON.parse(fs.readFileSync(mcpConfigPath, 'utf8'));
|
|
251
|
+
if (!copilotConfig.servers) copilotConfig.servers = {};
|
|
252
|
+
} catch (error) {
|
|
253
|
+
logger.warn(`Could not parse existing mcp.json: ${error.message}`);
|
|
254
|
+
copilotConfig = { servers: {} };
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
copilotConfig.servers[name] = {
|
|
259
|
+
command: "npx",
|
|
260
|
+
args: ["-y", mcpVersion],
|
|
261
|
+
env: {
|
|
262
|
+
API_KEY: envVars.API_KEY,
|
|
263
|
+
API_BASE_URL: envVars.API_BASE_URL
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
fs.writeFileSync(mcpConfigPath, JSON.stringify(copilotConfig, null, 2));
|
|
268
|
+
logger.info(`Configured Copilot MCP at: ${mcpConfigPath}`);
|
|
237
269
|
}
|
|
238
270
|
|
|
239
271
|
// Fetch instructions documentation and save to appropriate files
|
package/dist/utils.js
CHANGED
|
@@ -56,6 +56,10 @@ var clientPaths = {
|
|
|
56
56
|
codex: {
|
|
57
57
|
type: "file",
|
|
58
58
|
path: path.join(homeDir, ".codex", "mcp_config.json")
|
|
59
|
+
},
|
|
60
|
+
copilot: {
|
|
61
|
+
type: "file",
|
|
62
|
+
path: path.join(process.cwd(), ".vscode", "mcp.json")
|
|
59
63
|
}
|
|
60
64
|
};
|
|
61
65
|
var clientNames = Object.keys(clientPaths);
|