UNPKG

it-tools-mcp

Version:

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

42 lines (41 loc) 1.29 kB
import { z } from "zod"; export function registerConvertMarkdownHtml(server) { server.registerTool("convert_markdown_to_html", { description: "Convert Markdown to HTML", inputSchema: { markdown: z.string().describe("Markdown content to convert to HTML"), }, // VS Code compliance annotations annotations: { title: "Convert Markdown To Html", description: "Convert Markdown to HTML", readOnlyHint: false } }, async ({ markdown }) => { try { const { marked } = await import("marked"); const html = marked(markdown, { breaks: true, gfm: true }); return { content: [ { type: "text", text: `HTML result:\n${html}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error converting Markdown to HTML: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], }; } }); }