Skip to main content
Glama

IT-MCP

by acampkin95
systemInfo.ts1.35 kB
import { CommandRunner, type CommandResult } from "../utils/commandRunner.js"; export interface SystemOverview { readonly uname: string; readonly uptime: string; readonly loadAverage: string; readonly memory: string; readonly topProcesses: string; readonly diskUsage: string; } export class SystemInfoService { public constructor(private readonly runner: CommandRunner) {} public async getSystemOverview(processCount: number = 10): Promise<SystemOverview> { const limit = Math.max(1, Math.min(processCount, 50)); const [uname, uptime, top, vmStat, disk] = await Promise.all([ this.runner.run("uname -a"), this.runner.run("uptime"), this.runner.run(`top -l 1 -n ${limit}`), this.runner.run("vm_stat"), this.runner.run("df -h"), ]); return { uname: uname.stdout.trim(), uptime: uptime.stdout.trim(), loadAverage: this.extractLoadAverage(uptime), memory: vmStat.stdout.trim(), topProcesses: top.stdout.trim(), diskUsage: disk.stdout.trim(), }; } public async listLaunchDaemons(): Promise<CommandResult> { return this.runner.run("launchctl list"); } private extractLoadAverage(uptime: CommandResult): string { const match = uptime.stdout.match(/load averages?:\s*(.*)$/i); return match ? match[1] : uptime.stdout.trim(); } }

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/acampkin95/MCP'

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