Skip to main content
Glama

Electron Terminal MCP Server

rebuild.js1.18 kB
import { execSync } from 'child_process'; import path from 'path'; import os from 'os'; import fs from 'fs'; import { fileURLToPath } from 'url'; // Get the directory name in ES module scope const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); // Function to read JSON file const readJsonFile = (filePath) => { const absolutePath = path.resolve(__dirname, filePath); const fileContent = fs.readFileSync(absolutePath, 'utf8'); return JSON.parse(fileContent); }; // Get electron version const electronPackageJson = readJsonFile('./node_modules/electron/package.json'); const electronVersion = process.env.ELECTRON_VERSION || electronPackageJson.version; console.log(`Rebuilding native modules for Electron ${electronVersion}...`); // Run electron rebuild try { // Use npx to reliably execute the electron-rebuild command const command = `npx electron-rebuild -f -v ${electronVersion}`; console.log(`Running: ${command}`); // Execute the command using npx execSync(command, { stdio: 'inherit' }); console.log('Rebuild complete!'); } catch (error) { console.error('Failed to rebuild:', error); process.exit(1); }

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/nexon33/console-terminal-mcp-server'

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