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