Format Conversion
在 GitHub 风格 Markdown 与 AsciiDoc(Antora / Red Hat / Asciidoctor 文档系统的标准格式)之间互转:标题层级自动偏移(AD 的 = 是文档级标题)、链接方括号顺序自动翻转、围栏代码块 ⇄ [source] 块、GFM 管道表 ⇄ |=== 表、NOTE/TIP/WARNING 警示块、任务列表、脚注、交叉引用锚点、硬换行等全部覆盖,无法完美映射的构造会列出提示。
用三种语言从你的代码中调用此工具。
curl -X POST 'http://127.0.0.1:3003/zh/api/tools/markdown-asciidoc-converter' \
-H 'Content-Type: application/json' \
-d '{"direction":"md2ad","content":"# Release Notes\n\nVersion **2.4.0** — the _speed_ update.\n\n## Highlights\n\n- New `fast-run` command (3x faster)\n- Fixed the [login bug](https://example.com/issue/42)\n- Task list:\n - [x] ship the fix\n - [ ] update docs\n\n> **Note**\n> Restart the daemon after upgrading.\n\n| Module | Status |\n|:-------|:------:|\n| core | ✅ |\n| ui | ❌ |\n\n```python\nprint(\"hello\")\n```\n","promoteTitle":true,"keepUnresolved":true}'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST http://127.0.0.1:3003/zh/api/tools/markdown-asciidoc-converter| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| direction | select | 否 | — |
| content | textarea | 是 | — |
| promoteTitle | checkbox | 否 | — |
| keepUnresolved | checkbox | 否 | — |
HTML 结果
{
"result": "<div>Processed HTML content</div>",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}将此工具加入你的 Model Context Protocol 服务,让 AI 智能体可以列出并调用它。
将以下内容加入你的 MCP 客户端配置:
{
"mcpServers": {
"elysiatools-markdown-asciidoc-converter": {
"name": "markdown-asciidoc-converter",
"description": "在 GitHub 风格 Markdown 与 AsciiDoc(Antora / Red Hat / Asciidoctor 文档系统的标准格式)之间互转:标题层级自动偏移(AD 的 = 是文档级标题)、链接方括号顺序自动翻转、围栏代码块 ⇄ [source] 块、GFM 管道表 ⇄ |=== 表、NOTE/TIP/WARNING 警示块、任务列表、脚注、交叉引用锚点、硬换行等全部覆盖,无法完美映射的构造会列出提示。",
"baseUrl": "http://127.0.0.1:3003/mcp/sse?toolId=markdown-asciidoc-converter",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}连接到 SSE 端点后,列出已开放的工具:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}通过工具 id 调用,参数由其参数表构建:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "markdown-asciidoc-converter",
"arguments": {
"direction": "md2ad",
"content": "# Release Notes\n\nVersion **2.4.0** — the _speed_ update.\n\n## Highlights\n\n- New `fast-run` command (3x faster)\n- Fixed the [login bug](https://example.com/issue/42)\n- Task list:\n - [x] ship the fix\n - [ ] update docs\n\n> **Note**\n> Restart the daemon after upgrading.\n\n| Module | Status |\n|:-------|:------:|\n| core | ✅ |\n| ui | ❌ |\n\n```python\nprint(\"hello\")\n```\n",
"promoteTitle": true,
"keepUnresolved": true
}
}
}有问题或反馈?请联系 [email protected]