Skip to main content
Glama
update_mcp_setup.ps1β€’8.15 kB
# MCP Puppet Production Setup & Update Script # Run this in PowerShell as Administrator Write-Host "🎭 MCP Puppet Production Setup & Update Script" -ForegroundColor Cyan Write-Host "=============================================" -ForegroundColor Cyan # Check if running as administrator $isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator") if (-not $isAdmin) { Write-Host "⚠️ Please run this script as Administrator" -ForegroundColor Yellow exit 1 } # Step 1: Update Claude Desktop Configuration Write-Host "`nπŸ“ Step 1: Updating Claude Desktop Configuration..." -ForegroundColor Green $claudeConfigPath = "$env:APPDATA\Claude\claude_desktop_config.json" $configContent = @' { "mcpServers": { "filesystem": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-filesystem", "G:\\", "N:\\", "M:\\", "X:\\", "F:\\", "C:\\" ] }, "puppet-production": { "command": "node", "args": [ "-e", "const WebSocket = require('ws'); const ws = new WebSocket('wss://0074b446-63ea-4ec0-87f6-65be05f05ade-00-38w5635e857ah.kirk.replit.dev:3000/mcp'); ws.on('open', () => { process.stdin.on('data', (data) => ws.send(data)); ws.on('message', (data) => process.stdout.write(data)); process.stdin.resume(); }); ws.on('error', (err) => { console.error('WebSocket error:', err); process.exit(1); });" ], "env": {} } } } '@ # Create Claude config directory if it doesn't exist $claudeConfigDir = Split-Path $claudeConfigPath -Parent if (-not (Test-Path $claudeConfigDir)) { New-Item -Path $claudeConfigDir -ItemType Directory -Force | Out-Null Write-Host "βœ… Created Claude config directory" -ForegroundColor Green } # Backup existing config if it exists if (Test-Path $claudeConfigPath) { $backupPath = "$claudeConfigPath.backup.$(Get-Date -Format 'yyyyMMdd_HHmmss')" Copy-Item $claudeConfigPath $backupPath Write-Host "βœ… Backed up existing config to: $backupPath" -ForegroundColor Green } # Write new configuration $configContent | Out-File -FilePath $claudeConfigPath -Encoding UTF8 Write-Host "βœ… Updated Claude Desktop configuration" -ForegroundColor Green # Step 2: Check and Install Dependencies Write-Host "`nπŸ”§ Step 2: Checking Dependencies..." -ForegroundColor Green # Check Node.js try { $nodeVersion = node --version Write-Host "βœ… Node.js: $nodeVersion" -ForegroundColor Green } catch { Write-Host "❌ Node.js not found. Please install Node.js from https://nodejs.org" -ForegroundColor Red exit 1 } # Check npm try { $npmVersion = npm --version Write-Host "βœ… npm: $npmVersion" -ForegroundColor Green } catch { Write-Host "❌ npm not found" -ForegroundColor Red exit 1 } # Update npm to latest Write-Host "πŸ”„ Updating npm to latest version..." -ForegroundColor Yellow try { npm install -g npm@latest | Out-Null Write-Host "βœ… npm updated" -ForegroundColor Green } catch { Write-Host "⚠️ npm update failed (may require different permissions)" -ForegroundColor Yellow } # Install/Update WebSocket dependency globally Write-Host "πŸ”„ Installing/Updating WebSocket dependency..." -ForegroundColor Yellow try { npm install -g ws | Out-Null Write-Host "βœ… WebSocket dependency installed" -ForegroundColor Green } catch { Write-Host "⚠️ WebSocket installation failed" -ForegroundColor Yellow } # Step 3: Test MCP Server Connection Write-Host "`nπŸ”— Step 3: Testing MCP Server Connection..." -ForegroundColor Green $mcpUrl = "https://0074b446-63ea-4ec0-87f6-65be05f05ade-00-38w5635e857ah.kirk.replit.dev/api/health" try { $response = Invoke-RestMethod -Uri $mcpUrl -TimeoutSec 10 if ($response.status -eq "ok") { Write-Host "βœ… MCP Server is responding" -ForegroundColor Green Write-Host " Services:" -ForegroundColor Gray Write-Host " - OpenAI: $($response.services.openai)" -ForegroundColor Gray Write-Host " - Affogato: $($response.services.affogato)" -ForegroundColor Gray Write-Host " - ElevenLabs: $($response.services.elevenlabs)" -ForegroundColor Gray Write-Host " - Notion: $($response.services.notion)" -ForegroundColor Gray } } catch { Write-Host "❌ MCP Server connection failed: $($_.Exception.Message)" -ForegroundColor Red } # Step 4: Test WebSocket Connection Write-Host "`n🌐 Step 4: Testing WebSocket Connection..." -ForegroundColor Green $wsTestScript = @' const WebSocket = require('ws'); const ws = new WebSocket('wss://0074b446-63ea-4ec0-87f6-65be05f05ade-00-38w5635e857ah.kirk.replit.dev:3000/mcp'); ws.on('open', () => { console.log('βœ… WebSocket connection successful'); ws.send(JSON.stringify({ jsonrpc: '2.0', method: 'initialize', params: { protocolVersion: '2025-06-18', capabilities: {}, clientInfo: { name: 'test-client', version: '1.0.0' } }, id: 1 })); }); ws.on('message', (data) => { const response = JSON.parse(data.toString()); if (response.result && response.result.serverInfo) { console.log('βœ… MCP Protocol handshake successful'); console.log(' Server:', response.result.serverInfo.name, response.result.serverInfo.version); } ws.close(); }); ws.on('error', (error) => { console.log('❌ WebSocket connection failed:', error.message); }); ws.on('close', () => { process.exit(0); }); setTimeout(() => { console.log('⏰ Connection timeout'); process.exit(1); }, 5000); '@ try { $wsTestScript | node } catch { Write-Host "❌ WebSocket test failed: $($_.Exception.Message)" -ForegroundColor Red } # Step 5: Kill and Restart Claude Desktop Write-Host "`nπŸ”„ Step 5: Restarting Claude Desktop..." -ForegroundColor Green # Kill Claude Desktop processes try { Get-Process -Name "Claude" -ErrorAction SilentlyContinue | Stop-Process -Force Write-Host "βœ… Stopped Claude Desktop processes" -ForegroundColor Green } catch { Write-Host "⚠️ No Claude Desktop processes found" -ForegroundColor Yellow } # Wait a moment Start-Sleep -Seconds 2 # Try to start Claude Desktop (common installation paths) $claudePaths = @( "$env:LOCALAPPDATA\Programs\Claude\Claude.exe", "$env:APPDATA\Claude\Claude.exe", "C:\Program Files\Claude\Claude.exe", "C:\Program Files (x86)\Claude\Claude.exe" ) $claudeStarted = $false foreach ($path in $claudePaths) { if (Test-Path $path) { try { Start-Process $path Write-Host "βœ… Started Claude Desktop: $path" -ForegroundColor Green $claudeStarted = $true break } catch { Write-Host "⚠️ Failed to start Claude Desktop: $path" -ForegroundColor Yellow } } } if (-not $claudeStarted) { Write-Host "⚠️ Please manually start Claude Desktop" -ForegroundColor Yellow } # Final Summary Write-Host "`n🎯 Setup Complete!" -ForegroundColor Cyan Write-Host "=================" -ForegroundColor Cyan Write-Host "βœ… Claude Desktop configuration updated" -ForegroundColor Green Write-Host "βœ… Dependencies checked/updated" -ForegroundColor Green Write-Host "βœ… MCP server connectivity tested" -ForegroundColor Green Write-Host "βœ… Claude Desktop restarted" -ForegroundColor Green Write-Host "" Write-Host "πŸ“‹ Next Steps:" -ForegroundColor Yellow Write-Host "1. Open Claude Desktop" -ForegroundColor White Write-Host "2. Look for 'puppet-production' and 'filesystem' tools" -ForegroundColor White Write-Host "3. Test character creation functionality" -ForegroundColor White Write-Host "" Write-Host "πŸ”— MCP Server URLs:" -ForegroundColor Cyan Write-Host " Dashboard: https://0074b446-63ea-4ec0-87f6-65be05f05ade-00-38w5635e857ah.kirk.replit.dev" -ForegroundColor White Write-Host " WebSocket: wss://0074b446-63ea-4ec0-87f6-65be05f05ade-00-38w5635e857ah.kirk.replit.dev:3000/mcp" -ForegroundColor White Read-Host "`nPress Enter to exit"

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bermingham85/mcp-puppet-pipeline'

If you have feedback or need assistance with the MCP directory API, please join our Discord server