feishu-mcp 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,261 +1,266 @@
1
- # 飞书 MCP 服务器
2
-
3
-
4
- [![npm version](https://img.shields.io/npm/v/feishu-mcp?color=blue&label=npm)](https://www.npmjs.com/package/feishu-mcp)
5
- [![smithery badge](https://smithery.ai/badge/@cso1z/feishu-mcp)](https://smithery.ai/server/@cso1z/feishu-mcp)
6
- [![wechat](https://img.shields.io/badge/交流群-wechat-brightgreen?logo=wechat)](#group-qr)
7
- [![MIT License](https://img.shields.io/badge/license-MIT-green)](./LICENSE)
8
-
9
- 为 [Cursor](https://cursor.sh/)、[Windsurf](https://codeium.com/windsurf)、[Cline](https://cline.bot/) 和其他 AI 驱动的编码工具提供访问飞书文档的能力,基于 [Model Context Protocol](https://modelcontextprotocol.io/introduction) 服务器实现。
10
-
11
- 本项目让 AI 编码工具能够直接获取和理解飞书文档的结构化内容,显著提升文档处理的智能化和效率。
12
-
13
- **完整覆盖飞书文档的真实使用流程,助你高效利用文档资源:**
14
- 1. **文件夹目录获取**:快速获取和浏览飞书文档文件夹下的所有文档,便于整体管理和查找。
15
- 2. **内容获取与理解**:支持结构化、分块、富文本等多维度内容读取,AI 能精准理解文档上下文。
16
- 3. **智能创建与编辑**:可自动创建新文档、批量生成和编辑内容,满足多样化写作需求。
17
- 4. **高效检索与搜索**:内置关键字搜索,帮助你在大量文档中迅速找到目标信息。
18
-
19
- 本项目让你在飞书文档的日常使用流程中实现智能获取、编辑和搜索,提升内容处理效率和体验。
20
-
21
- > ⭐ **Star 本项目,第一时间获取最新功能和重要更新!** 关注项目可以让你不错过任何新特性、修复和优化,助你持续高效使用。你的支持也将帮助我们更好地完善和发展项目。⭐
22
-
23
- ---
24
-
25
- ## 🛠️ 工具功能详情
26
-
27
- | 功能类别 | 工具名称 | 描述 | 使用场景 | 状态 |
28
- |---------|--------------------------------------------------------------|-------------|---------------|------|
29
- | **文档管理** | `create_feishu_document` | 创建新的飞书文档 | 从零开始创建文档 | ✅ 已完成 |
30
- | | `get_feishu_document_info` | 获取文档基本信息 | 验证文档存在性和权限 | ✅ 已完成 |
31
- | | `get_feishu_document_content` | 获取文档纯文本内容 | 内容分析和处理 | ✅ 已完成 |
32
- | | `get_feishu_document_blocks` | 获取文档块结构 | 了解文档层级结构 | ✅ 已完成 |
33
- | | `get_feishu_block_content` | 获取特定块内容 | 检查块属性和格式 | ✅ 已完成 |
34
- | **内容编辑** | `batch_create_feishu_blocks` | 批量创建多个块 | 高效创建连续内容 | ✅ 已完成 |
35
- | | `update_feishu_block_text` | 更新块文本内容 | 修改现有内容 | ✅ 已完成 |
36
- | | `create_feishu_text_block` | 创建单个文本块 | 精确样式控制的文本创建 | ✅ 已完成 |
37
- | | `create_feishu_code_block` | 创建代码块 | 技术文档和代码示例 | ✅ 已完成 |
38
- | | `create_feishu_heading_block` | 创建标题块 | 章节标题和层级结构 | ✅ 已完成 |
39
- | | `create_feishu_list_block` | 创建列表块 | 有序和无序列表创建 | ✅ 已完成 |
40
- | | `delete_feishu_document_blocks` | 删除文档块 | 清理和重构文档内容 | ✅ 已完成 |
41
- | **文件夹管理** | `get_feishu_root_folder_info` | 获取根文件夹信息 | 获取基础文件夹信息 | ✅ 已完成 |
42
- | | `get_feishu_folder_files` | 获取文件夹文件列表 | 浏览文件夹内容 | ✅ 已完成 |
43
- | | `create_feishu_folder` | 创建新文件夹 | 组织文档结构 | ✅ 已完成 |
44
- | **搜索功能** | `search_feishu_documents` | 搜索文档 | 查找特定内容 | ✅ 已完成 |
45
- | **工具功能** | `convert_feishu_wiki_to_document_id` | Wiki链接转换 | 将Wiki链接转为文档ID | ✅ 已完成 |
46
- | | `get_feishu_image_resource` | 获取图片资源 | 下载文档中的图片 | ✅ 已完成 |
47
- | **高级功能** | 表格操作 | 创建和编辑表格 | 结构化数据展示 | 🚧 计划中 |
48
- | | 图表插入 | 支持各类数据可视化图表 | 数据展示和分析 | 🚧 计划中 |
49
- | | 流程图 | 支持流程图和思维导图 | 流程梳理和可视化 | 🚧 计划中 |
50
- | 图片插入 | `create_feishu_image_block`、`upload_and_bind_image_to_block` | 支持插入本地和远程图片 | 修改文档内容 | 已完成 |
51
- | | 公式支持 | 支持数学公式和科学符号 | 学术和技术文档 | 🚧 计划中 |
52
-
53
- ### 🎨 支持的样式功能
54
-
55
- - **文本样式**:粗体、斜体、下划线、删除线、行内代码
56
- - **文本颜色**:灰色、棕色、橙色、黄色、绿色、蓝色、紫色
57
- - **对齐方式**:左对齐、居中、右对齐
58
- - **标题级别**:支持1-9级标题
59
- - **代码块**:支持多种编程语言语法高亮
60
- - **列表**:有序列表(编号)、无序列表(项目符号)
61
- - **图片**:支持本地图片和网络图片
62
-
63
- ---
64
-
65
- ## 🔧 飞书配置教程
66
-
67
- **⚠️ 重要提示:在开始使用之前,必须先完成飞书应用配置,否则无法正常使用本工具。**
68
-
69
- 关于如何创建飞书应用和获取应用凭证的说明可以在[官方教程](https://open.feishu.cn/document/home/develop-a-bot-in-5-minutes/create-an-app)找到。
70
-
71
- **详细的飞书应用配置步骤**:有关注册飞书应用、配置权限、添加文档访问权限的详细指南,请参阅 [手把手教程 FEISHU_CONFIG.md](FEISHU_CONFIG.md)
72
-
73
- ---
74
-
75
- ## 🏃‍♂️ 快速开始
76
-
77
- ### 方式一:使用 NPM 快速运行
78
-
79
- ```bash
80
- npx feishu-mcp@latest --feishu-app-id=<你的飞书应用ID> --feishu-app-secret=<你的飞书应用密钥>
81
- ```
82
-
83
- ### 方式二:使用 Smithery 平台
84
-
85
- **已发布到 Smithery 平台,可访问:** https://smithery.ai/server/@cso1z/feishu-mcp
86
-
87
- ### 方式三:本地运行
88
-
89
-
90
- #### 🌿 分支说明
91
-
92
- 本项目采用主分支(main)+功能分支(feature/xxx)协作模式:
93
-
94
- - **main**
95
- 稳定主线分支,始终保持可用、可部署状态。所有已验证和正式发布的功能都会合并到 main 分支。
96
-
97
- - **multi-user-token**
98
-
99
- 多用户隔离与按用户授权的 Feishu Token 获取功能开发分支。该分支支持 userKey 参数、按用户获取和缓存 Token、自定义 Token 服务等高级特性,适用于需要多用户隔离和授权场景的开发与测试。
100
- > ⚠️ 该分支为 beta 版本,功能更新相较 main 分支可能会有延后。如有相关需求请在 issue 区留言,我会优先同步最新功能到该分支。
101
-
102
-
103
- 1. **克隆仓库**
104
- ```bash
105
- git clone https://github.com/cso1z/Feishu-MCP.git
106
- cd Feishu-MCP
107
- ```
108
-
109
- 2. **安装依赖**
110
- ```bash
111
- pnpm install
112
- ```
113
-
114
- 3. **配置环境变量**
115
-
116
- **macOS/Linux:**
117
- ```bash
118
- cp .env.example .env
119
- ```
120
-
121
- **Windows:**
122
- ```cmd
123
- copy .env.example .env
124
- ```
125
-
126
- 4. **编辑 .env 文件**
127
-
128
- 你可以通过以下任一方式编辑 .env 文件:
129
-
130
- **方式一:使用文件管理器**
131
- - 在项目文件夹中找到 `.env` 文件
132
- - 双击打开(系统会自动选择文本编辑器)
133
- - 或右键选择"打开方式" 选择文本编辑器
134
-
135
- **方式二:使用 VS Code**
136
- ```bash
137
- code .env
138
- ```
139
-
140
- **方式三:使用命令行编辑器**
141
- ```bash
142
- # macOS/Linux
143
- nano .env
144
-
145
- # Windows
146
- notepad .env
147
- ```
148
-
149
- 填入你的飞书应用凭证:
150
- ```env
151
- FEISHU_APP_ID=cli_xxxxx
152
- FEISHU_APP_SECRET=xxxxx
153
- PORT=3333
154
- ```
155
-
156
- 5. **运行服务器**
157
- ```bash
158
- pnpm run dev
159
- ```
160
-
161
- ## ⚙️ 项目配置
162
-
163
- ### 环境变量配置
164
-
165
- | 变量名 | 必需 | 描述 | 默认值 |
166
- |--------|------|------|-------|
167
- | `FEISHU_APP_ID` | | 飞书应用 ID | - |
168
- | `FEISHU_APP_SECRET` | ✅ | 飞书应用密钥 | - |
169
- | `PORT` | | 服务器端口 | `3333` |
170
-
171
- ### 命令行参数
172
-
173
- | 参数 | 描述 | 默认值 |
174
- |------|------|-------|
175
- | `--port` | 服务器监听端口 | `3333` |
176
- | `--log-level` | 日志级别 (debug/info/log/warn/error/none) | `info` |
177
- | `--feishu-app-id` | 飞书应用 ID | - |
178
- | `--feishu-app-secret` | 飞书应用密钥 | - |
179
- | `--feishu-base-url` | 飞书API基础URL | `https://open.feishu.cn/open-apis` |
180
- | `--cache-enabled` | 是否启用缓存 | `true` |
181
- | `--cache-ttl` | 缓存生存时间(秒) | `3600` |
182
- | `--stdio` | 命令模式运行 | - |
183
- | `--help` | 显示帮助菜单 | - |
184
- | `--version` | 显示版本号 | - |
185
-
186
- ### 配置文件方式(适用于 Cursor、Cline 等)
187
-
188
- ```json
189
- {
190
- "mcpServers": {
191
- "feishu-mcp": {
192
- "command": "npx",
193
- "args": ["-y", "feishu-mcp", "--stdio"],
194
- "env": {
195
- "FEISHU_APP_ID": "<你的飞书应用ID>",
196
- "FEISHU_APP_SECRET": "<你的飞书应用密钥>"
197
- }
198
- }
199
- },
200
- "feishu_local": {
201
- "url": "http://localhost:3333/sse"
202
- }
203
- }
204
- ```
205
- ---
206
-
207
- ## 📝 使用贴士(重要)
208
-
209
- 1. ### **推荐指定文件夹**:
210
- 新建文档时,建议主动提供飞书文件夹 token(可为具体文件夹或根文件夹),这样可以更高效地定位和管理文档。如果不确定具体的子文件夹,可以让LLM自动在你指定的文件夹下查找最合适的子目录来新建文档。
211
-
212
- > **如何获取文件夹 token?**
213
- > 打开飞书文件夹页面,复制链接(如 `https://.../drive/folder/xxxxxxxxxxxxxxxxxxxxxx`),token 就是链接最后的那一串字符(如 `xxxxxxxxxxxxxxxxxxxxxx`,请勿泄露真实 token)。
214
-
215
- 2. ### **图片上传路径说明**:
216
- 本地运行 MCP 时,图片路径既支持本地绝对路径,也支持 http/https 网络图片;如在服务器环境,仅支持网络图片链接(由于cursor调用mcp时参数长度限制,暂不支持直接上传图片文件本体,请使用图片路径或链接方式上传)。
217
-
218
- ---
219
-
220
- ## 🚨 故障排查
221
-
222
- ### 权限问题排查
223
- 先对照配置问题查看: [手把手教程 FEISHU_CONFIG.md](FEISHU_CONFIG.md)。
224
-
225
- #### 问题确认
226
- 1. **检查应用权限**:确保应用已获得必要的文档访问权限
227
- 2. **验证文档授权**:确认目标文档已授权给应用或应用所在的群组
228
- 3. **检查可用范围**:确保应用发布版本的可用范围包含文档所有者
229
-
230
- #### 权限验证与排查
231
- 1. 获取token:[自建应用获取 app_access_token](https://open.feishu.cn/api-explorer?apiName=app_access_token_internal&project=auth&resource=auth&version=v3)
232
- 2. 使用第1步获取的token,验证是否有权限访问该文档:[获取文档基本信息](https://open.feishu.cn/api-explorer?apiName=get&project=docx&resource=document&version=v1)
233
-
234
-
235
- ### 常见问题
236
-
237
- - **找不到应用**:检查应用是否已发布且可用范围配置正确
238
- - **权限不足**:参考[云文档常见问题](https://open.feishu.cn/document/ukTMukTMukTM/uczNzUjL3czM14yN3MTN)
239
- - **知识库访问问题**:参考[知识库常见问题](https://open.feishu.cn/document/server-docs/docs/wiki-v2/wiki-qa)
240
-
241
- ---
242
-
243
- ## 💖 支持项目
244
-
245
- 如果这个项目帮助到了你,请考虑:
246
-
247
- - ⭐ 给项目一个 Star
248
- - 🐛 报告 Bug 和问题
249
- - 💡 提出新功能建议
250
- - 📖 改进文档
251
- - 🔀 提交 Pull Request
252
-
253
- 你的支持是我们前进的动力!
254
-
255
- **<span id="group-qr">欢迎加入我们的交流群,与更多小伙伴一起交流:</span>**
256
-
257
- <img src="./image/group_qr.jpg" alt="飞书MCP交流群二维码" width="300" />
258
-
259
- ## 🤝 贡献
260
-
261
- 欢迎提交 Issue 和 Pull Request!如果你在使用过程中遇到问题或有改进建议,也欢迎随时告诉我们。
1
+ # 飞书 MCP 服务器
2
+
3
+
4
+ [![npm version](https://img.shields.io/npm/v/feishu-mcp?color=blue&label=npm)](https://www.npmjs.com/package/feishu-mcp)
5
+ [![smithery badge](https://smithery.ai/badge/@cso1z/feishu-mcp)](https://smithery.ai/server/@cso1z/feishu-mcp)
6
+ [![wechat](https://img.shields.io/badge/交流群-wechat-brightgreen?logo=wechat)](#group-qr)
7
+ [![MIT License](https://img.shields.io/badge/license-MIT-green)](./LICENSE)
8
+
9
+ 为 [Cursor](https://cursor.sh/)、[Windsurf](https://codeium.com/windsurf)、[Cline](https://cline.bot/) 和其他 AI 驱动的编码工具提供访问飞书文档的能力,基于 [Model Context Protocol](https://modelcontextprotocol.io/introduction) 服务器实现。
10
+
11
+ 本项目让 AI 编码工具能够直接获取和理解飞书文档的结构化内容,显著提升文档处理的智能化和效率。
12
+
13
+ **完整覆盖飞书文档的真实使用流程,助你高效利用文档资源:**
14
+ 1. **文件夹目录获取**:快速获取和浏览飞书文档文件夹下的所有文档,便于整体管理和查找。
15
+ 2. **内容获取与理解**:支持结构化、分块、富文本等多维度内容读取,AI 能精准理解文档上下文。
16
+ 3. **智能创建与编辑**:可自动创建新文档、批量生成和编辑内容,满足多样化写作需求。
17
+ 4. **高效检索与搜索**:内置关键字搜索,帮助你在大量文档中迅速找到目标信息。
18
+
19
+ 本项目让你在飞书文档的日常使用流程中实现智能获取、编辑和搜索,提升内容处理效率和体验。
20
+
21
+ > ⭐ **Star 本项目,第一时间获取最新功能和重要更新!** 关注项目可以让你不错过任何新特性、修复和优化,助你持续高效使用。你的支持也将帮助我们更好地完善和发展项目。⭐
22
+
23
+ ---
24
+
25
+ ## 🛠️ 工具功能详情
26
+
27
+ | 功能类别 | 工具名称 | 描述 | 使用场景 | 状态 |
28
+ |---------|--------------------------------------------------------------|-------------|---------------|------|
29
+ | **文档管理** | `create_feishu_document` | 创建新的飞书文档 | 从零开始创建文档 | ✅ 已完成 |
30
+ | | `get_feishu_document_info` | 获取文档基本信息 | 验证文档存在性和权限 | ✅ 已完成 |
31
+ | | `get_feishu_document_content` | 获取文档纯文本内容 | 内容分析和处理 | ✅ 已完成 |
32
+ | | `get_feishu_document_blocks` | 获取文档块结构 | 了解文档层级结构 | ✅ 已完成 |
33
+ | | `get_feishu_block_content` | 获取特定块内容 | 检查块属性和格式 | ✅ 已完成 |
34
+ | **内容编辑** | `batch_create_feishu_blocks` | 批量创建多个块 | 高效创建连续内容 | ✅ 已完成 |
35
+ | | `update_feishu_block_text` | 更新块文本内容 | 修改现有内容 | ✅ 已完成 |
36
+ | | `create_feishu_text_block` | 创建单个文本块 | 精确样式控制的文本创建 | ✅ 已完成 |
37
+ | | `create_feishu_code_block` | 创建代码块 | 技术文档和代码示例 | ✅ 已完成 |
38
+ | | `create_feishu_heading_block` | 创建标题块 | 章节标题和层级结构 | ✅ 已完成 |
39
+ | | `create_feishu_list_block` | 创建列表块 | 有序和无序列表创建 | ✅ 已完成 |
40
+ | | `delete_feishu_document_blocks` | 删除文档块 | 清理和重构文档内容 | ✅ 已完成 |
41
+ | **文件夹管理** | `get_feishu_root_folder_info` | 获取根文件夹信息 | 获取基础文件夹信息 | ✅ 已完成 |
42
+ | | `get_feishu_folder_files` | 获取文件夹文件列表 | 浏览文件夹内容 | ✅ 已完成 |
43
+ | | `create_feishu_folder` | 创建新文件夹 | 组织文档结构 | ✅ 已完成 |
44
+ | **搜索功能** | `search_feishu_documents` | 搜索文档 | 查找特定内容 | ✅ 已完成 |
45
+ | **工具功能** | `convert_feishu_wiki_to_document_id` | Wiki链接转换 | 将Wiki链接转为文档ID | ✅ 已完成 |
46
+ | | `get_feishu_image_resource` | 获取图片资源 | 下载文档中的图片 | ✅ 已完成 |
47
+ | | `get_feishu_whiteboard_content` | 获取画板内容 | 获取画板中的图形元素和结构 | 已完成 |
48
+ | **高级功能** | 表格操作 | 创建和编辑表格 | 结构化数据展示 | 🚧 计划中 |
49
+ | | 图表插入 | 支持各类数据可视化图表 | 数据展示和分析 | 🚧 计划中 |
50
+ | | 流程图插入 | 支持流程图和思维导图 | 流程梳理和可视化 | 🚧 计划中 |
51
+ | 图片插入 | `create_feishu_image_block`、`upload_and_bind_image_to_block` | 支持插入本地和远程图片 | 修改文档内容 | 已完成 |
52
+ | | 公式支持 | 支持数学公式 | 学术和技术文档 | ✅ 已完成 |
53
+
54
+ ### 🎨 支持的样式功能
55
+
56
+ - **文本样式**:粗体、斜体、下划线、删除线、行内代码
57
+ - **文本颜色**:灰色、棕色、橙色、黄色、绿色、蓝色、紫色
58
+ - **对齐方式**:左对齐、居中、右对齐
59
+ - **标题级别**:支持1-9级标题
60
+ - **代码块**:支持多种编程语言语法高亮
61
+ - **列表**:有序列表(编号)、无序列表(项目符号)
62
+ - **图片**:支持本地图片和网络图片
63
+ - **公式**:在文本块中插入数学公式,支持LaTeX语法
64
+
65
+ ---
66
+
67
+ ## 🔧 飞书配置教程
68
+
69
+ **⚠️ 重要提示:在开始使用之前,必须先完成飞书应用配置,否则无法正常使用本工具。**
70
+
71
+ 关于如何创建飞书应用和获取应用凭证的说明可以在[官方教程](https://open.feishu.cn/document/home/develop-a-bot-in-5-minutes/create-an-app)找到。
72
+
73
+ **详细的飞书应用配置步骤**:有关注册飞书应用、配置权限、添加文档访问权限的详细指南,请参阅 [手把手教程 FEISHU_CONFIG.md](FEISHU_CONFIG.md)。
74
+
75
+ ---
76
+
77
+ ## 🏃‍♂️ 快速开始
78
+
79
+ ### 方式一:使用 NPM 快速运行
80
+
81
+ ```bash
82
+ npx feishu-mcp@latest --feishu-app-id=<你的飞书应用ID> --feishu-app-secret=<你的飞书应用密钥>
83
+ ```
84
+
85
+ ### 方式二:使用 Smithery 平台
86
+
87
+ **已发布到 Smithery 平台,可访问:** https://smithery.ai/server/@cso1z/feishu-mcp
88
+
89
+ ### 方式三:本地运行
90
+
91
+
92
+ #### 🌿 分支说明
93
+
94
+ 本项目采用主分支(main)+功能分支(feature/xxx)协作模式:
95
+
96
+ - **main**
97
+ 稳定主线分支,始终保持可用、可部署状态。所有已验证和正式发布的功能都会合并到 main 分支。
98
+
99
+ - **multi-user-token**
100
+
101
+ 多用户隔离与按用户授权的 Feishu Token 获取功能开发分支。该分支支持 userKey 参数、按用户获取和缓存 Token、自定义 Token 服务等高级特性,适用于需要多用户隔离和授权场景的开发与测试。
102
+ > ⚠️ 该分支为 beta 版本,功能更新相较 main 分支可能会有延后。如有相关需求请在 issue 区留言,我会优先同步最新功能到该分支。
103
+
104
+
105
+ 1. **克隆仓库**
106
+ ```bash
107
+ git clone https://github.com/cso1z/Feishu-MCP.git
108
+ cd Feishu-MCP
109
+ ```
110
+
111
+ 2. **安装依赖**
112
+ ```bash
113
+ pnpm install
114
+ ```
115
+
116
+ 3. **配置环境变量**
117
+
118
+ **macOS/Linux:**
119
+ ```bash
120
+ cp .env.example .env
121
+ ```
122
+
123
+ **Windows:**
124
+ ```cmd
125
+ copy .env.example .env
126
+ ```
127
+
128
+ 4. **编辑 .env 文件**
129
+
130
+ 你可以通过以下任一方式编辑 .env 文件:
131
+
132
+ **方式一:使用文件管理器**
133
+ - 在项目文件夹中找到 `.env` 文件
134
+ - 双击打开(系统会自动选择文本编辑器)
135
+ - 或右键选择"打开方式" → 选择文本编辑器
136
+
137
+ **方式二:使用 VS Code**
138
+ ```bash
139
+ code .env
140
+ ```
141
+
142
+ **方式三:使用命令行编辑器**
143
+ ```bash
144
+ # macOS/Linux
145
+ nano .env
146
+
147
+ # Windows
148
+ notepad .env
149
+ ```
150
+
151
+ 填入你的飞书应用凭证:
152
+ ```env
153
+ FEISHU_APP_ID=cli_xxxxx
154
+ FEISHU_APP_SECRET=xxxxx
155
+ PORT=3333
156
+ ```
157
+
158
+ 5. **运行服务器**
159
+ ```bash
160
+ pnpm run dev
161
+ ```
162
+
163
+ ## ⚙️ 项目配置
164
+
165
+ ### 环境变量配置
166
+
167
+ | 变量名 | 必需 | 描述 | 默认值 |
168
+ |--------|------|------|-------|
169
+ | `FEISHU_APP_ID` | | 飞书应用 ID | - |
170
+ | `FEISHU_APP_SECRET` | ✅ | 飞书应用密钥 | - |
171
+ | `PORT` | ❌ | 服务器端口 | `3333` |
172
+
173
+ ### 命令行参数
174
+
175
+ | 参数 | 描述 | 默认值 |
176
+ |------|------|-------|
177
+ | `--port` | 服务器监听端口 | `3333` |
178
+ | `--log-level` | 日志级别 (debug/info/log/warn/error/none) | `info` |
179
+ | `--feishu-app-id` | 飞书应用 ID | - |
180
+ | `--feishu-app-secret` | 飞书应用密钥 | - |
181
+ | `--feishu-base-url` | 飞书API基础URL | `https://open.feishu.cn/open-apis` |
182
+ | `--cache-enabled` | 是否启用缓存 | `true` |
183
+ | `--cache-ttl` | 缓存生存时间(秒) | `3600` |
184
+ | `--stdio` | 命令模式运行 | - |
185
+ | `--help` | 显示帮助菜单 | - |
186
+ | `--version` | 显示版本号 | - |
187
+
188
+ ### 配置文件方式(适用于 Cursor、Cline 等)
189
+
190
+ ```json
191
+ {
192
+ "mcpServers": {
193
+ "feishu-mcp": {
194
+ "command": "npx",
195
+ "args": ["-y", "feishu-mcp", "--stdio"],
196
+ "env": {
197
+ "FEISHU_APP_ID": "<你的飞书应用ID>",
198
+ "FEISHU_APP_SECRET": "<你的飞书应用密钥>"
199
+ }
200
+ }
201
+ },
202
+ "feishu_local": {
203
+ "url": "http://localhost:3333/sse"
204
+ }
205
+ }
206
+ ```
207
+ ---
208
+
209
+ ## 📝 使用贴士(重要)
210
+
211
+ 1. ### **推荐指定文件夹**:
212
+ 新建文档时,建议主动提供飞书文件夹 token(可为具体文件夹或根文件夹),这样可以更高效地定位和管理文档。如果不确定具体的子文件夹,可以让LLM自动在你指定的文件夹下查找最合适的子目录来新建文档。
213
+
214
+ > **如何获取文件夹 token?**
215
+ > 打开飞书文件夹页面,复制链接(如 `https://.../drive/folder/xxxxxxxxxxxxxxxxxxxxxx`),token 就是链接最后的那一串字符(如 `xxxxxxxxxxxxxxxxxxxxxx`,请勿泄露真实 token)。
216
+
217
+ 2. ### **图片上传路径说明**:
218
+ 本地运行 MCP 时,图片路径既支持本地绝对路径,也支持 http/https 网络图片;如在服务器环境,仅支持网络图片链接(由于cursor调用mcp时参数长度限制,暂不支持直接上传图片文件本体,请使用图片路径或链接方式上传)。
219
+
220
+ 3. ### **公式使用说明**:
221
+ 在文本块中可以混合使用普通文本和公式元素。公式使用LaTeX语法,如:`1+2=3`、`\frac{a}{b}`、`\sqrt{x}`等。支持在同一文本块中包含多个公式和普通文本。
222
+
223
+ ---
224
+
225
+ ## 🚨 故障排查
226
+
227
+ ### 权限问题排查
228
+ 先对照配置问题查看: [手把手教程 FEISHU_CONFIG.md](FEISHU_CONFIG.md)。
229
+
230
+ #### 问题确认
231
+ 1. **检查应用权限**:确保应用已获得必要的文档访问权限
232
+ 2. **验证文档授权**:确认目标文档已授权给应用或应用所在的群组
233
+ 3. **检查可用范围**:确保应用发布版本的可用范围包含文档所有者
234
+
235
+ #### 权限验证与排查
236
+ 1. 获取token:[自建应用获取 app_access_token](https://open.feishu.cn/api-explorer?apiName=app_access_token_internal&project=auth&resource=auth&version=v3)
237
+ 2. 使用第1步获取的token,验证是否有权限访问该文档:[获取文档基本信息](https://open.feishu.cn/api-explorer?apiName=get&project=docx&resource=document&version=v1)
238
+
239
+
240
+ ### 常见问题
241
+
242
+ - **找不到应用**:检查应用是否已发布且可用范围配置正确
243
+ - **权限不足**:参考[云文档常见问题](https://open.feishu.cn/document/ukTMukTMukTM/uczNzUjL3czM14yN3MTN)
244
+ - **知识库访问问题**:参考[知识库常见问题](https://open.feishu.cn/document/server-docs/docs/wiki-v2/wiki-qa)
245
+
246
+ ---
247
+
248
+ ## 💖 支持项目
249
+
250
+ 如果这个项目帮助到了你,请考虑:
251
+
252
+ - ⭐ 给项目一个 Star
253
+ - 🐛 报告 Bug 和问题
254
+ - 💡 提出新功能建议
255
+ - 📖 改进文档
256
+ - 🔀 提交 Pull Request
257
+
258
+ 你的支持是我们前进的动力!
259
+
260
+ **<span id="group-qr">欢迎加入我们的交流群,与更多小伙伴一起交流:</span>**
261
+
262
+ <img src="./image/group_qr.jpg" alt="飞书MCP交流群二维码" width="300" />
263
+
264
+ ## 🤝 贡献
265
+
266
+ 欢迎提交 Issue 和 Pull Request!如果你在使用过程中遇到问题或有改进建议,也欢迎随时告诉我们。
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { formatErrorMessage } from '../../utils/error.js';
3
3
  import { Logger } from '../../utils/logger.js';
4
- import { DocumentIdSchema, BlockIdSchema, SearchKeySchema, } from '../../types/feishuSchema.js';
4
+ import { DocumentIdSchema, BlockIdSchema, SearchKeySchema, WhiteboardIdSchema, DocumentTitleSchema, FolderTokenSchema, } from '../../types/feishuSchema.js';
5
5
  /**
6
6
  * 注册飞书相关的MCP工具
7
7
  * @param server MCP服务器实例
@@ -10,8 +10,8 @@ import { DocumentIdSchema, BlockIdSchema, SearchKeySchema, } from '../../types/f
10
10
  export function registerFeishuTools(server, feishuService) {
11
11
  // 添加创建飞书文档工具
12
12
  server.tool('create_feishu_document', 'Creates a new Feishu document and returns its information. Use this tool when you need to create a document from scratch with a specific title and folder location.', {
13
- title: z.string().describe('Document title (required). This will be displayed in the Feishu document list and document header.'),
14
- folderToken: z.string().describe('Folder token (required). Specifies where to create the document. Format is an alphanumeric string like "doxcnOu1ZKYH4RtX1Y5XwL5WGRh".'),
13
+ title: DocumentTitleSchema,
14
+ folderToken: FolderTokenSchema,
15
15
  }, async ({ title, folderToken }) => {
16
16
  try {
17
17
  Logger.info(`开始创建飞书文档,标题: ${title}${folderToken ? `,文件夹Token: ${folderToken}` : ',使用默认文件夹'}`);
@@ -96,8 +96,26 @@ export function registerFeishuTools(server, feishuService) {
96
96
  Logger.info(`开始获取飞书文档块,文档ID: ${documentId}`);
97
97
  const blocks = await feishuService.getDocumentBlocks(documentId);
98
98
  Logger.info(`飞书文档块获取成功,共 ${blocks.length} 个块`);
99
+ // 检查是否有 block_type 为 43 的块(画板块)
100
+ const whiteboardBlocks = blocks.filter((block) => block.block_type === 43);
101
+ const hasWhiteboardBlocks = whiteboardBlocks.length > 0;
102
+ let responseText = JSON.stringify(blocks, null, 2);
103
+ if (hasWhiteboardBlocks) {
104
+ responseText += '\n\n⚠️ 检测到画板块 (block_type: 43)!\n';
105
+ responseText += `发现 ${whiteboardBlocks.length} 个画板块。画板块包含丰富的图形内容,如形状、文本、思维导图等。\n`;
106
+ responseText += '建议使用 get_feishu_whiteboard_content 工具来获取画板的具体内容和结构。\n';
107
+ responseText += '画板信息:\n';
108
+ whiteboardBlocks.forEach((block, index) => {
109
+ responseText += ` ${index + 1}. 块ID: ${block.block_id}`;
110
+ if (block.board && block.board.token) {
111
+ responseText += `, 画板ID: ${block.board.token}`;
112
+ }
113
+ responseText += '\n';
114
+ });
115
+ responseText += '请使用上述画板ID调用 get_feishu_whiteboard_content 工具。';
116
+ }
99
117
  return {
100
- content: [{ type: 'text', text: JSON.stringify(blocks, null, 2) }],
118
+ content: [{ type: 'text', text: responseText }],
101
119
  };
102
120
  }
103
121
  catch (error) {
@@ -163,4 +181,29 @@ export function registerFeishuTools(server, feishuService) {
163
181
  };
164
182
  }
165
183
  });
184
+ // 添加获取画板内容工具
185
+ server.tool('get_feishu_whiteboard_content', 'Retrieves the content and structure of a Feishu whiteboard. This tool fetches all nodes (elements) from a whiteboard, including shapes, text, mind maps, and other graphical elements. Use this to analyze whiteboard content, extract information, or understand the structure of collaborative diagrams. The whiteboard ID can be obtained from the board.token field when getting document blocks with block_type: 43.', {
186
+ whiteboardId: WhiteboardIdSchema,
187
+ }, async ({ whiteboardId }) => {
188
+ try {
189
+ if (!feishuService) {
190
+ return {
191
+ content: [{ type: 'text', text: 'Feishu service is not initialized. Please check the configuration' }],
192
+ };
193
+ }
194
+ Logger.info(`开始获取飞书画板内容,画板ID: ${whiteboardId}`);
195
+ const whiteboardContent = await feishuService.getWhiteboardContent(whiteboardId);
196
+ Logger.info(`飞书画板内容获取成功,节点数量: ${whiteboardContent.nodes?.length || 0}`);
197
+ return {
198
+ content: [{ type: 'text', text: JSON.stringify(whiteboardContent, null, 2) }],
199
+ };
200
+ }
201
+ catch (error) {
202
+ Logger.error(`获取飞书画板内容失败:`, error);
203
+ const errorMessage = formatErrorMessage(error);
204
+ return {
205
+ content: [{ type: 'text', text: `获取飞书画板内容失败: ${errorMessage}` }],
206
+ };
207
+ }
208
+ });
166
209
  }
@@ -90,14 +90,29 @@ export class BlockFactory {
90
90
  return {
91
91
  block_type: 2, // 2表示文本块
92
92
  text: {
93
- elements: textContents.map(content => ({
94
- text_run: {
95
- content: content.text,
96
- text_element_style: BlockFactory.applyDefaultTextStyle(content.style)
93
+ elements: textContents.map(content => {
94
+ // 检查是否是公式元素
95
+ if ('equation' in content) {
96
+ return {
97
+ equation: {
98
+ content: content.equation,
99
+ text_element_style: BlockFactory.applyDefaultTextStyle(content.style)
100
+ }
101
+ };
102
+ }
103
+ else {
104
+ // 普通文本元素
105
+ return {
106
+ text_run: {
107
+ content: content.text,
108
+ text_element_style: BlockFactory.applyDefaultTextStyle(content.style)
109
+ }
110
+ };
97
111
  }
98
- })),
112
+ }),
99
113
  style: {
100
114
  align: align, // 1 居左,2 居中,3 居右
115
+ folded: false
101
116
  }
102
117
  }
103
118
  };
@@ -221,7 +221,7 @@ export class FeishuApiService extends BaseApiService {
221
221
  * 更新块文本内容
222
222
  * @param documentId 文档ID或URL
223
223
  * @param blockId 块ID
224
- * @param textElements 文本元素数组
224
+ * @param textElements 文本元素数组,支持普通文本和公式元素
225
225
  * @returns 更新结果
226
226
  */
227
227
  async updateBlockTextContent(documentId, blockId, textElements) {
@@ -229,12 +229,24 @@ export class FeishuApiService extends BaseApiService {
229
229
  const docId = ParamUtils.processDocumentId(documentId);
230
230
  const endpoint = `/docx/v1/documents/${docId}/blocks/${blockId}?document_revision_id=-1`;
231
231
  Logger.debug(`准备请求API端点: ${endpoint}`);
232
- const elements = textElements.map(item => ({
233
- text_run: {
234
- content: item.text,
235
- text_element_style: BlockFactory.applyDefaultTextStyle(item.style)
232
+ const elements = textElements.map(item => {
233
+ if (item.equation !== undefined) {
234
+ return {
235
+ equation: {
236
+ content: item.equation,
237
+ text_element_style: BlockFactory.applyDefaultTextStyle(item.style)
238
+ }
239
+ };
240
+ }
241
+ else {
242
+ return {
243
+ text_run: {
244
+ content: item.text || '',
245
+ text_element_style: BlockFactory.applyDefaultTextStyle(item.style)
246
+ }
247
+ };
236
248
  }
237
- }));
249
+ });
238
250
  const data = {
239
251
  update_text_elements: {
240
252
  elements: elements
@@ -305,17 +317,27 @@ export class FeishuApiService extends BaseApiService {
305
317
  * 创建文本块
306
318
  * @param documentId 文档ID或URL
307
319
  * @param parentBlockId 父块ID
308
- * @param textContents 文本内容数组
320
+ * @param textContents 文本内容数组,支持普通文本和公式元素
309
321
  * @param align 对齐方式,1为左对齐,2为居中,3为右对齐
310
322
  * @param index 插入位置索引
311
323
  * @returns 创建结果
312
324
  */
313
325
  async createTextBlock(documentId, parentBlockId, textContents, align = 1, index = 0) {
314
- // 处理文本内容样式
315
- const processedTextContents = textContents.map(item => ({
316
- text: item.text,
317
- style: BlockFactory.applyDefaultTextStyle(item.style)
318
- }));
326
+ // 处理文本内容样式,支持普通文本和公式元素
327
+ const processedTextContents = textContents.map(item => {
328
+ if (item.equation !== undefined) {
329
+ return {
330
+ equation: item.equation,
331
+ style: BlockFactory.applyDefaultTextStyle(item.style)
332
+ };
333
+ }
334
+ else {
335
+ return {
336
+ text: item.text || '',
337
+ style: BlockFactory.applyDefaultTextStyle(item.style)
338
+ };
339
+ }
340
+ });
319
341
  const blockContent = this.blockFactory.createTextBlock({
320
342
  textContents: processedTextContents,
321
343
  align
@@ -501,12 +523,22 @@ export class FeishuApiService extends BaseApiService {
501
523
  case BlockType.TEXT:
502
524
  if ('text' in options && options.text) {
503
525
  const textOptions = options.text;
504
- // 处理文本样式,应用默认样式
526
+ // 处理文本样式,应用默认样式,支持普通文本和公式元素
505
527
  const textStyles = textOptions.textStyles || [];
506
- const processedTextStyles = textStyles.map((item) => ({
507
- text: item.text,
508
- style: BlockFactory.applyDefaultTextStyle(item.style)
509
- }));
528
+ const processedTextStyles = textStyles.map((item) => {
529
+ if (item.equation !== undefined) {
530
+ return {
531
+ equation: item.equation,
532
+ style: BlockFactory.applyDefaultTextStyle(item.style)
533
+ };
534
+ }
535
+ else {
536
+ return {
537
+ text: item.text || '',
538
+ style: BlockFactory.applyDefaultTextStyle(item.style)
539
+ };
540
+ }
541
+ });
510
542
  blockConfig.options = {
511
543
  textContents: processedTextStyles,
512
544
  align: textOptions.align || 1
@@ -566,12 +598,22 @@ export class FeishuApiService extends BaseApiService {
566
598
  if ('text' in options) {
567
599
  blockConfig.type = BlockType.TEXT;
568
600
  const textOptions = options.text;
569
- // 处理文本样式,应用默认样式
601
+ // 处理文本样式,应用默认样式,支持普通文本和公式元素
570
602
  const textStyles = textOptions.textStyles || [];
571
- const processedTextStyles = textStyles.map((item) => ({
572
- text: item.text,
573
- style: BlockFactory.applyDefaultTextStyle(item.style)
574
- }));
603
+ const processedTextStyles = textStyles.map((item) => {
604
+ if (item.equation !== undefined) {
605
+ return {
606
+ equation: item.equation,
607
+ style: BlockFactory.applyDefaultTextStyle(item.style)
608
+ };
609
+ }
610
+ else {
611
+ return {
612
+ text: item.text || '',
613
+ style: BlockFactory.applyDefaultTextStyle(item.style)
614
+ };
615
+ }
616
+ });
575
617
  blockConfig.options = {
576
618
  textContents: processedTextStyles,
577
619
  align: textOptions.align || 1
@@ -922,6 +964,32 @@ export class FeishuApiService extends BaseApiService {
922
964
  return 'image/png'; // 默认PNG
923
965
  }
924
966
  }
967
+ /**
968
+ * 获取画板内容
969
+ * @param whiteboardId 画板ID或URL
970
+ * @returns 画板节点数据
971
+ */
972
+ async getWhiteboardContent(whiteboardId) {
973
+ try {
974
+ // 从URL中提取画板ID
975
+ let normalizedWhiteboardId = whiteboardId;
976
+ if (whiteboardId.includes('feishu.cn/board/')) {
977
+ // 从URL中提取画板ID
978
+ const matches = whiteboardId.match(/board\/([^\/\?]+)/);
979
+ if (matches) {
980
+ normalizedWhiteboardId = matches[1];
981
+ }
982
+ }
983
+ const endpoint = `/board/v1/whiteboards/${normalizedWhiteboardId}/nodes`;
984
+ Logger.info(`开始获取画板内容,画板ID: ${normalizedWhiteboardId}`);
985
+ const response = await this.get(endpoint);
986
+ Logger.info(`画板内容获取成功,节点数量: ${response.nodes?.length || 0}`);
987
+ return response;
988
+ }
989
+ catch (error) {
990
+ this.handleApiError(error, '获取画板内容失败');
991
+ }
992
+ }
925
993
  /**
926
994
  * 从路径或URL获取图片的Base64编码
927
995
  * @param imagePathOrUrl 图片路径或URL
@@ -16,6 +16,7 @@ export const IndexSchema = z.number().describe('Insertion position index (requir
16
16
  '0 means to insert as the first content block after the title.\n' +
17
17
  'If children is empty or missing, use 0 to insert the first content block.\n' +
18
18
  'For nested blocks, index is relative to the parent block\'s children.\n' +
19
+ '**index must satisfy 0 ≤ index ≤ parentBlock.children.length, otherwise the API will return an error.**\n' +
19
20
  'Note: The title block itself is not part of the children array and cannot be operated on with index.' +
20
21
  'Specifies where the block should be inserted. Use 0 to insert at the beginning. ' +
21
22
  'Use get_feishu_document_blocks tool to understand document structure if unsure. ' +
@@ -53,11 +54,17 @@ export const TextStylePropertiesSchema = {
53
54
  };
54
55
  // 文本样式对象定义
55
56
  export const TextStyleSchema = z.object(TextStylePropertiesSchema).optional().describe('Text style settings. Explicitly set style properties instead of relying on Markdown syntax conversion.');
56
- // 文本内容单元定义
57
- export const TextElementSchema = z.object({
58
- text: z.string().describe('Text content. Provide plain text without markdown syntax; use style object for formatting.'),
59
- style: TextStyleSchema
60
- });
57
+ // 文本内容单元定义 - 支持普通文本和公式元素
58
+ export const TextElementSchema = z.union([
59
+ z.object({
60
+ text: z.string().describe('Text content. Provide plain text without markdown syntax; use style object for formatting.'),
61
+ style: TextStyleSchema
62
+ }).describe('Regular text element with optional styling.'),
63
+ z.object({
64
+ equation: z.string().describe('Mathematical equation content. The formula or expression to display. Format: LaTeX.'),
65
+ style: TextStyleSchema
66
+ }).describe('Mathematical equation element with optional styling.')
67
+ ]);
61
68
  // 文本内容数组定义
62
69
  export const TextElementsArraySchema = z.array(TextElementSchema).describe('Array of text content objects. A block can contain multiple text segments with different styles. Example: [{text:"Hello",style:{bold:true}},{text:" World",style:{italic:true}}]');
63
70
  // 代码块语言参数定义
@@ -74,10 +81,7 @@ export const CodeLanguageSchema = z.number().optional().default(1).describe("Pro
74
81
  export const CodeWrapSchema = z.boolean().optional().default(false).describe('Whether to enable automatic line wrapping. Default is false.');
75
82
  // 文本样式段落定义 - 用于批量创建块工具
76
83
  export const TextStyleBlockSchema = z.object({
77
- textStyles: z.array(z.object({
78
- text: z.string().describe('Text segment content. The actual text to display.'),
79
- style: TextStyleSchema
80
- })).describe('Array of text content objects with styles. A block can contain multiple text segments with different styles. Example: [{text:"Hello",style:{bold:true}},{text:" World",style:{italic:true}}]'),
84
+ textStyles: z.array(TextElementSchema).describe('Array of text content objects with styles. A block can contain multiple text segments with different styles, including both regular text and equations. Example: [{text:"Hello",style:{bold:true}},{equation:"1+2=3",style:{}}]'),
81
85
  align: z.number().optional().default(1).describe('Text alignment: 1 for left (default), 2 for center, 3 for right.'),
82
86
  });
83
87
  // 代码块内容定义 - 用于批量创建块工具
@@ -101,7 +105,8 @@ export const ListBlockSchema = z.object({
101
105
  // 块类型枚举 - 用于批量创建块工具
102
106
  export const BlockTypeEnum = z.string().describe("Block type (required). Supports: 'text', 'code', 'heading', 'list', 'image', as well as 'heading1' through 'heading9'. " +
103
107
  "For headings, we recommend using 'heading' with level property, but 'heading1'-'heading9' are also supported. " +
104
- "For images, use 'image' to create empty image blocks that can be filled later.");
108
+ "For images, use 'image' to create empty image blocks that can be filled later. " +
109
+ "For text blocks, you can include both regular text and equation elements in the same block.");
105
110
  // 图片块内容定义 - 用于批量创建块工具
106
111
  export const ImageBlockSchema = z.object({
107
112
  width: z.number().optional().describe('Image width in pixels (optional). If not provided, default width will be used.'),
@@ -145,3 +150,9 @@ export const ImageFileNameSchema = z.string().optional().describe('Image file na
145
150
  export const ImageWidthSchema = z.number().optional().describe('Image width in pixels (optional). If not provided, the original image width will be used.');
146
151
  // 图片高度参数定义
147
152
  export const ImageHeightSchema = z.number().optional().describe('Image height in pixels (optional). If not provided, the original image height will be used.');
153
+ // 画板ID参数定义
154
+ export const WhiteboardIdSchema = z.string().describe('Whiteboard ID (required). This is the token value from the board.token field when getting document blocks.\n' +
155
+ 'When you find a block with block_type: 43, the whiteboard ID is located in board.token field.\n' +
156
+ 'Example: "EPJKwvY5ghe3pVbKj9RcT2msnBX"');
157
+ // 文档标题参数定义
158
+ export const DocumentTitleSchema = z.string().describe('Document title (required). This will be displayed in the Feishu document list and document header.');
package/package.json CHANGED
@@ -1,75 +1,75 @@
1
- {
2
- "name": "feishu-mcp",
3
- "version": "0.0.13",
4
- "description": "Model Context Protocol server for Feishu integration",
5
- "type": "module",
6
- "main": "dist/index.js",
7
- "bin": {
8
- "feishu-mcp": "./dist/cli.js"
9
- },
10
- "files": [
11
- "dist",
12
- "README.md"
13
- ],
14
- "scripts": {
15
- "build": "tsc && tsc-alias",
16
- "type-check": "tsc --noEmit",
17
- "start": "node dist/index.js",
18
- "start:cli": "cross-env NODE_ENV=cli node dist/index.js",
19
- "start:http": "node dist/index.js",
20
- "dev": "cross-env NODE_ENV=development tsx watch src/index.ts",
21
- "dev:cli": "cross-env NODE_ENV=development tsx watch src/index.ts --stdio",
22
- "lint": "eslint . --ext .ts",
23
- "format": "prettier --write \"src/**/*.ts\"",
24
- "inspect": "pnpx @modelcontextprotocol/inspector",
25
- "prepare": "pnpm run build",
26
- "pub:release": "pnpm build && npm publish"
27
- },
28
- "engines": {
29
- "node": "^20.17.0"
30
- },
31
- "repository": {
32
- "type": "git",
33
- "url": "https://github.com/cso1z/Feishu-MCP.git"
34
- },
35
- "keywords": [
36
- "feishu",
37
- "lark",
38
- "mcp",
39
- "typescript"
40
- ],
41
- "author": "cso1z",
42
- "license": "MIT",
43
- "dependencies": {
44
- "@modelcontextprotocol/sdk": "^1.13.1",
45
- "@types/yargs": "^17.0.33",
46
- "axios": "^1.7.9",
47
- "cross-env": "^7.0.3",
48
- "dotenv": "^16.4.7",
49
- "express": "^4.21.2",
50
- "form-data": "^4.0.3",
51
- "remeda": "^2.20.1",
52
- "yargs": "^17.7.2",
53
- "zod": "^3.24.2"
54
- },
55
- "devDependencies": {
56
- "@types/express": "^5.0.0",
57
- "@types/jest": "^29.5.11",
58
- "@types/node": "^20.17.0",
59
- "@typescript-eslint/eslint-plugin": "^8.24.0",
60
- "@typescript-eslint/parser": "^8.24.0",
61
- "eslint": "^9.20.1",
62
- "eslint-config-prettier": "^10.0.1",
63
- "jest": "^29.7.0",
64
- "prettier": "^3.5.0",
65
- "ts-jest": "^29.2.5",
66
- "tsc-alias": "^1.8.10",
67
- "tsx": "^4.19.2",
68
- "typescript": "^5.7.3"
69
- },
70
- "pnpm": {
71
- "overrides": {
72
- "feishu-mcp": "link:"
73
- }
74
- }
75
- }
1
+ {
2
+ "name": "feishu-mcp",
3
+ "version": "0.0.14",
4
+ "description": "Model Context Protocol server for Feishu integration",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "feishu-mcp": "./dist/cli.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "README.md"
13
+ ],
14
+ "scripts": {
15
+ "build": "tsc && tsc-alias",
16
+ "type-check": "tsc --noEmit",
17
+ "start": "node dist/index.js",
18
+ "start:cli": "cross-env NODE_ENV=cli node dist/index.js",
19
+ "start:http": "node dist/index.js",
20
+ "dev": "cross-env NODE_ENV=development tsx watch src/index.ts",
21
+ "dev:cli": "cross-env NODE_ENV=development tsx watch src/index.ts --stdio",
22
+ "lint": "eslint . --ext .ts",
23
+ "format": "prettier --write \"src/**/*.ts\"",
24
+ "inspect": "pnpx @modelcontextprotocol/inspector",
25
+ "prepare": "pnpm run build",
26
+ "pub:release": "pnpm build && npm publish"
27
+ },
28
+ "engines": {
29
+ "node": "^20.17.0"
30
+ },
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "https://github.com/cso1z/Feishu-MCP.git"
34
+ },
35
+ "keywords": [
36
+ "feishu",
37
+ "lark",
38
+ "mcp",
39
+ "typescript"
40
+ ],
41
+ "author": "cso1z",
42
+ "license": "MIT",
43
+ "dependencies": {
44
+ "@modelcontextprotocol/sdk": "^1.13.1",
45
+ "@types/yargs": "^17.0.33",
46
+ "axios": "^1.7.9",
47
+ "cross-env": "^7.0.3",
48
+ "dotenv": "^16.4.7",
49
+ "express": "^4.21.2",
50
+ "form-data": "^4.0.3",
51
+ "remeda": "^2.20.1",
52
+ "yargs": "^17.7.2",
53
+ "zod": "^3.24.2"
54
+ },
55
+ "devDependencies": {
56
+ "@types/express": "^5.0.0",
57
+ "@types/jest": "^29.5.11",
58
+ "@types/node": "^20.17.0",
59
+ "@typescript-eslint/eslint-plugin": "^8.24.0",
60
+ "@typescript-eslint/parser": "^8.24.0",
61
+ "eslint": "^9.20.1",
62
+ "eslint-config-prettier": "^10.0.1",
63
+ "jest": "^29.7.0",
64
+ "prettier": "^3.5.0",
65
+ "ts-jest": "^29.2.5",
66
+ "tsc-alias": "^1.8.10",
67
+ "tsx": "^4.19.2",
68
+ "typescript": "^5.7.3"
69
+ },
70
+ "pnpm": {
71
+ "overrides": {
72
+ "feishu-mcp": "link:"
73
+ }
74
+ }
75
+ }