Feishu MCP Server

Feishu MCP Server

Enables Claude Code to operate Feishu/Lark as your identity via OAuth, with tools for creating/reading/writing documents, sending messages, and calling any Feishu API.

Category
访问服务器

README

飞书 MCP Server

让 Claude Code 以你的身份直接操作飞书——创建文档、写入内容、发送消息、调用任意飞书 API。

原理

你说"帮我写飞书文档" → Claude → MCP Server → 飞书 API(你的身份)
                                              ↑
                               OAuth 2.0 User Access Token

不是用"机器人"身份,而是通过 OAuth 授权拿到你的用户 Token,飞书看到的所有操作都是你本人做的。

准备工作

1. 创建飞书应用

  1. 打开 飞书开放平台,进入开发者后台
  2. 创建 企业自建应用
  3. 凭证与基础信息 中记录 App IDApp Secret

2. 配置权限

进入应用的 权限管理,添加以下权限:

  • docx:document — 文档读写
  • docx:document:readonly — 文档读取
  • drive:drive — 云空间操作

3. 配置 OAuth 重定向 URL

进入 安全设置 → 重定向 URL,添加:

http://localhost:3040/callback

4. 发布应用

应用发布 中创建版本并发布(管理员审批后生效)。


安装

# 1. 克隆项目
git clone <repo-url>
cd feishu-mcp-server

# 2. 安装依赖
npm install

# 3. 配置凭证
cp .env.example .env
# 编辑 .env,填入 App ID 和 App Secret

授权

node auth.js

浏览器会自动打开飞书授权页 → 点「确认授权」→ refresh_token 自动写入 .env

配置 Claude Code

编辑 用户级 settings.json(~/.claude/settings.jsonC:\Users\<用户名>\.claude\settings.json):

{
  "mcpServers": {
    "feishu": {
      "command": "node",
      "args": ["<项目路径>/index.js"]
    }
  }
}

用户级配置让所有项目共用,不需要每个项目重复配。

重启 Claude Code 后生效。


使用

通过 Claude Code(对话)

"帮我在飞书创建一个名为「周会纪要」的文档"
"把下面这段分析写到飞书文档 xxx 末尾"
"读取飞书文档 xxx 的内容,帮我总结一下"

通过命令行(独立使用)

# 创建一个能被 Claude 读写的文档
node create-doc.js "文档标题"

可用工具

工具 说明
feishu_create_document 创建新文档
feishu_write_document_content 写入内容(支持 Markdown)
feishu_get_document 读取文档
feishu_send_message 发送消息
feishu_call_api 调用任意飞书 API

文件结构

├── index.js          # MCP Server 主程序
├── auth.js           # OAuth 授权脚本(首次运行一次)
├── create-doc.js     # 命令行创建文档工具
├── .env.example      # 凭证模板
├── .env              # 真实凭证(不提交 Git)
└── .gitignore

---

# Feishu MCP Server (English)

Let Claude Code operate Feishu/Lark **as you** — create documents, write content, send messages, call any Feishu API.

## How It Works

You: "Create a doc in Feishu" → Claude → MCP Server → Feishu API (your identity) ↑ OAuth 2.0 User Access Token


Instead of a bot identity, the server uses OAuth to obtain a **user access token**. Every action appears in Feishu as done by **you personally** — so you can see and edit everything.

## Prerequisites

### 1. Create a Feishu App

1. Go to [Feishu Open Platform](https://open.feishu.cn) → Developer Console
2. Create an **Enterprise Internal App**
3. Note the `App ID` and `App Secret` from **Credentials & Basic Info**

### 2. Configure Permissions

Navigate to **Permission Management** and add:

- `docx:document` — Read & write documents
- `docx:document:readonly` — Read documents
- `drive:drive` — Cloud drive operations

### 3. Configure OAuth Redirect URL

Go to **Security Settings** → Redirect URL, add:

http://localhost:3040/callback


### 4. Publish the App

Create a version under **App Publish** and submit for admin approval.

---

## Installation

```bash
git clone <repo-url>
cd feishu-mcp-server
npm install
cp .env.example .env
# Edit .env with your App ID and App Secret

Authorization

node auth.js

A browser window opens → authorize the app → refresh_token is saved to .env automatically.


Configure Claude Code

Edit your user-level settings.json (~/.claude/settings.json on macOS/Linux, or C:\Users\<username>\.claude\settings.json on Windows):

{
  "mcpServers": {
    "feishu": {
      "command": "node",
      "args": ["<path-to-project>/index.js"]
    }
  }
}

User-level config means it works across all projects. Restart Claude Code to load.


Usage

Via Claude Code

"Create a new doc in Feishu called 'Meeting Notes'"
"Append this analysis to Feishu doc xxx"
"Read Feishu doc xxx and summarize it"

Command Line

# Create a doc that Claude can read & write
node create-doc.js "Document Title"

Tools

Tool Description
feishu_create_document Create a new document
feishu_write_document_content Write content (supports Markdown)
feishu_get_document Read a document
feishu_send_message Send a message to a user or chat
feishu_call_api Call any Feishu API directly

File Structure

├── index.js          # MCP Server entry point
├── auth.js           # OAuth authorization script (run once)
├── create-doc.js     # CLI document creation tool
├── .env.example      # Credential template
├── .env              # Real credentials (gitignored)
└── .gitignore

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选