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
JavaScript
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, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"')
.replace(/'/g, ''');
return {
content: [
{
type: "text",
text: `HTML encoded: ${encoded}`,
},
],
};
});
}