#!/usr/bin/env tsx import * as fs from 'fs'; import * as path from 'path'; import * as os from 'os'; /** * Script to restore default MCP server configurations */ async function restoreDefaultServers(): Promise { const correctDir = path.join(os.homedir(), '.config', 'hashgraph-online'); const correctPath = path.join(correctDir, 'mcp-servers.json'); console.log('🔧 Restoring default MCP server configurations...'); const defaultServers = [ { id: 'default-filesystem', name: 'Local Filesystem', type: 'filesystem', status: 'disconnected', enabled: true, config: { type: 'filesystem', rootPath: os.homedir(), }, tools: [], createdAt: new Date().toISOString(), updatedAt: new Date().toISOString(), }, { id: 'registry-1756139416766', name: 'Wikipedia', type: 'custom', status: 'disconnected', enabled: true, config: { type: 'custom', command: 'npx', args: ['-y', 'wikipedia-mcp'], env: {} }, tools: [], createdAt: '2025-08-25T16:30:16.766Z', updatedAt: new Date().toISOString(), }, { id: 'registry-1756306451137', name: 'QR Codes', type: 'custom', status: 'disconnected', enabled: true, config: { type: 'custom', command: 'npx', args: ['-y', 'qr-code-mcp'] }, tools: [], createdAt: '2025-08-27T14:54:11.137Z', updatedAt: new Date().toISOString(), }, { id: 'registry-1756306527687', name: 'Reddit', type: 'custom', status: 'disconnected', enabled: true, config: { type: 'custom', command: 'npx', args: ['-y', 'reddit-mcp'] }, tools: [], createdAt: '2025-08-27T14:55:27.687Z', updatedAt: new Date().toISOString(), } ]; try { if (!fs.existsSync(correctDir)) { fs.mkdirSync(correctDir, { recursive: true }); } const formattedData = JSON.stringify(defaultServers, null, 2) + '\n'; fs.writeFileSync(correctPath, formattedData, 'utf8'); console.log('✅ Default server configurations restored'); console.log(`📁 Saved to: ${correctPath}`); console.log(`📊 Configurations: ${defaultServers.length} servers`); defaultServers.forEach(server => { console.log(` - ${server.name} (${server.type})`); }); } catch (error) { console.error('❌ Failed to restore default configurations:', error); } } restoreDefaultServers().catch(console.error);