Lark Feishu MCP Server for Sheets, Docs, Messages
Integrate Lark (Feishu) Sheets, Docs, and Messages with an MCP server to enable model-context workflows and seamless AI-driven content management.
npx -y @kone-net/mcp_server_larkOverview
This MCP (Model Context Protocol) server connects Lark (Feishu) applications — Sheets, Docs, and Messages — to model-driven workflows. It implements a set of HTTP endpoints that expose Lark resources as “tools” for a model context system, enabling language models to request, retrieve, and modify content inside Lark workspaces in a structured, auditable way.
By running this server alongside a model orchestration layer (or exposing it to a model runtime that supports MCP), you can build AI agents that read spreadsheet ranges, summarize or edit documents, and post messages into chats or groups — all with proper authentication and permission handling. The server abstracts the Feishu/Lark APIs and maps them to MCP-style tool endpoints so models and orchestration layers have a consistent interface for context operations.
Features
- Exposes Lark Sheets, Docs, and Messaging as MCP-compatible tools
- OAuth/tenant token management to authenticate against Lark/Feishu API
- Endpoints to read/write Sheets ranges, fetch and edit Docs, and send messages
- Webhook or callback support for events (optional)
- Docker-ready and configurable with environment variables
- Simple manifest describing available tools for model integrations
Installation / Configuration
Prerequisites:
- Node.js (>= 16) or Docker
- A Lark/Feishu app with app_id and app_secret (for tenant access tokens)
Clone and install:
# If the project uses npm
# Or if using yarn
Create a .env with your credentials (example):
PORT=3000
LARK_APP_ID=cli_a1b2c3d4e5f6g7
LARK_APP_SECRET=your_app_secret_here
LARK_VERIFICATION_TOKEN=optional_verification_token
LARK_ENCRYPT_KEY=optional_encrypt_key
MCP_BASE_URL=https://your-server.example.com
Start the server:
# or for development
Run with Docker:
# Build
# Run
Configuration notes:
- Provide the Lark app_id and app_secret so the server can obtain tenant_access_tokens.
- If using event-driven features, configure LARK_VERIFICATION_TOKEN and LARK_ENCRYPT_KEY per Feishu webhook docs.
- Set MCP_BASE_URL to the externally reachable URL so manifest links are correct.
Available Resources
This server exposes a manifest and a set of tool endpoints that map to Lark features. Typical endpoints include:
- GET /mcp/manifest — MCP manifest describing tools and capabilities
- POST /tools/sheets/read — Read a range from a Sheet
- POST /tools/sheets/write — Write values to a Sheet range
- POST /tools/docs/get — Fetch document content or structured blocks
- POST /tools/docs/update — Apply edits to a Doc
- POST /tools/messages/send — Send a message to a chat or user
- POST /webhooks/events — (Optional) receive Lark event callbacks
Example tool table:
| Tool | Purpose | Typical Inputs |
|---|---|---|
| sheets | Read/write spreadsheet ranges | sheet_id, range, values |
| docs | Fetch/update document content | doc_id, query, delta edits |
| messages | Send chat messages or cards | chat_id, open_id, content |
All tool endpoints authenticate requests coming from your orchestration layer; the server handles exchanging your app credentials for tenant tokens when calling Lark APIs.
Use Cases
- Auto-summarize weekly report (Sheets → Doc → Message)
- A model reads a “Weekly metrics” sheet range via POST /tools/sheets/read.
- The model synthesizes a summary and writes a summary doc via POST /tools/docs/update.
- A concise summary card is posted to a team chat via POST /tools/messages/send.
- Collaborative document drafting
- An assistant fetches the current doc blocks with POST /tools/docs/get, proposes edits, and submits structured updates with POST /tools/docs/update. Edits are auditable because they go through the MCP tool interface.
- Data-driven notifications
- A scheduler queries Sheets periodically (POST /tools/sheets/read). If thresholds are exceeded, the server (or model workflow) composes an explanation and sends it to a group as a message or card (POST /tools/messages/send), including links back to the source doc or sheet.
Example Requests
Fetch an MCP manifest:
Read a sheet range (example):
Send a message (example):
Next Steps
- Register the server manifest with your model orchestration layer so tools are discoverable.
- Secure the server endpoint (TLS, IP allowlists) before exposing it to public model runtimes.
- Extend or customize tool mappings to support additional Lark APIs (calendar, contacts, etc.).
Repository and source code: https://github.com/kone