Skip to main content
Glama

IT Tools MCP Server

index.ts•1.1 kB
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; import psList from "ps-list"; export function registerPs(server: McpServer) { server.registerTool("ps", { description: "List running processes", inputSchema: {}, // VS Code compliance annotations annotations: { title: "Ps", description: "List running processes", readOnlyHint: false } }, async () => { try { const processes = await psList(); // Defensive: handle missing properties and filter out bad entries const output = processes .map(p => { const pid = p.pid ?? 'N/A'; const name = p.name ?? 'N/A'; return `${pid}\t${name}`; }) .join("\n"); return { content: [{ type: "text", text: output || 'No processes found.' }] }; } catch (error) { // Log error for debugging console.error('ps error:', error); return { content: [{ type: "text", text: `ps failed: ${error instanceof Error ? error.message : error}` }] }; } } ); }

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/wrenchpilot/it-tools-mcp'

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