mcp-dingtalk-doc
v1.0.6
Published
钉钉文档 MCP 服务器 | DingTalk Document MCP Server - 钉钉文档解析,支持自动登录和Cookie管理
Maintainers
Readme
钉钉文档 MCP | mcp-dingtalk-doc
钉钉文档 MCP 服务器 | DingTalk Document MCP Server
钉钉文档解析 · 自动登录 · Cookie管理
🚀 钉钉文档 MCP 工具 - 让 AI 助手(Cursor/Claude)直接读取钉钉文档内容
🚀 DingTalk MCP Server - Enable AI assistants to read DingTalk documents directly
✨ Features | 特性
- 🚀 Fast | 快速 - Startup ~100ms
- 📦 Simple | 简单 - One-click npm installation | npm 一键安装
- 🔐 Auto Login | 自动登录 - Browser-based cookie management | 浏览器自动获取 Cookie
- 🎯 Type Safe | 类型安全 - Native TypeScript
📦 Installation | 安装
npm install mcp-dingtalk-docOr clone and build | 或克隆构建:
git clone https://github.com/hykfft/mcp-dingtalk-doc.git
cd mcp-dingtalk-doc/nodejs
npm install
npm run build⚡ Quick Start | 快速开始
Method 1: Auto Cookie Management (Recommended) | 方式 1:自动 Cookie 管理(推荐)
# Auto login - Browser will open for QR code scan
# 自动登录 - 浏览器会自动打开,扫码登录即可
npm run cookie:login
# Verify cookie | 验证 Cookie
npm run cookie:checkMethod 2: Manual Cookie | 方式 2:手动配置 Cookie
- Open https://alidocs.dingtalk.com and login | 打开钉钉文档并登录
- Press F12 → Network tab | 按 F12 打开开发者工具
- Copy Cookie from Request Headers | 复制请求头中的 Cookie
- Set environment variable | 设置环境变量:
# Windows
set DINGTALK_COOKIE=your_cookie_here
# Linux/Mac
export DINGTALK_COOKIE="your_cookie_here"🔧 MCP Configuration | MCP 配置
Edit Cursor config file | 编辑 Cursor 配置文件:
Windows: %APPDATA%\Cursor\mcp.json
Mac: ~/Library/Application Support/Cursor/mcp.json
Linux: ~/.cursor/mcp.json
{
"mcpServers": {
"dingtalk-doc": {
"command": "node",
"args": [
"/path/to/mcp-dingtalk-doc/nodejs/dist/index.js"
],
"env": {
"DINGTALK_COOKIE": "your_cookie_here"
}
}
}
}🎯 Usage | 使用方法
In Cursor, tell the AI | 在 Cursor 中对 AI 说:
Please parse this DingTalk document:
请帮我解析这个钉钉文档:
https://alidocs.dingtalk.com/i/nodes/xxx🛠️ Available Tools | 可用工具
1. parse_document
Parse document and generate HTML files | 解析文档并生成 HTML 文件
Parameters | 参数:
url_or_node_id(required | 必需): DingTalk document URL or NODE_ID | 钉钉文档 URL 或 NODE_IDcookie(optional | 可选): Cookie string | Cookie 字符串save_files(optional | 可选): Save files, default true | 是否保存文件output_dir(optional | 可选): Output directory | 输出目录
2. get_html
Get HTML content without saving files | 快速获取 HTML 内容(不保存文件)
Parameters | 参数:
url_or_node_id(required | 必需): DingTalk document URL or NODE_IDcookie(optional | 可选): Cookie string
🍪 Cookie Commands | Cookie 管理命令
npm run cookie:login # Auto login | 自动登录
npm run cookie:check # Check validity | 检查有效性
npm run cookie:show # Show cookie | 显示 Cookie
npm run cookie:auto # Auto get valid cookie | 自动获取有效 Cookie
npm run cookie:delete # Delete cookie | 删除 Cookie📖 Supported Elements | 支持的元素
- ✅ Paragraphs and rich text | 段落和富文本
- ✅ Tables (cell merging) | 表格(支持合并单元格)
- ✅ Images | 图片
- ✅ Code blocks (11 languages) | 代码块(11种语言)
- ✅ Text styles (bold, color, font size) | 文本样式
⚠️ Known Limitations | 已知限制
- OSS encrypted documents not fully supported | OSS 加密文档暂不完全支持
- Some elements pending support (lists, quotes) | 部分元素待支持(列表、引用块)
- Cookie expires in 7-30 days | Cookie 7-30 天后过期
🔧 Troubleshooting | 故障排查
Module not found | 找不到模块
npm run build
npm installCookie expired | Cookie 过期
npm run cookie:login📦 Dependencies | 依赖
@modelcontextprotocol/sdk- Official MCP SDKaxios- HTTP clientcheerio- HTML parsingplaywright- Auto cookie managementzod- Data validation
📄 License | 许可证
MIT License
🔗 Links | 链接
- npm: https://www.npmjs.com/package/mcp-dingtalk-doc
- GitHub: https://github.com/hykfft/mcp-dingtalk-doc
Quick Start | 快速开始: npm install → npm run cookie:login → Configure MCP | 配置 MCP → Use | 使用!🚀
