UNPKG

it-tools-mcp

Version:

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

31 lines (30 loc) 881 B
import { z } from "zod"; export function registerEncodeHtml(server) { server.registerTool("encode_html", { description: "Encode HTML entities", inputSchema: { text: z.string().describe("Text to HTML encode"), }, // VS Code compliance annotations annotations: { title: "Encode Html", description: "Encode HTML entities", 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}`, }, ], }; }); }