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.

29 lines (28 loc) 787 B
import { z } from "zod"; export function registerEncodeHtml(server) { server.registerTool("encode_html", { inputSchema: { text: z.string().describe("Text to HTML encode"), }, // VS Code compliance annotations annotations: { title: "Encode Html", readOnlyHint: false } }, async ({ text }) => { const encoded = text .replace(/&/g, '&amp;') .replace(/</g, '&lt;') .replace(/>/g, '&gt;') .replace(/"/g, '&quot;') .replace(/'/g, '&#39;'); return { content: [ { type: "text", text: `HTML encoded: ${encoded}`, }, ], }; }); }