Lark Mcp Server

by larksuite

1.4k downloads
Not rated
GitHub

Description

# Feishu/Lark OpenAPI MCP [![npm version](https://img.shields.io/npm/v/@larksuiteoapi/lark-mcp.svg)](https://www.npmjs.com/package/@larksuiteoapi/lark-mcp) [![npm downloads](https://img.shields.io/npm/dm/@larksuiteoapi/lark-mcp.svg)](https://www.npmjs.com/package/@larksuiteoapi/l…

About

# Feishu/Lark OpenAPI MCP [![npm version](https://img.shields.io/npm/v/@larksuiteoapi/lark-mcp.svg)](https://www.npmjs.com/package/@larksuiteoapi/lark-mcp) [![npm downloads](https://img.shields.io/npm/dm/@larksuiteoapi/lark-mcp.svg)](https://www.npmjs.com/package/@larksuiteoapi/lark-mcp) [![Node.js…

Details

Author
larksuite
Downloads
1,419
Categories
Communication, Automation

- Complete Feishu/Lark API toolkit covering core functional areas
- Dual authentication: App Access Token and User Access Token
- Two transport protocols: stdio (default) and SSE (HTTP)
- Flexible tool selection via --tools parameter
- Supports Feishu China version and Lark international domain
- Multiple configuration methods: CLI arguments, environment variables, config file

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Lark Mcp Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install the package globally (npm install -g @larksuiteoapi/lark-mcp), then configure an MCP client (e.g., Cursor or Claude) with a JSON block specifying the command and App credentials. Alternatively, use environment variables or a config file. Customize behavior via command-line parameters to select tools, domain, language, transport mode, token, and tool name format.

bitable_v1_app_create

[Feishu/Lark]-Docs-Base-App-Create a Base App-Create a base app in user-defined folder

bitable_v1_appTable_create

[Feishu/Lark]-Docs-Base-Table-Create table-Add a new table in Base, supporting the input of table name, view name, and fields

bitable_v1_appTableField_list

[Feishu/Lark]-Docs-Base-Field-List fields-Get all fields according to app_token and table_id

bitable_v1_appTable_list

[Feishu/Lark]-Docs-Base-Table-List all tables-According to app_token, get all tables under app

bitable_v1_appTableRecord_create

[Feishu/Lark]-Docs-Base-Record-Create a record-Create a record

bitable_v1_appTableRecord_search

[Feishu/Lark]-Docs-Base-Record-Search records-This api is used to query existing records in the table. A maximum of 500 rows of records can be queried at a time, and paging is supported

bitable_v1_appTableRecord_update

[Feishu/Lark]-Docs-Base-Record-Update a record-Update a record

contact_v3_user_batchGetId

[Feishu/Lark]-Contacts-User-Obtain user ID via email or mobile number-Call this interface to obtain the ID (including user_id, open_id, union_id) and status information of one or more users through their mobile phone number or email address

docx_v1_document_rawContent

[Feishu/Lark]-Docs-Document-Document-Obtain the plain text content of the document-Obtains the plain text content of the document

drive_v1_permissionMember_create

[Feishu/Lark]-Docs-Permission-Member-Add permissions-Add collaborators to the specified cloud document. Collaborators can be users, groups, departments, user groups, etc

im_v1_chat_create

[Feishu/Lark]-Group Chat-Group management-Create a group-Create a group chat. When creating a group chat, you can set the group avatar, group name, group owner, group type and other configurations. You can also invite group members and group bots to join the group

im_v1_chat_list

[Feishu/Lark]-Group Chat-Group management-Obtain groups where the user or bot is a member-Get the list of groups where the user or bot represented by [access_token] is a member

im_v1_chatMembers_get

[Feishu/Lark]-Group Chat-Group member-Obtain group member list-Get the list of members of the group the user/bot is in

im_v1_message_create

[Feishu/Lark]-Messaging-Message management-Send message-Call this interface to send a message to a specified user or group chat. Supported message types include text, rich text, cards, group business cards, personal business cards, pictures, videos, audio, files, and emoticons

im_v1_message_list

[Feishu/Lark]-Messaging-Message management-Get chat history-Obtains chat history (chat records) of chats (including private chats and group chats)

wiki_v1_node_search

[Feishu/Lark]-Docs-Wiki-Search Wiki

wiki_v2_space_getNode

[Feishu/Lark]-Docs-Wiki-node-Get Wiki node information-Get wiki node inforamtion

docx_builtin_search

[Feishu/Lark]-Docs-Document-Search Document-Search cloud documents, only supports user_access_token

docx_builtin_import

[Feishu/Lark]-Docs-Document-Import Document-Import cloud document, maximum 20MB

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "lark mcp server": {
            "lark-mcp": {
                "command": "npx",
                "args": [
                    "-y",
                    "@larksuiteoapi/lark-mcp",
                    "mcp",
                    "-a",
                    "<your_app_id>",
                    "-s",
                    "<your_app_secret>",
                    "-u",
                    "<your_user_token>"
                ]
            }
        }
    }
}

McpServers

{
    "lark-mcp": {
        "command": "npx",
        "args": [
            "-y",
            "@larksuiteoapi/lark-mcp",
            "mcp",
            "-a",
            "<your_app_id>",
            "-s",
            "<your_app_secret>",
            "-u",
            "<your_user_token>"
        ]
    }
}

Feishu/Lark OpenAPI MCP

npm version
npm downloads
Node.js Version

English | 中文

> ⚠️ 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 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:

1. Visit the Feishu Open Platform or Lark Open Platform and log in
2. Click "Get Started" and create a new application
3. Obtain the App ID and App Secret, which will be used for API authentication
4. Add the necessary permissions for your application based on your usage scenario
5. 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

1. Using Homebrew (Recommended):

   brew install node
   

2. 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

1. 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

2. 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 Cursor/Claude

To integrate Feishu/Lark functionality in AI tools like 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>"
      ]
    }
  }
}

Advanced Configuration

Command Line Parameters

The lark-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 Feishu China version | -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 |
| --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

1. Basic Usage (using application identity):

   lark-mcp mcp -a cli_xxxx -s yyyyy

2. Using User Identity:

   lark-mcp mcp -a cli_xxxx -s yyyyy -u u-zzzz

3. Specifying Lark International Domain:

   lark-mcp mcp -a cli_xxxx -s yyyyy -d https://open.larksuite.com

4. Enabling Only Specific API Tools:

   lark-mcp mcp -a cli_xxxx -s yyyyy -t im.v1.chat.create,im.v1.message.create

5. 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

6. Setting Tools Language to Chinese:

   lark-mcp mcp -a cli_xxxx -s yyyyy -l zh


> Note: 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).

7. Setting Tool Name Format to Camel Case:

   lark-mcp mcp -a cli_xxxx -s yyyyy -c camel


> Note: By setting the tool name format, you can change how tool names appear in the MCP. For example, im.v1.message.create in different formats:
> - snake format (default): im_v1_message_create
> - camel format: imV1MessageCreate
> - kebab format: im-v1-message-create
> - dot format: im.v1.message.create

8. 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.json

Configuration 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": "",
  "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.

Using User Access Token

If you need to call APIs as a specific user, you can do so by specifying a User Access Token:

lark-mcp mcp -a <your_app_id> -s <your_app_secret> -u <your_user_token>

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.

Specifying Custom Domains

If you are using the Lark international version or a custom domain, you can specify it using the -d parameter:

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.