Skip to main content
Glama

@hun-dun/markdown-to-html-mcp

项目简介

本项目基于 modelcontextprotocol/typescript-sdk 实现 Markdown 转 HTML 的 MCP 服务端,支持 npx/全局命令一键启动、远程 HTTP/Streamable HTTP 调用,并可被 Cursor 等 MCP 客户端直接调用。

Related MCP server: Markdown MCP Server

特性

  • 支持 ESM/CJS 双产物,适配多种 Node.js 环境

  • 一键 npx/全局命令启动(stdio)

  • 支持 HTTP/Streamable HTTP 服务

  • 结构现代,类型安全,源码位于 src/,产物位于 dist/(ESM)和 dist-cjs/(CJS)

  • bin/主入口均指向 CJS 产物,兼容性强

  • 可被 Cursor、curl、代码等多种方式远程调用

快速开始

安装依赖

npm install

构建产物

npm run build

本地启动(stdio)

npx ts-node src/cli.ts
# 或
npm run start

启动 HTTP 服务

npx ts-node src/cli.ts --http
# 或
node dist-cjs/cli.js --http

作为全局命令/被 Cursor 调用

npx @hun-dun/markdown-to-html-mcp
# 或
markdown-to-html-mcp

远程 HTTP/Streamable HTTP 调用

curl -X POST http://localhost:3000/mcp -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' -d '{"tool":"markdownToHtml","input":{"markdown":"# Hello"}}'

ESM/CJS 产物说明

  • ESM 产物位于 dist/,入口 dist/index.js

  • CJS 产物位于 dist-cjs/,入口 dist-cjs/index.js

  • bin/主入口均指向 CJS 产物,兼容 npx/全局命令

MCP 工具注册与调用

  • registerMarkdownToHtmlTool(server) 注册 markdownToHtml 工具,参数为 markdown,返回 HTML。

  • CLI 支持 stdio 和 HTTP 两种模式。

在 Cursor 中调用

本工具可直接集成到 Cursor,支持本地(stdio)和远程(http)两种方式:

方式一:本地调用(stdio,推荐本地开发/临时调用)

.cursor/config.json 中添加如下配置:

{
  "mcp": [
    {
      "name": "@hun-dun/markdown-to-html-mcp (本地 npx)",
      "type": "stdio",
      "command": "npx",
      "args": ["@hun-dun/markdown-to-html-mcp"]
    }
  ]
}
  • Cursor 会自动用 npx 下载并调用你的包,适合本地/临时场景。

  • 不需要你手动启动服务端。

  • 结果会直接在 Cursor 工具面板中展示。

方式二:远程调用(http,推荐云端/团队共享)

  1. 启动 HTTP 服务:

    npx @hun-dun/markdown-to-html-mcp --http
    # 或 PORT=8080 npx @hun-dun/markdown-to-html-mcp --http
  2. .cursor/config.json 中添加如下配置:

{
  "mcp": [
    {
      "name": "@hun-dun/markdown-to-html-mcp (remote)",
      "type": "http",
      "url": "http://localhost:3000/mcp"
    }
  ]
}
  • 适合你用 npx @hun-dun/markdown-to-html-mcp --http 启动服务后,供多台机器/团队成员/云端调用。

  • 结果会直接在 Cursor 工具面板中展示。

常见问题

  • ts-node 运行 .ts 文件报 "Unknown file extension .ts"——需加 --loader ts-node/esm

  • node 运行 dist/index.js 报 "exports is not defined in ES module scope"——需用 CommonJS 产物并移除 package.json 的 "type": "module",或用 .cjs 后缀

  • StreamableHTTPServerTransport 构造参数报错,需根据 SDK 版本传递正确 options

适用场景

  • 本地开发、测试

  • 远程 HTTP/Streamable HTTP 服务

  • Cursor、MCP 客户端一键集成

  • 代码/脚本/命令行调用

License

MIT

Available Tools

1 tool
markdownToHtmlD
ParametersJSON Schema
NameRequiredDescriptionDefault
markdownYes要转换为HTML的Markdown文本

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 1 tool updatev1.0.0
    • First observedmarkdownToHtml

TDQS

D1.8/5.0
Disambiguation5/5

With only one tool, there is no possibility of confusion or overlap between tools, as no other tools exist to cause ambiguity. The single tool's purpose is inherently distinct by default.

Naming Consistency5/5

The single tool name 'markdownToHtml' follows a clear and consistent pattern (camelCase), and with only one tool, there is no inconsistency to evaluate. The naming is straightforward and descriptive for its function.

Tool Count2/5

A single tool is too few for a server named 'Markdown to HTML MCP Server', as it suggests a limited scope that might not cover related operations like validation, configuration, or handling different markdown flavors. This minimal set could lead to incomplete functionality for typical use cases.

Completeness2/5

The server's domain is markdown-to-HTML conversion, but with only one tool, there are significant gaps. Missing operations might include HTML sanitization, error handling, batch processing, or supporting various markdown extensions, making the surface severely incomplete for robust usage.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/1623311678/markdown-to-html-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server