UNPKG

mcp-orchestrator

Version:

MCP Orchestrator - Discover and install MCPs with automatic OAuth support. Uses Claude CLI for OAuth MCPs (Canva, Asana, etc). 34 trusted MCPs from Claude Partners.

77 lines (76 loc) 2.78 kB
#!/usr/bin/env node /** * Automated Claude Desktop setup script * Adds MCP Orchestrator to Claude Desktop configuration */ import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs'; import { join } from 'path'; import { homedir } from 'os'; function getClaudeConfigPath() { const platform = process.platform; if (platform === 'win32') { // Windows return join(process.env.APPDATA || join(homedir(), 'AppData', 'Roaming'), 'Claude', 'claude_desktop_config.json'); } else if (platform === 'darwin') { // macOS return join(homedir(), 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json'); } else { // Linux return join(homedir(), '.config', 'Claude', 'claude_desktop_config.json'); } } function setupClaude() { console.log('🚀 Setting up MCP Orchestrator for Claude Desktop...\n'); const configPath = getClaudeConfigPath(); const configDir = configPath.substring(0, configPath.lastIndexOf(join('', ''))); console.log(`📁 Config location: ${configPath}`); // Create directory if it doesn't exist if (!existsSync(configDir)) { console.log('📂 Creating Claude config directory...'); mkdirSync(configDir, { recursive: true }); } // Read existing config or create new one let config = { mcpServers: {} }; if (existsSync(configPath)) { console.log('📖 Found existing config, updating...'); try { const existing = readFileSync(configPath, 'utf8'); config = JSON.parse(existing); if (!config.mcpServers) { config.mcpServers = {}; } } catch (err) { console.log('⚠️ Existing config is invalid, creating new one...'); } } else { console.log('📝 Creating new config...'); } // Add orchestrator if (config.mcpServers.orchestrator) { console.log('⚠️ MCP Orchestrator already configured!'); console.log(' Current command:', config.mcpServers.orchestrator.command); } else { config.mcpServers.orchestrator = { command: 'mcp-orchestrator' }; console.log('✅ Added MCP Orchestrator to config'); } // Write config writeFileSync(configPath, JSON.stringify(config, null, 2)); console.log('💾 Config saved successfully!\n'); console.log('✨ Setup complete! Please restart Claude Desktop.\n'); console.log('📝 Test it by asking Claude:'); console.log(' - "What MCP servers are available?"'); console.log(' - "I need to analyze CSV files"'); console.log(' - "Connect to the filesystem MCP"\n'); } // Run setup setupClaude(); export { setupClaude };