Feishu/Lark OpenAPI MCP
Enables AI assistants to interact with Feishu/Lark platform through comprehensive OpenAPI integration, supporting message management, document operations, calendar scheduling, group chats, Bitable operations, and more automation scenarios with dual authentication support.
README
Feishu/Lark OpenAPI MCP
English | 中文
Developer Documentation Retrieval MCP | Official Document
⚠️ Beta Version Notice: This tool is currently in Beta stage. Features and APIs may change, so please stay updated with version releases.
This is the Feishu/Lark official OpenAPI MCP (Model Context Protocol) tool designed to help users quickly connect to the Feishu/Lark platform and enable efficient collaboration between AI Agents and Feishu/Lark. The tool encapsulates Feishu/Lark Open Platform API interfaces as MCP tools, allowing AI assistants to directly call these interfaces and implement various automation scenarios such as document processing, conversation management, calendar scheduling, and more.
Features
-
Complete Feishu/Lark API Toolkit: Encapsulates almost all Feishu/Lark API interfaces, including message management, group management, document operations, calendar events, Bitable, and other core functional areas.
-
Dual Authentication Support:
- Supports App Access Token authentication
- Supports User Access Token authentication
-
Flexible Communication Protocols:
- Supports standard input/output stream (stdio) mode, suitable for integration with AI tools like Trae/Cursor/Claude
- Supports Server-Sent Events (SSE) mode, providing HTTP-based interfaces
-
Supports multiple configuration methods, adapting to different usage scenarios
Tool List
A complete list of all supported Feishu/Lark tools can be found in tools.md, where tools are categorized by project and version with descriptions.
Preparation
Creating a Feishu/Lark Application
Before using the lark-mcp tool, you need to create a Feishu/Lark application:
- Visit the Feishu Open Platform or Lark Open Platform and log in
- Click "Console" and create a new application
- Obtain the App ID and App Secret, which will be used for API authentication
- Add the necessary permissions for your application based on your usage scenario
- If you need to call APIs as a user, set up OAuth 2.0 redirect URLs and obtain user access tokens
For detailed application creation and configuration guidelines, please refer to the Feishu Open Platform Documentation - Creating an Application or the Lark Open Platform Documentation.
Installing Node.js
Before using the lark-mcp tool, you need to install the Node.js environment.
Installing Node.js on macOS
-
Using Homebrew (Recommended):
brew install node -
Using the Official Installer:
- Visit the Node.js website
- Download and install the LTS version
- After installation, verify in the terminal:
node -v npm -v
Installing Node.js on Windows
-
Using the Official Installer:
- Visit the Node.js website
- Download and run the Windows installer (.msi file)
- Follow the installation wizard to complete the installation
- After installation, verify in the command prompt:
node -v npm -v
-
Using nvm-windows:
- Download nvm-windows
- Install nvm-windows
- Use nvm to install Node.js:
nvm install latest nvm use <version_number>
Installation
Install the lark-mcp tool globally:
npm install -g @larksuiteoapi/lark-mcp
Usage Guide
Using with Trae/Cursor/Claude
To integrate Feishu/Lark functionality in AI tools like Trae,Cursor or Claude, add the following to your configuration file:
{
"mcpServers": {
"lark-mcp": {
"command": "npx",
"args": [
"-y",
"@larksuiteoapi/lark-mcp",
"mcp",
"-a",
"<your_app_id>",
"-s",
"<your_app_secret>"
]
}
}
}
To access APIs with user identity, you can add a user access token:
{
"mcpServers": {
"lark-mcp": {
"command": "npx",
"args": [
"-y",
"@larksuiteoapi/lark-mcp",
"mcp",
"-a",
"<your_app_id>",
"-s",
"<your_app_secret>",
"-u",
"<your_user_token>"
]
}
}
}
Custom API Configuration
By default, the MCP service enables common APIs. To enable other tools or only specific APIs or presets, you can specify them using the -t parameter (separated by commas):
lark-mcp mcp -a <your_app_id> -s <your_app_secret> -t im.v1.message.create,im.v1.message.list,im.v1.chat.create,preset.calendar.default
Preset Tool Collections in Detail
The following table details each API tool and its inclusion in different preset collections, helping you choose the appropriate preset for your needs:
| Tool Name | Function Description | preset.light | preset.default (Default) | preset.im.default | preset.base.default | preset.base.batch | preset.doc.default | preset.task.default | preset.calendar.default |
|---|---|---|---|---|---|---|---|---|---|
| im.v1.chat.create | Create a group chat | ✓ | ✓ | ||||||
| im.v1.chat.list | Get group chat list | ✓ | ✓ | ||||||
| im.v1.chat.search | Search group chats | ✓ | |||||||
| im.v1.chatMembers.get | Get group members | ✓ | ✓ | ||||||
| im.v1.message.create | Send messages | ✓ | ✓ | ✓ | |||||
| im.v1.message.list | Get message list | ✓ | ✓ | ✓ | |||||
| bitable.v1.app.create | Create base | ✓ | ✓ | ✓ | |||||
| bitable.v1.appTable.create | Create base data table | ✓ | ✓ | ✓ | |||||
| bitable.v1.appTable.list | Get base data table list | ✓ | ✓ | ✓ | |||||
| bitable.v1.appTableField.list | Get base data table field list | ✓ | ✓ | ✓ | |||||
| bitable.v1.appTableRecord.search | Search base data table records | ✓ | ✓ | ✓ | ✓ | ||||
| bitable.v1.appTableRecord.create | Create base data table records | ✓ | ✓ | ||||||
| bitable.v1.appTableRecord.batchCreate | Batch create base data table records | ✓ | ✓ | ||||||
| bitable.v1.appTableRecord.update | Update base data table records | ✓ | ✓ | ||||||
| bitable.v1.appTableRecord.batchUpdate | Batch update base data table records | ✓ | |||||||
| docx.v1.document.rawContent | Get document content | ✓ | ✓ | ✓ | |||||
| docx.builtin.import | Import documents | ✓ | ✓ | ✓ | |||||
| docx.builtin.search | Search documents | ✓ | ✓ | ✓ | |||||
| drive.v1.permissionMember.create | Add collaborator permissions | ✓ | ✓ | ||||||
| wiki.v2.space.getNode | Get Wiki node | ✓ | ✓ | ✓ | |||||
| wiki.v1.node.search | Search Wiki nodes | ✓ | ✓ | ||||||
| contact.v3.user.batchGetId | Batch get user IDs | ✓ | ✓ | ||||||
| task.v2.task.create | Create task | ✓ | |||||||
| task.v2.task.patch | Modify task | ✓ | |||||||
| task.v2.task.addMembers | Add task members | ✓ | |||||||
| task.v2.task.addReminders | Add task reminders | ✓ | |||||||
| calendar.v4.calendarEvent.create | Create calendar event | ✓ | |||||||
| calendar.v4.calendarEvent.patch | Modify calendar event | ✓ | |||||||
| calendar.v4.calendarEvent.get | Get calendar event | ✓ | |||||||
| calendar.v4.freebusy.list | Query free/busy status | ✓ | |||||||
| calendar.v4.calendar.primary | Get primary calendar | ✓ |
Note: In the table, "✓" indicates the tool is included in that preset. Using
-t preset.xxxwill only enable tools marked with "✓" in the corresponding column.
Advanced Configuration
Command Line Parameters
The lark-mcp mcp tool provides various command line parameters for flexible MCP service configuration:
| Parameter | Short | Description | Example |
|---|---|---|---|
--app-id |
-a |
Feishu/Lark application App ID | -a cli_xxxx |
--app-secret |
-s |
Feishu/Lark application App Secret | -s xxxx |
--domain |
-d |
Feishu/Lark API domain, default is https://open.feishu.cn | -d https://open.larksuite.com |
--tools |
-t |
List of API tools to enable, separated by commas | -t im.v1.message.create,im.v1.chat.create |
--tool-name-case |
-c |
Tool name format, options are snake, camel, dot, or kebab, default is snake | -c camel |
--language |
-l |
Tools language, options are zh or en, default is en | -l zh |
--user-access-token |
-u |
User access token for calling APIs as a user | -u u-xxxx |
--token-mode |
API token type, options are auto, tenant_access_token, or user_access_token, default is auto | --token-mode user_access_token |
|
--mode |
-m |
Transport mode, options are stdio or sse, default is stdio | -m sse |
--host |
Listening host in SSE mode, default is localhost | --host 0.0.0.0 |
|
--port |
-p |
Listening port in SSE mode, default is 3000 | -p 3000 |
--config |
Configuration file path, supports JSON format | --config ./config.json |
|
--version |
-V |
Display version number | -V |
--help |
-h |
Display help information | -h |
Parameter Usage Examples
-
Basic Usage (using application identity):
lark-mcp mcp -a cli_xxxx -s yyyyy -
Using User Identity:
lark-mcp mcp -a cli_xxxx -s yyyyy -u u-zzzzNote: User access tokens can be obtained through the Feishu Open Platform's authorization process or Lark Open Platform's authorization process, or you can use the API debugging console to obtain them. After using a user access token, API calls will be made with that user's identity.
-
Setting Specific Token Mode:
lark-mcp mcp -a cli_xxxx -s yyyyy --token-mode user_access_tokenNote: This option allows you to explicitly specify which token type to use when calling APIs. The
automode (default) will be determined by the LLM when calling the API. -
Specifying Lark or KA Domains:
# Lark international version lark-mcp mcp -a <your_app_id> -s <your_app_secret> -d https://open.larksuite.com # Custom domain (KA domain) lark-mcp mcp -a <your_app_id> -s <your_app_secret> -d https://open.your-ka-domain.com -
Enabling Only Specific API Tools or Other API Tools:
lark-mcp mcp -a cli_xxxx -s yyyyy -t im.v1.chat.create,im.v1.message.createNote: The
-tparameter supports the following preset tool collections:preset.light- Lightweight tool set with fewer but commonly used tools, suitable for scenarios that require reduced token usagepreset.default- Default tool set containing all preset toolspreset.im.default- Instant messaging related tools, such as group management, message sending, etc.preset.base.default- Base related tools, such as table creation, record management, etc.preset.base.batch- Base batch operation tools, including batch create and update record functionspreset.doc.default- Document related tools, such as document content reading, permission management, etc.preset.task.default- Task management related tools, such as task creation, member management, etc.preset.calendar.default- Calendar event management tools, such as creating calendar events, querying free/busy status, etc.
-
Using SSE Mode with Specific Port and Host:
lark-mcp mcp -a cli_xxxx -s yyyyy -m sse --host 0.0.0.0 -p 3000 -
Setting Tools Language to Chinese:
lark-mcp mcp -a cli_xxxx -s yyyyy -l zhNote: Setting the language to Chinese (
-l zh) may consume more tokens. If you encounter token limit issues when integrating with large language models, consider using the default English setting (-l en). -
Setting Tool Name Format to Camel Case:
lark-mcp mcp -a cli_xxxx -s yyyyy -c camelNote: By setting the tool name format, you can change how tool names appear in the MCP. For example,
im.v1.message.createin different formats:- snake format (default):
im_v1_message_create - camel format:
imV1MessageCreate - kebab format:
im-v1-message-create - dot format:
im.v1.message.create
- snake format (default):
-
Using Environment Variables Instead of Command Line Parameters:
# Set environment variables export APP_ID=cli_xxxx export APP_SECRET=yyyyy # Start the service (no need to specify -a and -s parameters) lark-mcp mcp -
Using Configuration File:
Besides command line parameters, you can also use a JSON format configuration file to set parameters:
lark-mcp mcp --config ./config.jsonConfiguration file example (config.json):
{ "appId": "cli_xxxx", "appSecret": "xxxx", "domain": "https://open.feishu.cn", "tools": ["im.v1.message.create","im.v1.chat.create"], "toolNameCase": "snake", "language": "zh", "userAccessToken": "", "tokenMode": "auto", "mode": "stdio", "host": "localhost", "port": "3000" }Note: Command line parameters have higher priority than configuration file. When using both command line parameters and configuration file, command line parameters will override corresponding settings in the configuration file.
-
Transport Modes:
lark-mcp supports two transport modes:
- stdio mode (Default/Recommended): Suitable for integration with AI tools like Trae/Cursor or Claude, communicating through standard input/output streams.
lark-mcp mcp -a <your_app_id> -s <your_app_secret> -m stdio- SSE mode: Provides an HTTP interface based on Server-Sent Events, suitable for scenarios where local execution is not possible.
# Default listens only on localhost lark-mcp mcp -a <your_app_id> -s <your_app_secret> -m sse -p 3000 # Listen on all network interfaces (allowing remote access) lark-mcp mcp -a <your_app_id> -s <your_app_secret> -m sse --host 0.0.0.0 -p 3000After startup, the SSE endpoint will be accessible at
http://<host>:<port>/sse.
FAQ
-
Issue: Unable to connect to Feishu/Lark API Solution: Check your network connection and ensure your APP_ID and APP_SECRET are correct. Verify that you can access the Feishu/Lark Open Platform API; you may need to configure a proxy.
-
Issue: Error when using user_access_token Solution: Check if the token has expired. user_access_token usually has a validity period of 2 hours and needs to be refreshed periodically. You can implement an automatic token refresh mechanism.
-
Issue: Unable to call certain APIs after starting the MCP service, with insufficient permissions errors Solution: Check if your application has obtained the corresponding API permissions. Some APIs require additional high-level permissions, which can be configured in the Developer Console or Lark Developer Console. Ensure that permissions have been approved.
-
Issue: Image or file upload/download related API calls fail Solution: The current version does not support file and image upload/download functionality. These APIs will be supported in future versions.
-
Issue: Command line displays garbled characters in Windows environment Solution: Change the command line encoding to UTF-8 by executing
chcp 65001in the command prompt. If using PowerShell, you may need to change the terminal font or PowerShell configuration. -
Issue: Permission errors during installation Solution: On macOS/Linux, use
sudo npm install -g @larksuiteoapi/lark-mcpfor installation, or modify the permissions of the npm global installation path. Windows users can try running the command prompt as administrator. -
Issue: Token limit exceeded after starting the MCP service Solution: Try using
-tto reduce the number of enabled APIs, or use a model that supports larger tokens (such as claude3.7). -
Issue: Unable to connect or receive messages in SSE mode Solution: Check if the port is already in use and try changing to a different port. Ensure that the client is correctly connected to the SSE endpoint and is handling the event stream.
Related Links
- Feishu Open Platform
- Lark International Open Platform
- Feishu Open Platform API Documentation
- Lark Open Platform API Documentation
- Node.js Website
- npm Documentation
Feedback
Issues are welcome to help improve this tool. If you have any questions or suggestions, please raise them in the GitHub repository.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。