Feishu/Lark MCP server

Integrates with Feishu/Lark's collaboration suite, enabling AI assistants to interact with productivity tools through the official Node.js SDK.
Back to servers
Setup instructions
Provider
Lark Technologies
Release date
Apr 17, 2025
Language
TypeScript
Package
Stats
13.7K downloads
175 stars

This MCP server provides Feishu/Lark API integration for AI tools, allowing them to interact with Feishu/Lark services like messages, documents, calendars, and more through a standardized Model Context Protocol interface.

Installation

Prerequisites

Before using the lark-mcp tool, you need to:

  1. Create a Feishu/Lark application:

  2. Install Node.js:

    • Download from the Node.js website (LTS version recommended)
    • Verify installation:
    node -v
    npm -v
    

Basic Usage

Integration with AI Tools

To use with 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>"
      ]
    }
  }
}

Using User Authentication

For API access with user identity, first log in via terminal:

# Login and get user access token
npx -y @larksuiteoapi/lark-mcp login -a cli_xxxx -s yyyyy
   
# Optionally specify OAuth scope
npx -y @larksuiteoapi/lark-mcp login -a cli_xxxx -s yyyyy --scope offline_access docx:document

Then update your configuration to include the OAuth flag:

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

Advanced Configuration

Specifying API Tools

By default, common APIs are enabled. To enable specific APIs or presets:

npx -y @larksuiteoapi/lark-mcp mcp -a <your_app_id> -s <your_app_secret> -t im.v1.message.create,im.v1.message.list,preset.calendar.default

Available Preset Collections

  • preset.light - Lightweight tool set with fewer but commonly used tools
  • preset.default - Default tool set containing all preset tools
  • preset.im.default - Instant messaging related tools
  • preset.base.default - Base related tools
  • preset.base.batch - Base batch operation tools
  • preset.doc.default - Document related tools
  • preset.task.default - Task management tools
  • preset.calendar.default - Calendar event management tools

Command Line Options

For mcp command:

Parameter Short Description
--app-id -a Feishu/Lark application App ID
--app-secret -s Feishu/Lark application App Secret
--domain -d API domain (default: https://open.feishu.cn)
--tools -t API tools to enable (comma-separated)
--tool-name-case -c Tool name format (snake, camel, dot, kebab)
--language -l Tools language (zh or en)
--user-access-token -u User access token
--token-mode API token type (auto, tenant_access_token, user_access_token)
--oauth Enable MCP Auth Server
--scope OAuth scope for user access token
--mode -m Transport mode (stdio, streamable, sse)
--host Host in SSE/Streamable mode
--port -p Port in SSE/Streamable mode
--config Configuration file path

Transport Modes

  1. stdio mode (Default) - For integration with AI tools like Trae/Cursor/Claude

    npx -y @larksuiteoapi/lark-mcp mcp -a <your_app_id> -s <your_app_secret> -m stdio
    
  2. SSE mode - HTTP interface with Server-Sent Events

    npx -y @larksuiteoapi/lark-mcp mcp -a <your_app_id> -s <your_app_secret> -m sse --host 0.0.0.0 -p 3000
    
  3. streamable mode - StreamableHTTP-based interface

    npx -y @larksuiteoapi/lark-mcp mcp -a <your_app_id> -s <your_app_secret> -m streamable --host 0.0.0.0 -p 3000
    

Using Configuration File

Create a JSON file (e.g., config.json):

{
  "appId": "cli_xxxx",
  "appSecret": "xxxx",
  "domain": "https://open.feishu.cn",
  "tools": ["im.v1.message.create","im.v1.chat.create"],
  "toolNameCase": "snake",
  "language": "en",
  "tokenMode": "auto",
  "mode": "stdio",
  "oauth": true,
  "scope": "offline_access docx:document"
}

Then run:

npx -y @larksuiteoapi/lark-mcp mcp --config ./config.json

Troubleshooting

  • Connection issues: Verify network, APP_ID, and APP_SECRET
  • Token expired errors: User tokens expire after 2 hours - use the --oauth flag for auto-refresh
  • Permission errors: Check if app has necessary permissions in Developer Console
  • Token limit exceeded: Use -t to reduce enabled APIs or use a model with larger token support

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "lark-mcp" '{"command":"npx","args":["-y","@larksuiteoapi/lark-mcp","mcp","-a","<your_app_id>","-s","<your_app_secret>"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

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

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

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

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later