UNPKG

it-tools-mcp

Version:

Full MCP 2025-06-18 compliant server with 121+ IT tools, logging, ping, progress tracking, cancellation, and sampling utilities

25 lines (24 loc) 779 B
import { z } from "zod"; import fs from "fs"; export function registerCat(server) { server.registerTool("cat", { description: "Display content of a file", inputSchema: { file: z.string().describe("File path") }, // VS Code compliance annotations annotations: { title: "Cat", description: "Display content of a file", readOnlyHint: false } }, async ({ file }) => { try { const data = fs.readFileSync(file, "utf8"); return { content: [{ type: "text", text: data }] }; } catch (error) { return { content: [{ type: "text", text: `cat failed: ${error instanceof Error ? error.message : error}` }] }; } }); }