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.

26 lines (25 loc) 839 B
import { z } from "zod"; import dns from "dns"; export function registerNslookup(server) { server.registerTool("nslookup", { inputSchema: { target: z.string().describe("Hostname or IP address") }, // VS Code compliance annotations annotations: { title: "Nslookup", readOnlyHint: false } }, async ({ target }) => { return new Promise((resolve) => { dns.lookup(target, (err, address, family) => { if (err) { resolve({ content: [{ type: "text", text: `nslookup failed: ${err.message}` }] }); } else { resolve({ content: [{ type: "text", text: `Address: ${address}\nFamily: IPv${family}` }] }); } }); }); }); }