UNPKG

it-tools-mcp

Version:

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

29 lines (28 loc) 1.05 kB
import { z } from "zod"; import dns from "dns"; export function registerDig(server) { server.registerTool("dig", { description: "Perform DNS lookup with dig command", inputSchema: { target: z.string().describe("Hostname or IP address"), type: z.string().default("A").describe("DNS record type") }, // VS Code compliance annotations annotations: { title: "Dig", description: "Perform DNS lookup with dig command", readOnlyHint: false } }, async ({ target, type }) => { return new Promise((resolve) => { dns.resolve(target, type, (err, addresses) => { if (err) { resolve({ content: [{ type: "text", text: `dig failed: ${err.message}` }] }); } else { resolve({ content: [{ type: "text", text: `${type} records for ${target}:\n${JSON.stringify(addresses, null, 2)}` }] }); } }); }); }); }