anydoc-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@anydoc-mcp convert 2024_Q1_report.docx to Markdown"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
anydoc-mcp
把 Firecrawl anydoc 封装成 MCP (Model Context Protocol) Server,让任何支持 MCP 的 AI 平台/Agent 都能调用文档转 Markdown 能力。
纯本地运行、无 ML 模型、无需 API key、不联网,中位转换耗时 < 5ms。
功能
提供 MCP 工具
convert_document_to_markdown输入:文件名 + 文件内容(base64)
输出:干净的 GitHub-Flavored Markdown
自动从文件内容识别格式(CSV 等无签名格式按扩展名识别)
结构化错误返回(
needsOcr/unsupported/encrypted/malformed等)
Related MCP server: md-converter-mcp
支持的格式
类别 | 扩展名 |
Word |
|
PowerPoint |
|
Excel |
|
OpenDocument |
|
其他 |
|
限制
单向:只做 文档 → Markdown,没有 Markdown → DOCX
扫描型/图片型 PDF 不支持(anydoc 无 OCR,会返回
needsOcr错误)不渲染内嵌图片:只抽取文字,文档中的截图/图表不会进入 Markdown
每次调用只处理一个文档
本地开发
前置条件
Node.js >= 18
npm(或 pnpm / yarn)
安装依赖
npm install运行冒烟测试
npm test验证 anydoc 核心转换能力(CSV → Markdown、错误处理)。
手动启动 MCP Server(STDIO)
npm startServer 通过 stdin/stdout 与 MCP 客户端通信。日志输出到 stderr。
手动测试 MCP 协议
可以用 MCP Inspector 进行图形化测试:
npx @modelcontextprotocol/inspector node src/server.js发布到 npm
包名使用 scope
@fclwtt/anydoc-mcp,确保全局唯一。如需更换 scope,修改package.json中的name。
# 1. 登录 npm
npm login
# 2. 发布(scope 包首次发布必须加 --access public)
npm publish --access public
# 后续更新版本号后重新发布
npm version patch # 或 minor / major
npm publish发布成功后,任何支持 MCP STDIO 的平台都可以通过 npx @fclwtt/anydoc-mcp 一键启动。
接入云平台(以 aikf.wtc.edu.cn 为例)
在平台的「接入 MCP 插件」页面填写:
配置项 | 值 |
插件名称 | anydoc(或自定义) |
插件描述 | 文档转 Markdown:支持 docx/pptx/xlsx/pdf/odt/rtf/epub/csv,纯本地离线运行 |
传输方式 | STDIO |
命令 |
|
参数 |
|
环境变量 | 无需配置(纯本地运行,不需要 API key) |
-y参数让 npx 自动确认安装,避免交互式提示阻塞平台启动。
平台调用示例
平台的大模型会自动发现并调用 convert_document_to_markdown 工具,传入:
{
"filename": "报告.docx",
"content_base64": "UEsDBBQAAAAIA..."
}返回 Markdown 文本。
项目结构
anydoc-mcp/
├── src/
│ └── server.js # MCP Server 主文件
├── test/
│ ├── smoke.mjs # 冒烟测试
│ └── mcp_protocol_test.mjs # MCP 协议级测试
├── .github/
│ └── workflows/
│ └── publish.yml # GitHub Actions 自动发布
├── package.json
├── README.md
├── PUBLISH.md # 发布指南
└── .gitignore技术栈
@modelcontextprotocol/sdk — MCP 官方 Node.js SDK
@firecrawl/anydoc — Firecrawl 开源文档转 Markdown 库(Rust + Node 绑定)
License
MIT
Available Tools
1 toolconvert_document_to_markdownA
用 anydoc 将文档转换为干净的 GitHub-Flavored Markdown。支持 doc/docx/ppt/pptx/xls/xlsx/pdf(文本型)/odt/ods/odp/rtf/epub/csv。纯本地运行,无需 API key,不联网。注意:扫描型/图片型 PDF 不支持(anydoc 无 OCR);不渲染文档内嵌图片。
Inputs: filename (required), content_base64 (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no possibility of confusion or overlapping purpose. An agent can immediately identify the single action available.
The sole tool follows a clear verb_noun snake_case convention (convert_document_to_markdown). No inconsistency can arise with one tool.
A single tool is thin for an MCP server, even if it consolidates many document formats. Core conversion is covered, but the surface is borderline minimal.
The tool covers a wide range of input formats and a clear output (GFM), but lacks batch conversion, output-path configuration, and OCR support (acknowledged limitation). These are minor gaps for a conversion utility.
Maintenance
Related MCP Connectors
Document-to-Markdown MCP server — convert PDF, Office and HTML into LLM-ready Markdown.
Convert PDF, DOCX, XLSX and 25 other formats to clean Markdown for LLMs and RAG. No key or account.
Convert Word, Excel, PowerPoint, OpenDocument, EPUB and RTF files to Markdown for LLMs and RAG
Document to Markdown: convert Word, Excel, PowerPoint and PDF files to Markdown for an LLM.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceConverts documents (PDF, DOCX, images, etc.) to Markdown using Microsoft's Markitdown library, with no local setup required. Integrates with AI agents via MCP for seamless document conversion.1-
- AlicenseAqualityDmaintenanceConverts files (PDF, DOCX, PPTX, XLSX, images via OCR) and URLs to Markdown, enabling AI clients to read them via a single MCP tool.1GPL 3.0
- AlicenseNot gradedqualityBmaintenanceConverts documents (PDF, DOCX, XLSX, EPUB, etc.) to clean, structured Markdown, and retrieves document info, for use with AI agents.MIT
- AlicenseNot gradedqualityCmaintenanceEnables LLM-friendly Markdown conversion from 24+ document formats (Office, PDF, email, images, archives, code) via MCP, with OCR, content sniffing, and safe handling of hostile inputs.MIT