loading…
Search for a command to run...
loading…
Enables AI tools to extract Feishu documents (Docx/Wiki) via Feishu Open API and convert them to Markdown format with local image downloading and authentication
Enables AI tools to extract Feishu documents (Docx/Wiki) via Feishu Open API and convert them to Markdown format with local image downloading and authentication.
这是一个基于 Python 和 PyQt6 编写的桌面端应用程序,旨在帮助用户快速将飞书文档(Docx / Wiki)提取并转换为 Markdown 格式存储在本地。
.md 格式文件。assets_<doc_token>/ 目录,Markdown 中生成相对路径引用。本工具通过飞书开放平台的自建应用访问文档,首次使用需完成以下配置。
cli_xxxxxxxxxxxxxxxx)进入应用详情页 → 权限管理 → 搜索并开通以下权限:
| 权限标识 | 权限名称 | 用途说明 |
|---|---|---|
wiki:wiki:readonly |
获取知识空间信息 | 访问 /wiki/ 类型的知识库文档 |
docx:document:readonly |
查看新版文档 | 读取飞书 Docx 格式文档的 Block 内容 |
docs:document.media:download |
下载云文档中的图片和附件 | 将文档内图片下载到本地 |
docs:document.content:read |
查看云文档内容 | 获取云文档访问范围内的文档内容 |
docx:document:readonly |
查看新版文档 | 获取新版文档内容 |
注意:权限开通后,进入版本管理与发布页签,创建并发布一个版本,权限才会正式生效。
飞书文档默认仅对有权限的人员可见,需要将目标文档(或知识库)共享给应用机器人:
如果是知识库(Wiki)文档,需在知识库的成员管理中添加应用机器人并赋予查看权限。
pip install -r requirements.txt
python main.py
支持作为 MCP 服务器运行,方便在 Claude、Cursor 等 AI 工具中直接调用。
export FEISHU_APP_ID="cli_xxxxxxxxxxxxx"
export FEISHU_APP_SECRET="xxxxxxxxxxxxxxxx"
python mcp_server.py
在 ~/.claude.json 或项目 MCP 配置中添加:
{
"mcpServers": {
"feishu-reader": {
"command": "python",
"args": ["mcp_server.py"],
"env": {
"FEISHU_APP_ID": "cli_xxxxxxxxxxxxx",
"FEISHU_APP_SECRET": "xxxxxxxxxxxxxxxx"
},
"workingDirectory": "/path/to/feishu-reader-mcp"
}
}
}
/docx/、/doc/、/wiki/ 类型链接)。.md 文件和 assets_xxx/ 图片目录。| 文件 | 说明 |
|---|---|
main.py |
主程序入口,包含 PyQt6 界面定义与异步工作线程逻辑 |
fetcher.py |
飞书 OpenAPI 交互层,负责拉取 Block 树、下载图片 |
parser.py |
Markdown 转换引擎,将飞书各类 Block 映射为 Markdown 语法 |
mcp_server.py |
MCP 服务器模式入口 |
requirements.txt |
Python 依赖列表 |
/docx/v1/documents OpenAPI),旧版文档可能存在格式偏差。docs:document.media:download 权限且文档已正确分享给应用机器人,否则图片将跳过下载并在日志中提示失败原因。Add this to claude_desktop_config.json and restart Claude Desktop.
{
"mcpServers": {
"feishu-reader": {
"command": "npx",
"args": []
}
}
}