bookworm-boot/拓展/mcp-auto-loader.js

30 lines
887 B
JavaScript
Raw Normal View History

#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const os = require('os');
const { execSync } = require('child_process');
console.log('MCP Auto Loader v1.0');
console.log('====================\n');
const outputDir = 'E:\';
const services = {
playwright: '@modelcontextprotocol/server-playwright',
'chrome-devtools': '@executeautomation/chrome-devtools-mcp',
github: '@modelcontextprotocol/server-github',
slack: '@modelcontextprotocol/server-slack',
linear: '@modelcontextprotocol/server-linear'
};
const mcpServers = {};
for (const [name, pkg] of Object.entries(services)) {
mcpServers[name] = {
command: 'cmd',
args: ['/c', 'npx', '-y', pkg]
};
}
const configPath = path.join(outputDir, 'mcp-configs-summary.json');
fs.writeFileSync(configPath, JSON.stringify({ mcpServers }, null, 2));
console.log('Config saved to:', configPath);