Skip to main content
Glama
SETUP-MCP-SYSTEM.ps1β€’6.43 kB
# MCP AUTO-HANDOFF SYSTEM - ONE-CLICK SETUP # Run this once to set up everything Write-Host "πŸš€ MCP Auto-Handoff System Setup" -ForegroundColor Cyan Write-Host "=================================" -ForegroundColor Cyan Write-Host "" # Step 1: Create folder structure Write-Host "πŸ“ Creating folder structure..." -ForegroundColor Yellow $folders = @( "C:\MCP\src\agents\core", "C:\MCP\src\logging", "C:\MCP\handoffs", "C:\MCP\logs\system" ) foreach ($folder in $folders) { if (!(Test-Path $folder)) { New-Item -ItemType Directory -Path $folder -Force | Out-Null Write-Host " βœ… Created: $folder" -ForegroundColor Green } else { Write-Host " βœ“ Exists: $folder" -ForegroundColor Gray } } Write-Host "" # Step 2: Create conversation-continuity-agent.js Write-Host "πŸ“ Creating conversation-continuity-agent.js..." -ForegroundColor Yellow $agentContent = @' // CONVERSATION CONTINUITY AGENT // Monitors token usage and creates handoff documents for conversation continuity import { promises as fs } from 'fs'; import path from 'path'; export class ConversationContinuityAgent { constructor() { this.name = 'ConversationContinuityAgent'; this.currentConversation = { startTime: new Date(), estimatedTokens: 0, keyDecisions: [], codeCreated: [], nextSteps: [], criticalContext: [] }; } async createHandoff(summary) { console.log('πŸ“ Creating handoff document...'); const handoff = { metadata: { createdAt: new Date().toISOString(), summary: summary || 'Conversation handoff' }, context: this.currentConversation }; const handoffDir = 'C:/MCP/handoffs'; await fs.mkdir(handoffDir, { recursive: true }); const timestamp = new Date().toISOString().replace(/[:.]/g, '-'); const handoffPath = path.join(handoffDir, `handoff-${timestamp}.json`); await fs.writeFile(handoffPath, JSON.stringify(handoff, null, 2)); console.log('βœ… Handoff created:', handoffPath); return { success: true, handoffPath }; } } export const conversationContinuityAgent = new ConversationContinuityAgent(); '@ Set-Content -Path "C:\MCP\src\agents\core\conversation-continuity-agent.js" -Value $agentContent Write-Host " βœ… Created agent file" -ForegroundColor Green Write-Host "" # Step 3: Create auto-handoff.js Write-Host "πŸ“ Creating auto-handoff.js..." -ForegroundColor Yellow $autoHandoffContent = @' // AUTO-HANDOFF SYSTEM import { conversationContinuityAgent } from './src/agents/core/conversation-continuity-agent.js'; class AutoHandoffSystem { constructor() { this.monitoring = false; } start() { console.log('πŸ”„ Auto-Handoff System: ACTIVE'); this.monitoring = true; } async createHandoff() { const summary = 'End of conversation handoff'; await conversationContinuityAgent.createHandoff(summary); } stop() { this.monitoring = false; console.log('πŸ”„ Auto-Handoff System: STOPPED'); } } const autoHandoff = new AutoHandoffSystem(); export default autoHandoff; '@ Set-Content -Path "C:\MCP\auto-handoff.js" -Value $autoHandoffContent Write-Host " βœ… Created auto-handoff.js" -ForegroundColor Green Write-Host "" # Step 4: Create startup.js Write-Host "πŸ“ Creating startup.js..." -ForegroundColor Yellow $startupContent = @' // MCP SYSTEM STARTUP import autoHandoff from './auto-handoff.js'; console.log('═══════════════════════════════════════════════'); console.log(' πŸš€ MCP AGENT SYSTEM - STARTING UP'); console.log('═══════════════════════════════════════════════\n'); async function startup() { console.log('πŸ”„ Starting conversation continuity monitoring...'); autoHandoff.start(); console.log(' βœ… Auto-handoff system active\n'); console.log('═══════════════════════════════════════════════'); console.log(' βœ… MCP SYSTEM READY'); console.log('═══════════════════════════════════════════════\n'); console.log('πŸ’‘ HANDOFF SYSTEM:'); console.log(' β€’ Monitors token usage continuously'); console.log(' β€’ Creates handoff at conversation end'); console.log(' β€’ Handoffs saved to: C:\\MCP\\handoffs\\\n'); console.log('Press Ctrl+C to stop\n'); } startup(); process.on('SIGINT', () => { console.log('\n\nπŸ›‘ Shutting down MCP System...'); autoHandoff.stop(); process.exit(0); }); '@ Set-Content -Path "C:\MCP\startup.js" -Value $startupContent Write-Host " βœ… Created startup.js" -ForegroundColor Green Write-Host "" # Step 5: Create batch file Write-Host "πŸ“ Creating START-MCP-SYSTEM.bat..." -ForegroundColor Yellow $batchContent = @' @echo off echo Starting MCP Agent System... cd C:\MCP node startup.js pause '@ Set-Content -Path "C:\MCP\START-MCP-SYSTEM.bat" -Value $batchContent Write-Host " βœ… Created batch file" -ForegroundColor Green Write-Host "" # Step 6: Test Write-Host "πŸ§ͺ Testing system..." -ForegroundColor Yellow Write-Host "" Set-Location C:\MCP Write-Host "═══════════════════════════════════════════════" -ForegroundColor Cyan Write-Host " βœ… SETUP COMPLETE!" -ForegroundColor Green Write-Host "═══════════════════════════════════════════════" -ForegroundColor Cyan Write-Host "" Write-Host "To start MCP system, run:" -ForegroundColor Yellow Write-Host " cd C:\MCP" -ForegroundColor White Write-Host " node startup.js" -ForegroundColor White Write-Host "" Write-Host "Or double-click:" -ForegroundColor Yellow Write-Host " C:\MCP\START-MCP-SYSTEM.bat" -ForegroundColor White Write-Host "" Read-Host "Press Enter to start MCP system now" node startup.js

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