openbird 3.2.4 → 3.2.6
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 +98 -40
- package/dist/index.js +11 -11
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,27 +1,18 @@
|
|
|
1
1
|
# OpenBird
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**为 AI Agent 准备的飞书(Lark)工具箱。** 本地运行,通过浏览器 cookie 以你本人的身份接入飞书,把飞书能力打包成可直接调用的工具,提供两个显式运行模式:
|
|
4
4
|
|
|
5
|
-
1. **
|
|
6
|
-
2. **
|
|
5
|
+
1. **MCP 模式** — 通过 stdio 暴露 77 个飞书工具,供 AI Agent(Claude Desktop、Cursor 等)调用
|
|
6
|
+
2. **Relay 模式** — 连接飞书 WebSocket,将消息标准化后 POST 到你提供的 webhook 地址
|
|
7
7
|
|
|
8
8
|
## 快速开始
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
# 克隆并安装
|
|
12
|
-
git clone https://github.com/ztxtxwd/openbird.git
|
|
13
|
-
cd openbird
|
|
14
|
-
pnpm install
|
|
15
|
-
|
|
16
|
-
# 配置
|
|
17
|
-
cp .env.example .env
|
|
18
|
-
# 编辑 .env,粘贴你从浏览器 DevTools 复制的飞书 cookie
|
|
19
|
-
```
|
|
10
|
+
无需 clone 源码,直接通过 `npx` 运行即可。唯一的前置条件是准备好飞书 cookie:打开飞书网页版(feishu.cn),浏览器 DevTools 从任意 `*.feishu.cn` 请求的请求头中复制完整的 `Cookie` 值。
|
|
20
11
|
|
|
21
12
|
### MCP 模式
|
|
22
13
|
|
|
23
14
|
```bash
|
|
24
|
-
OPENBIRD_COOKIE="your_cookie_here"
|
|
15
|
+
OPENBIRD_COOKIE="your_cookie_here" npx openbird mcp
|
|
25
16
|
```
|
|
26
17
|
|
|
27
18
|
仅启动 MCP Server(stdio),不连接 WebSocket,不转发事件。
|
|
@@ -30,18 +21,28 @@ OPENBIRD_COOKIE="your_cookie_here" node bin/openbird.js mcp
|
|
|
30
21
|
|
|
31
22
|
```bash
|
|
32
23
|
OPENBIRD_COOKIE="your_cookie_here" \
|
|
33
|
-
|
|
24
|
+
npx openbird relay http://localhost:3000/webhook
|
|
34
25
|
```
|
|
35
26
|
|
|
36
27
|
连接飞书 WebSocket 并将所有事件转发到你提供的 webhook 地址。
|
|
37
28
|
|
|
38
|
-
###
|
|
29
|
+
### 在 MCP 客户端中配置
|
|
39
30
|
|
|
40
|
-
|
|
41
|
-
node examples/basic-usage.mjs
|
|
42
|
-
```
|
|
31
|
+
以 Claude Desktop / Cursor 为例,在 MCP server 配置里填:
|
|
43
32
|
|
|
44
|
-
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"mcpServers": {
|
|
36
|
+
"openbird": {
|
|
37
|
+
"command": "npx",
|
|
38
|
+
"args": ["-y", "openbird", "mcp"],
|
|
39
|
+
"env": {
|
|
40
|
+
"OPENBIRD_COOKIE": "your_cookie_here"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
45
46
|
|
|
46
47
|
## 配置
|
|
47
48
|
|
|
@@ -57,8 +58,8 @@ node examples/basic-usage.mjs
|
|
|
57
58
|
|
|
58
59
|
旧版本通过 `OPENBIRD_WEBHOOK_URL` 是否存在来隐式决定是否同时启动 webhook 转发。现在改为显式命令:
|
|
59
60
|
|
|
60
|
-
- `
|
|
61
|
-
- `
|
|
61
|
+
- `npx openbird mcp`
|
|
62
|
+
- `npx openbird relay <webhook-url>`
|
|
62
63
|
|
|
63
64
|
Relay 模式不再自动启动 MCP server。
|
|
64
65
|
|
|
@@ -189,12 +190,12 @@ createServer({
|
|
|
189
190
|
|
|
190
191
|
```bash
|
|
191
192
|
OPENBIRD_COOKIE="your_cookie_here" \
|
|
192
|
-
|
|
193
|
+
npx openbird relay http://localhost:3000/webhook
|
|
193
194
|
```
|
|
194
195
|
|
|
195
196
|
## MCP 工具
|
|
196
197
|
|
|
197
|
-
通过 [Model Context Protocol](https://modelcontextprotocol.io/)
|
|
198
|
+
通过 [Model Context Protocol](https://modelcontextprotocol.io/) 提供 **77 个工具**(stdio 通信),覆盖消息、会话、话题、用户、通讯录、机器人、日历、加急、百科、云文档等 14 个类别。
|
|
198
199
|
|
|
199
200
|
### 消息
|
|
200
201
|
|
|
@@ -207,6 +208,17 @@ node bin/openbird.js relay http://localhost:3000/webhook
|
|
|
207
208
|
| `get_message_link_permission` | 查询消息链接预览权限 |
|
|
208
209
|
| `add_reaction` | 添加表情回应 |
|
|
209
210
|
| `remove_reaction` | 移除表情回应 |
|
|
211
|
+
| `pin_message` | 在会话中置顶消息 |
|
|
212
|
+
| `list_chat_pins` | 列出会话中置顶的消息 |
|
|
213
|
+
| `unpin_message` | 取消置顶消息 |
|
|
214
|
+
|
|
215
|
+
### 定时消息
|
|
216
|
+
|
|
217
|
+
| 工具 | 说明 |
|
|
218
|
+
|---|---|
|
|
219
|
+
| `put_schedule_message` | 创建定时消息(未来时间发送) |
|
|
220
|
+
| `patch_schedule_message` | 更新 / 暂停 / 删除 / 立即发送定时消息 |
|
|
221
|
+
| `pull_schedule_message_by_ids` | 按 ID 批量查询定时消息 |
|
|
210
222
|
|
|
211
223
|
### 会话
|
|
212
224
|
|
|
@@ -215,6 +227,8 @@ node bin/openbird.js relay http://localhost:3000/webhook
|
|
|
215
227
|
| `get_chat_history` | 获取聊天历史消息 |
|
|
216
228
|
| `get_chat_meta` | 获取会话元信息(最后消息位置、已读位置等) |
|
|
217
229
|
| `create_chat` | 创建一对一会话 |
|
|
230
|
+
| `create_group` | 创建群聊 |
|
|
231
|
+
| `patch_group_chat` | 更新群聊信息(名称、描述、图标) |
|
|
218
232
|
| `search` | 搜索用户和群组 |
|
|
219
233
|
| `search_in_chat` | 在指定会话中搜索消息 |
|
|
220
234
|
| `mark_chat_read` | 标记会话已读 |
|
|
@@ -223,22 +237,37 @@ node bin/openbird.js relay http://localhost:3000/webhook
|
|
|
223
237
|
| `mark_session` | 标记会话为重要 |
|
|
224
238
|
| `unmark_session` | 取消标记会话 |
|
|
225
239
|
|
|
240
|
+
### 话题
|
|
241
|
+
|
|
242
|
+
| 工具 | 说明 |
|
|
243
|
+
|---|---|
|
|
244
|
+
| `create_thread` | 从消息创建话题 |
|
|
245
|
+
| `get_thread_messages` | 获取话题内的消息列表 |
|
|
246
|
+
|
|
226
247
|
### 用户
|
|
227
248
|
|
|
228
249
|
| 工具 | 说明 |
|
|
229
250
|
|---|---|
|
|
230
|
-
| `get_user_info` | 根据用户 ID
|
|
251
|
+
| `get_user_info` | 根据用户 ID 获取信息(同时支持用户和机器人) |
|
|
252
|
+
| `get_user_by_id` | 获取用户资料(包含 alias 和备注) |
|
|
231
253
|
| `get_user_profile_card` | 获取用户名片(头像、签名等) |
|
|
232
254
|
| `set_user_signature` | 设置当前用户签名 |
|
|
233
255
|
| `get_user_relation` | 查询与目标用户的关系 |
|
|
234
256
|
| `get_user_presence` | 获取用户在线状态 |
|
|
235
257
|
|
|
236
|
-
###
|
|
258
|
+
### 通讯录
|
|
259
|
+
|
|
260
|
+
| 工具 | 说明 |
|
|
261
|
+
|---|---|
|
|
262
|
+
| `save_contact_alias` | 保存联系人备注名和备忘 |
|
|
263
|
+
| `sync_contact_info` | 同步联系人信息 |
|
|
264
|
+
|
|
265
|
+
### Webhook 机器人
|
|
237
266
|
|
|
238
267
|
| 工具 | 说明 |
|
|
239
268
|
|---|---|
|
|
240
269
|
| `create_webhook_bot` | 在指定会话中创建 webhook 机器人 |
|
|
241
|
-
| `get_webhook_bot_info` | 获取 webhook 机器人的 webhook
|
|
270
|
+
| `get_webhook_bot_info` | 获取 webhook 机器人的 webhook 地址和签名配置 |
|
|
242
271
|
| `send_webhook_bot_text` | 通过 webhook URL 发送文本消息 |
|
|
243
272
|
| `send_webhook_bot_post` | 通过 webhook URL 发送富文本 post 消息 |
|
|
244
273
|
| `send_webhook_bot_image` | 通过 webhook URL 使用已有 `image_key` 发送图片消息 |
|
|
@@ -246,25 +275,33 @@ node bin/openbird.js relay http://localhost:3000/webhook
|
|
|
246
275
|
| `send_webhook_bot_card` | 通过 webhook URL 发送交互式卡片消息 |
|
|
247
276
|
| `send_webhook_bot_message` | 通过 webhook URL 发送原始 webhook payload |
|
|
248
277
|
|
|
249
|
-
### 通讯录
|
|
250
|
-
|
|
251
|
-
| 工具 | 说明 |
|
|
252
|
-
|---|---|
|
|
253
|
-
| `save_contact_alias` | 保存联系人备注名和备忘 |
|
|
254
|
-
| `sync_contact_info` | 同步联系人信息 |
|
|
255
|
-
|
|
256
278
|
### 日历
|
|
257
279
|
|
|
258
280
|
| 工具 | 说明 |
|
|
259
281
|
|---|---|
|
|
260
|
-
| `get_calendar_events` |
|
|
282
|
+
| `get_calendar_events` | 获取用户日历事件列表 |
|
|
283
|
+
| `web_list_calendar_events` | 按时间范围列出日历事件 |
|
|
284
|
+
| `mget_events_with_ids` | 按 event key 批量查询事件详情 |
|
|
285
|
+
| `create_calendar_event` | 创建日历事件(标题、时间、地点、提醒、与会者) |
|
|
286
|
+
| `update_calendar_event` | 更新已有日历事件 |
|
|
287
|
+
| `delete_calendar_event` | 删除日历事件 |
|
|
261
288
|
| `calendar_rsvp` | 回复日历邀请(接受/拒绝/待定) |
|
|
289
|
+
| `reply_calendar_event_invitation` | 带 RSVP 评论回复邀请 |
|
|
290
|
+
| `transfer_calendar_event` | 转让事件所有权给其他用户 |
|
|
291
|
+
| `web_share_calendar_event` | 把日历事件分享到一个或多个会话 |
|
|
292
|
+
| `upgrade_to_meeting` | 把日程升级为视频会议(创建会议群) |
|
|
293
|
+
| `create_meeting_minute` | 为日程创建会议纪要文档(返回飞书文档 URL) |
|
|
294
|
+
| `get_place_tips` | 事件地点自动补全 |
|
|
262
295
|
|
|
263
|
-
###
|
|
296
|
+
### 会议室与组织
|
|
264
297
|
|
|
265
298
|
| 工具 | 说明 |
|
|
266
299
|
|---|---|
|
|
267
|
-
| `
|
|
300
|
+
| `search_guests` | 搜索可加为与会者的用户和群组 |
|
|
301
|
+
| `search_meeting_rooms` | 在指定时间窗口内搜索可用会议室 |
|
|
302
|
+
| `pull_buildings` | 列出包含会议室的楼宇 |
|
|
303
|
+
| `pull_meeting_rooms_in_building` | 按楼宇列出会议室 |
|
|
304
|
+
| `pull_tenants_by_ids` | 按租户 ID 批量查询组织信息 |
|
|
268
305
|
|
|
269
306
|
### 加急
|
|
270
307
|
|
|
@@ -273,6 +310,26 @@ node bin/openbird.js relay http://localhost:3000/webhook
|
|
|
273
310
|
| `send_urgent` | 发送加急通知 |
|
|
274
311
|
| `get_urgent_ack_status` | 查询加急确认状态 |
|
|
275
312
|
|
|
313
|
+
### 百科
|
|
314
|
+
|
|
315
|
+
| 工具 | 说明 |
|
|
316
|
+
|---|---|
|
|
317
|
+
| `get_baike_card` | 获取飞书词典词条卡片(定义、全称、贡献者、详情链接) |
|
|
318
|
+
| `get_baike_recommend_docs` | 获取词条的推荐文档 |
|
|
319
|
+
|
|
320
|
+
### 云文档
|
|
321
|
+
|
|
322
|
+
| 工具 | 说明 |
|
|
323
|
+
|---|---|
|
|
324
|
+
| `docx_open_document` | 打开飞书文档进行编辑,返回 block tree 并缓存供后续操作使用 |
|
|
325
|
+
| `get_docx_block_tree` | 获取文档 block tree(支持 wiki 或 docx) |
|
|
326
|
+
| `docx_insert_block` | 插入新 block |
|
|
327
|
+
| `docx_edit_text` | 编辑 block 的文本内容 |
|
|
328
|
+
| `docx_change_block_type` | 修改 block 类型(如文本→标题、列表项→待办) |
|
|
329
|
+
| `docx_set_block_properties` | 设置 block 属性(done / folded / align / language / emoji / 缩进 等) |
|
|
330
|
+
| `docx_delete_blocks` | 删除一个或多个 block |
|
|
331
|
+
| `docx_move_block` | 移动 block 到新的父节点或位置 |
|
|
332
|
+
|
|
276
333
|
### 配置
|
|
277
334
|
|
|
278
335
|
| 工具 | 说明 |
|
|
@@ -284,13 +341,14 @@ node bin/openbird.js relay http://localhost:3000/webhook
|
|
|
284
341
|
|
|
285
342
|
| 工具 | 说明 |
|
|
286
343
|
|---|---|
|
|
287
|
-
| `download_image` |
|
|
344
|
+
| `download_image` | 下载图片(返回 base64 编码数据) |
|
|
288
345
|
| `download_file` | 下载消息附件到本地临时文件并返回路径 |
|
|
289
346
|
|
|
290
347
|
### 使用 MCP Inspector 测试
|
|
291
348
|
|
|
292
349
|
```bash
|
|
293
|
-
|
|
350
|
+
OPENBIRD_COOKIE="your_cookie_here" \
|
|
351
|
+
npx @modelcontextprotocol/inspector npx -y openbird mcp
|
|
294
352
|
```
|
|
295
353
|
|
|
296
354
|
## 项目结构
|
|
@@ -312,7 +370,7 @@ openbird/
|
|
|
312
370
|
│ │ ├── normalizer.js # WebSocket 消息 -> OpenBird 事件
|
|
313
371
|
│ │ └── dispatcher.js # HTTP POST 转发(含重试)
|
|
314
372
|
│ └── mcp/
|
|
315
|
-
│ └── server.js # MCP Server
|
|
373
|
+
│ └── server.js # MCP Server(77 个工具)
|
|
316
374
|
├── examples/
|
|
317
375
|
│ └── basic-usage.mjs # MCP 示例
|
|
318
376
|
└── docs/
|