opencode-azure-setup 1.0.3 → 1.0.5
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/index.js +34 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -364,6 +364,40 @@ async function main() {
|
|
|
364
364
|
},
|
|
365
365
|
};
|
|
366
366
|
|
|
367
|
+
// Install and configure MCP Marketplace
|
|
368
|
+
console.log();
|
|
369
|
+
console.log(colors.blue + 'Setting up MCP Marketplace...' + colors.reset);
|
|
370
|
+
|
|
371
|
+
const mcpDir = path.join(os.homedir(), '.config', 'opencode', 'mcps', 'mcp-marketplace');
|
|
372
|
+
fs.mkdirSync(mcpDir, { recursive: true });
|
|
373
|
+
|
|
374
|
+
try {
|
|
375
|
+
const { execFileSync } = await import('child_process');
|
|
376
|
+
|
|
377
|
+
// Initialize package.json if not exists
|
|
378
|
+
const pkgPath = path.join(mcpDir, 'package.json');
|
|
379
|
+
if (!fs.existsSync(pkgPath)) {
|
|
380
|
+
fs.writeFileSync(pkgPath, JSON.stringify({ name: 'opencode-mcps', version: '1.0.0', type: 'module' }, null, 2));
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// Install mcp-marketplace package locally (no sudo needed)
|
|
384
|
+
execFileSync('npm', ['install', 'opencode-mcp-marketplace@latest'], { cwd: mcpDir, stdio: 'pipe' });
|
|
385
|
+
|
|
386
|
+
const mcpPath = path.join(mcpDir, 'node_modules', 'opencode-mcp-marketplace', 'dist', 'index.js');
|
|
387
|
+
|
|
388
|
+
// Add to config
|
|
389
|
+
config.mcp = config.mcp || {};
|
|
390
|
+
config.mcp['mcp-marketplace'] = {
|
|
391
|
+
command: 'node',
|
|
392
|
+
args: [mcpPath],
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
console.log(colors.green + '✓ MCP Marketplace installed!' + colors.reset);
|
|
396
|
+
} catch (e) {
|
|
397
|
+
console.log(colors.yellow + '⚠ MCP Marketplace install skipped (npm not available or failed)' + colors.reset);
|
|
398
|
+
console.log(colors.dim + ' You can install manually: npm install -g opencode-mcp-marketplace' + colors.reset);
|
|
399
|
+
}
|
|
400
|
+
|
|
367
401
|
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
368
402
|
|
|
369
403
|
console.log();
|