UNPKG

it-tools-mcp

Version:

MCP-compliant server access to over 100 IT tools and utilities commonly used by developers, system administrators, and IT professionals.

23 lines (22 loc) 675 B
import { z } from "zod"; import fs from "fs"; export function registerCat(server) { server.registerTool("cat", { inputSchema: { file: z.string().describe("File path") }, // VS Code compliance annotations annotations: { title: "Cat", 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}` }] }; } }); }