Skip to main content
Glama

IT-MCP

by acampkin95
vpn.ts1.46 kB
import { CommandExecutionError, CommandRunner, type CommandResult, } from "../utils/commandRunner.js"; export interface VpnDiagnostics { readonly scutilList: CommandResult; readonly netInterfaces: CommandResult; readonly routes: CommandResult; readonly wifiInfo?: CommandResult; readonly runningProcesses: CommandResult; } export class VpnService { public constructor(private readonly runner: CommandRunner) {} public async collectDiagnostics(includeWifi: boolean = true): Promise<VpnDiagnostics> { const [scutilList, netInterfaces, routes, runningProcesses] = await Promise.all([ this.runner.run("scutil --nc list"), this.runner.run("ifconfig"), this.runner.run("netstat -rn"), this.runner.run("pgrep -fl '(vpn|pppd|wireguard|openvpn|globalprotect|anyconnect)'"), ]); let wifiInfo: CommandResult | undefined; if (includeWifi) { try { wifiInfo = await this.runner.run("system_profiler SPAirPortDataType"); } catch (error) { const fallback = error instanceof CommandExecutionError ? error.result : undefined; wifiInfo = fallback ?? { command: "system_profiler SPAirPortDataType", stdout: "", stderr: error instanceof Error ? error.message : String(error), code: null, }; } } return { scutilList, netInterfaces, routes, wifiInfo, runningProcesses, }; } }

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