feishu-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., "@feishu-mcp 搜索我权限内包含“季度总结”的飞书文档"
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.
feishu-mcp
飞书(Lark)MCP 服务:通过 MCP 接口对飞书 文档 / 知识库文档 / 电子表格 / 多维表格 进行读取、写入与搜索。
本质是一个薄连接器:MCP 客户端(ZCode / Claude Code / Cursor 等)通过 MCP 协议发来指令,本服务调用 飞书官方 lark-cli 执行,并把结果整理为 AI 友好的结构化 JSON 返回。认证完全复用 lark-cli 的 OAuth 登录态,本服务自身不接触任何飞书凭证。
支持两种传输模式:
stdio(默认):本地使用,AI 工具直接拉起进程;
HTTP(S):云服务器部署,Streamable HTTP + Bearer Token 鉴权,路径
/mcp。
工具清单(9 个)
工具 | 说明 |
| 读文档(docx/wiki 链接或 token),全文 / 大纲 / 章节 / 关键词定位,Markdown 输出 |
| 写文档: |
| 读电子表格:不传子表返回子表清单;按区域读 CSV, |
| 写电子表格: |
| 读多维表格记录:结构化筛选、排序、字段投影、分页 |
| 写多维表格记录:批量新增 / 按 record_id 更新(单次 ≤200 条) |
| 列出多维表格的数据表与字段 schema(读写记录前先调用) |
| 搜索我有权限的云空间对象(关键词 ≤30 字符,支持 |
| 检查 lark-cli 安装与登录状态,未登录时返回修复指引 |
推荐工作流:search_feishu_docs 找到文档 → 读写;多维表格先 describe_feishu_base 拿 table_id 和字段名 → 再读写记录。
Related MCP server: lark-mcp
前置条件
Node.js ≥ 20
安装并登录 lark-cli(一次性,在运行本服务的机器上):
npx @larksuite/cli@latest install # 或 npm i -g @larksuite/cli
lark-cli config init # 配置应用凭证(交互式)
lark-cli auth login --recommend # 浏览器授权,按业务域授权也可:
# lark-cli auth login --domain docs,drive,base,sheets
lark-cli auth status # 确认登录态本地使用(stdio)
git clone <repo> feishu_mcp && cd feishu_mcp
npm install && npm run buildMCP 客户端配置(以 ZCode / Claude Code 为例):
{
"mcpServers": {
"feishu": {
"command": "node",
"args": ["D:/projects/feishu_mcp/dist/index.js"]
}
}
}Windows 提示:若提示找不到 lark-cli,把
LARK_CLI_PATH设为 lark-cli.exe 的完整路径(通常在npm config get prefix下的node_modules/@larksuite/cli/bin/lark-cli.exe)。
云服务器部署(HTTP(S) 模式)
node dist/index.js # 需要以下环境变量环境变量 | 默认 | 说明 |
|
|
|
| — | HTTP 模式必填,Bearer token,逗号分隔可配多个;未配置拒绝启动 |
|
| 反代场景绑 |
|
| 监听端口,端点为 |
| — | 同时配置则以 HTTPS 直启;不配则纯 HTTP(由前置反代终止 TLS) |
|
| lark-cli 可执行文件路径 |
|
| 调用身份 |
| — | 多应用 profile 时注入 |
|
| 单次 lark-cli 调用超时 |
|
| JSON 配置文件路径(环境变量优先于文件) |
HTTPS 的两条路径
nginx 反代终止 TLS(推荐):服务绑
127.0.0.1:3000,nginx 挂证书转发,见deploy/nginx-feishu-mcp.conf.sample;服务内置 HTTPS:配置
MCP_HTTP_TLS_CERT+MCP_HTTP_TLS_KEY后服务直接以https://启动。
客户端配置示例:
{
"mcpServers": {
"feishu": {
"type": "http",
"url": "https://mcp.example.com/mcp",
"headers": { "Authorization": "Bearer <MCP_HTTP_TOKEN 的值>" }
}
}
}不支持自定义请求头的客户端(如 ChatGPT 网页版"连接器"):把 token 放到 URL 查询参数里,认证方式选"无身份验证":
https://mcp.example.com/mcp?token=<MCP_HTTP_TOKEN 的值>注意:URL 方式的 token 可能出现在浏览器历史/代理日志中,仅在此类受限客户端下使用;如泄露可在服务器改
MCP_HTTP_TOKEN后重启服务轮换。服务同时实现了 RFC 9728/.well-known/oauth-protected-resource元数据端点,规范客户端在 401 时不会误走 OAuth 自动发现。
方式 A:Docker
# 1. 修改 docker-compose.yml 中的 MCP_HTTP_TOKEN
docker compose up -d --build
# 2. 首次登录(一次性):容器内无系统密钥链,lark-cli 回落为文件存储(挂载在 volume 中持久化)
docker exec -it feishu-mcp lark-cli config init
docker exec -it feishu-mcp lark-cli auth login --domain docs,drive,base,sheets
# 按提示在本地浏览器打开授权链接确认即可(无需在服务器开浏览器)
# 3. 重启后登录态仍在(凭证已持久化到 volume)
docker compose restart方式 B:systemd(裸机)
# 构建产物上传到 /opt/feishu-mcp(或服务器上 git clone 后 npm install && npm run build)
sudo cp deploy/feishu-mcp.service /etc/systemd/system/
sudo cp deploy/feishu-mcp.env /opt/feishu-mcp/deploy/ && sudo chmod 600 /opt/feishu-mcp/deploy/feishu-mcp.env
# 编辑 env 中的 MCP_HTTP_TOKEN 等配置
sudo systemctl daemon-reload && sudo systemctl enable --now feishu-mcp服务器上登录(一次性):
sudo -u <运行用户> lark-cli config init
sudo -u <运行用户> lark-cli auth login --domain docs,drive,base,sheets
# 无桌面环境时如连接中断,可用官方断点续登:
# lark-cli auth login --domain docs --no-wait # 记下 device code 与 URL
# lark-cli auth login --device-code <DEVICE_CODE>验证
# stdio 冒烟测试(工具清单 + 登录态 + 真实搜索)
node scripts/smoke-stdio.mjs all
# 写读全链路校准(会在云空间创建"【MCP校准-可删除】"测试文件)
node scripts/calibrate.mjs docs # 文档 create→read→append→replace_text→overwrite
node scripts/calibrate.mjs sheet # 电子表格读取
node scripts/calibrate.mjs base # 多维表格 describe + 读记录
BASE_TOKEN=<token> node scripts/calibrate.mjs basewrite # 多维表格写记录
SHEET_TOKEN=<token> node scripts/calibrate.mjs sheetwrite # 电子表格写注意事项
风险提示:授权后本服务以你的用户身份读写飞书,写入操作(尤其
replace整篇覆盖)不可自动回滚,请在可信网络与可信客户端环境下使用。授权自愈:飞书用户授权失效(长期闲置 token 过期、主动撤销授权)时,工具报错信息会自动附带一个设备码授权链接(10 分钟内有效),在浏览器打开确认后服务后台自动完成登录,无需登录服务器;
check_feishu_auth在授权失效时也会直接返回login_url字段。同一时间只保留一个授权流程,链接 9 分钟内复用。写入可见性:飞书写入后立即读取可能有毫秒级延迟(最终一致)。
电子表格 append:目标子表为空时自动从 A1 写入;非空时追加到数据末行。
多维表格 token:支持
/base/URL、知识库/wiki/URL(自动解析节点)或裸 token。lark-cli 升级:
lark-cli update(官方发布较频繁,schema 修正优先用新版)。
Available Tools
9 toolscheck_feishu_auth检查飞书登录状态A
检查 lark-cli 是否已安装、当前登录状态与可用身份(user/bot)。读写报权限错误时先调用本工具排查。未登录时按返回的指引让用户在部署机上执行登录命令。
Inputs: no named parameters.
describe_feishu_base查看多维表格结构A
列出飞书多维表格(bitable)的所有数据表及每张表的字段 schema(字段名/类型/可选值),用于读写记录前发现 table_id、准确字段名和字段类型约定(如单选字段的合法选项)。base_token 支持多维表格 URL、wiki 知识库 URL 或裸 token。
Inputs: base_token (required).
read_feishu_base_records读取多维表格记录A
读取飞书多维表格(bitable)的数据表记录,返回对象数组(每条含 record_id 和字段值)。可按字段筛选(op 支持 ==/!=/>/>=/</<=/intersects/contains/is_empty/non_empty)、排序、字段投影、分页。先用 describe_feishu_base 获取 table_id 和字段名。base_token 支持多维表格 URL、wiki URL 或裸 token。
Inputs: table_id (required), base_token (required), sort, limit, +5 more.
read_feishu_doc读取飞书文档A
读取飞书云文档内容(支持文档链接 /docx/ 或知识库链接 /wiki/,自动路由),返回 Markdown。可读全文、目录大纲(scope=outline,先看结构)、指定章节(需 block id)、关键词定位。返回 JSON 含 document_id / revision_id / content。
Inputs: doc (required), scope, detail, format, +4 more.
read_feishu_sheet读取飞书电子表格A
读取飞书电子表格(电子表格 spreadsheet,不是多维表格)。不传 sheet_name/sheet_id 时返回工作簿的子表清单;传入子表后按区域读取,默认返回 CSV 文本(纯值),detail=cells 可读公式/样式/批注。
Inputs: url, range, detail, sheet_id, +2 more.
search_feishu_docs搜索飞书云文档A
按关键词搜索我有权限的飞书云空间对象(文档/电子表格/多维表格/知识库文档等),返回标题、类型、URL、更新时间。关键词最长 30 个字符。拿到 URL/token 后可用 read_feishu_doc 等工具进一步读写。
Inputs: query (required), mine, sort, doc_types, +4 more.
write_feishu_base_records写入多维表格记录A
向飞书多维表格(bitable)批量新增或更新记录,单次最多 200 条。mode=create 时 records 为字段对象数组;mode=update 时每项需含 record_id 和 fields。字段值约定:文本直接字符串,单选/多选用字符串数组,日期用 'YYYY-MM-DD HH:mm',勾选用 true/false,数字用数值。先用 describe_feishu_base 确认可写字段。
Inputs: mode (required), records (required), table_id (required), base_token (required).
write_feishu_doc写入飞书文档A
写入飞书云文档(docx / wiki),内容用 Markdown。模式:create=新建文档(需 title);append=在文末追加;replace=整篇覆盖已有文档(慎用,会丢弃原有内容);replace_text=把文档中的精确旧文本替换为新文本(适合小改动)。新建成功返回新文档的 url 和 document_id。
Inputs: mode (required), doc, title, content, +2 more.
write_feishu_sheet写入飞书电子表格A
写入飞书电子表格。模式:overwrite=从锚点单元格(默认 A1)开始粘贴 CSV 文本;append=把 CSV(首行为表头)追加到子表末行;set_cell=向指定区域写值或公式(cells 为二维数组,如 [[{"value":"名称"},{"formula":"=SUM(A1:A2)"}]])。
Inputs: mode (required), csv, url, cells, +6 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Tools are mostly distinct by resource type (doc vs sheet vs base) and action (read vs write vs describe vs search vs auth). The only potential confusion is read_feishu_doc vs search_feishu_docs (both involve docs) and read_feishu_sheet vs read_feishu_base_records (both read tabular data), but descriptions clarify the resource types clearly.
Most tools follow a consistent verb_noun pattern: read_feishu_doc, write_feishu_doc, read_feishu_sheet, write_feishu_sheet, read_feishu_base_records, write_feishu_base_records. Minor deviations: describe_feishu_base (uses describe instead of read), search_feishu_docs (plural docs), and check_feishu_auth (uses check instead of a resource noun).
9 tools is well-scoped for a Feishu/Lark workspace server covering docs, sheets, bitable, search, and auth. Each tool earns its place and the count is within the ideal 3-15 range.
The server covers read/write for docs, sheets, and bitable records, plus schema discovery, search, and auth check. Minor gaps: no delete/update for docs or sheets, no bitable table creation or schema modification, and no explicit tool for listing docs/sheets (though search covers discovery).
Maintenance
Related MCP Connectors
Official Fibery MCP server: query and update your workspace from any AI client via OAuth.
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Remote streamable-HTTP MCP server running on a single Cloudflare Worker. Your assistant gets live Airbnb, Amazon, Booking.com, Google Flights, Maps and Reddit data, social search on X, Instagram and TikTok, the Meta Ad Library, and image/video generation without any keys. Connect your own accounts to let it send WhatsApp or Telegram messages, work an IMAP inbox, manage Meta Ads campaigns and publish to X and LinkedIn. OAuth 2.1 with PKCE; stored credentials are AES-256-GCM encrypted.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceA zero-configuration MCP server enabling AI assistants to interact with Feishu (Lark) workspace through OAuth authentication, supporting document operations, content creation, and advanced file management.22 npmMIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI assistants to search, read, create, and update Feishu/Lark documents and wiki pages. It facilitates seamless document management and wiki searches through OAuth-authenticated API access.23 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI applications to access Feishu (Lark) knowledge base and cloud documents through the MCP protocol.22 npm1ISC
- AlicenseNot gradedqualityCmaintenanceMCP server for Feishu/Lark API integration, enabling AI agents to send messages, manage groups, create and edit documents and spreadsheets, and search knowledge bases.MIT