Feishu (Lark) MCP server

Integrates with Feishu (Lark) to enable document retrieval, messaging, and collaborative features directly within workplace conversations through a TypeScript implementation that runs as either a CLI or HTTP server.
Back to servers
Provider
cso1z
Release date
Mar 17, 2025
Language
TypeScript
Package
Stats
1.3K downloads
34 stars

Feishu MCP Server provides a powerful integration between AI coding tools like Cursor and Feishu (Lark) documents based on the Model Context Protocol. This implementation enables AI tools to directly access, read, and modify Feishu documents, making document interaction more efficient than traditional copy-paste methods.

Installation Options

Quick Start with NPX

The fastest way to get started is using NPX:

npx feishu-mcp --feishu-app-id=<your-feishu-app-id> --feishu-app-secret=<your-feishu-app-secret>

# Alternative package managers
pnpx feishu-mcp --feishu-app-id=<your-feishu-app-id> --feishu-app-secret=<your-feishu-app-secret>
yarn dlx feishu-mcp --feishu-app-id=<your-feishu-app-id> --feishu-app-secret=<your-feishu-app-secret>
bunx feishu-mcp --feishu-app-id=<your-feishu-app-id> --feishu-app-secret=<your-feishu-app-secret>

You can also access the published version at: https://smithery.ai/server/@cso1z/feishu-mcp

JSON Configuration for Tools

For tools like Windsurf, Cline, and Claude Desktop that use configuration files:

{
  "mcpServers": {
    "feishu-mcp": {
      "command": "npx",
      "args": ["-y", "feishu-mcp", "--stdio"],
      "env": {
        "FEISHU_APP_ID": "<your-feishu-app-id>",
        "FEISHU_APP_SECRET": "<your-feishu-app-secret>"
      }
    }
  }
}

Running from Source Code

# Clone repository
# Install dependencies
pnpm install
# Copy .env.example to .env and add your credentials
# Run the server
pnpm run dev

Configuration

You can configure the server using environment variables or command line arguments:

Environment Variables

  • FEISHU_APP_ID: Your Feishu application ID (required)
  • FEISHU_APP_SECRET: Your Feishu application secret (required)
  • PORT: Port to run the server on (default: 3333)

Command Line Arguments

--version              # Show version number
--feishu-app-id        # Your Feishu application ID
--feishu-app-secret    # Your Feishu application secret
--port                 # Port to run the server on
--stdio                # Run in command mode instead of HTTP/SSE
--help                 # Show help menu

Connecting to Cursor

  1. Open Cursor settings
  2. Navigate to Settings > AI > MCP Servers
  3. Add a new server with URL http://localhost:3333 (or your configured port)
  4. Click "Verify Connection" to ensure successful connection

Usage

  1. In Cursor, open the AI panel (default shortcut Cmd+K or Ctrl+K)
  2. For creating a new Feishu document, specify a folderToken from a Feishu directory URL: https://vq5xxxxx7bc.feishu.cn/drive/folder/FPKvfjdxxxxx706RnOc
  3. For modifying an existing document, provide the document link: https://vq5ixxxx7bc.feishu.cn/docx/J6T0d6exxxxxxxDdc1zqwnph
  4. Ask questions about the document or request operations based on its content
  5. Note that creating and editing documents require proper permissions

Document Permissions and Troubleshooting

Permission Types

  • Bot permissions
  • Document access permissions

Verifying Permissions

  1. Get token at: https://open.feishu.cn/api-explorer/cli_a7582508c93ad00d?apiName=tenant_access_token_internal&project=auth&resource=auth&version=v3
  2. Use the token to verify document access: https://open.feishu.cn/api-explorer/cli_a7582508c93ad00d?apiName=get&project=docx&resource=document&version=v1

Getting Help

For permission issues, refer to the Feishu documentation on cloud documents and knowledge base common questions.

Features

Document Management

  • Create new Feishu documents in specified folders

Document Content Operations

  • Get document information (title, version, etc.)
  • Get document block structure and hierarchy
  • Get detailed content of specific blocks
  • Extract complete plain text content
  • Edit document content with rich formatting options:
    • Text blocks with styling (bold, italic, underline, strikethrough, inline code)
    • Text color settings
    • Text alignment options
    • Headings (levels 1-9)
    • Code blocks with syntax highlighting
    • Ordered and unordered lists
    • Batch content creation

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

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

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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