lark-mcp
Original:🇨🇳 Chinese
Translated
Integrate Feishu services to operate Bitable, documents, messages, groups, etc. Use this when users mention Feishu, Lark or need to operate Feishu-related functions.
20installs
Sourcewhatevertogo/feishuskill
Added on
NPX Install
npx skill4agent add whatevertogo/feishuskill lark-mcpTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →Lark MCP (Feishu Integration)
⚠️ Must-read: Top 5 Key Rules + Important Experiences
Important Experience: Create Resources Using User Identity
yaml
# ⭐ Key: Use useUAT: true to create resources accessible by users
useUAT: true # ✅ User identity - Creator = current user, you can access directly
useUAT: false # ❌ Tenant identity - Creator = Feishu Assistant, you cannot access directlyExperience Summary (From Actual Testing):
- Bitable Creation Permission Issue - Bases created with useUAT: false have "Feishu Assistant" as the creator, and the current user cannot access them
- External Email Permission Restriction - Adding external email permissions via API will fail (error code 1063001)
- Solution - Create resources using useUAT: true, and the creator automatically gets full_access permission
- Document Permissions - The same applies, create documents using user identity
1. Server Name Must Be Exact
bash
✅ mcp__lark-mcp__tool_name
❌ mcp__lark_mcp__ (Error: underscore)
❌ lark-mcp__ (Error: missing prefix)2. Nested Parameter Structure
yaml
path: # URL path parameters (required)
app_token: ...
table_id: ...
params: # URL query parameters (optional)
user_id_type: "open_id"
data: # Request body (optional)
fields: {...}
useUAT: false # Use tenant token by default3. Message content Must Be a String
bash
❌ content: {"text": "hello"}
✅ content: '{"text": "hello"}'4. Filter Condition value Must Be an Array
bash
❌ value: "Completed"
✅ value: ["Completed"]5. ID Types Cannot Be Confused
open_id - User ID (recommended)
chat_id - Group chat ID
app_token - Bitable app ID
table_id - Table ID
record_id - Record IDQuick Start
Example 1: Query Bitable Records
yaml
Tool: mcp__lark-mcp__bitable_v1_appTableRecord_search
path:
app_token: "your_app_token" # Replace with actual Base app ID (obtained from URL)
table_id: "your_table_id" # Replace with actual table ID (obtained from URL)
params:
page_size: 20
data:
filter:
conjunction: "and"
conditions:
- field_name: "Status"
operator: "is"
value: ["Completed"]Example 2: Send Text Message to Group
yaml
Tool: mcp__lark-mcp__im_v1_message_create
data:
receive_id: "oc_xxxxx" # Replace with actual group chat_id
msg_type: "text"
content: '{"text": "Message content"}'
params:
receive_id_type: "chat_id"Example 3: Search Documents
yaml
Tool: mcp__lark-mcp__docx_builtin_search
data:
search_key: "Keywords"
count: 10
useUAT: trueTool Categories
Bitable
- - Create Base app
bitable_v1_app_create - - List all tables
bitable_v1_appTable_list - - Create new table
bitable_v1_appTable_create - - Get field list
bitable_v1_appTableField_list - - Query records
bitable_v1_appTableRecord_search - - Create records
bitable_v1_appTableRecord_create - - Update records
bitable_v1_appTableRecord_update
Detailed Guide: reference/bitable.md
Messages
- - Send messages
im_v1_message_create - - Get chat history
im_v1_message_list - - Create groups
im_v1_chat_create - - Get group list
im_v1_chat_list - - Get group members
im_v1_chatMembers_get
Detailed Guide: reference/messages.md
Documents
- - Search documents
docx_builtin_search - - Import documents
docx_builtin_import - - Get document content
docx_v1_document_rawContent
Detailed Guide: reference/documents.md
Groups
- - Create groups
im_v1_chat_create - - Get member list
im_v1_chatMembers_get - - Get group list
im_v1_chat_list
Detailed Guide: reference/groups.md
Permissions
- - Add collaborator permissions
drive_v1_permissionMember_create
Detailed Guide: reference/permissions.md
Contacts
- - Get user ID via email/phone number
contact_v3_user_batchGetId
Wiki
- - Search Wiki nodes
wiki_v1_node_search - - Get node information
wiki_v2_space_getNode
Authentication Instructions
Token Types
- useUAT: true - User access token (user operations)
- useUAT: false - Tenant access token (backend operations, default)
Obtain IDs
Obtain from URL:
https://xxx.feishu.cn/base/appxxxxx?table=tblxxxxx
↑app_token ↑table_idGet user open_id:
yaml
Tool: mcp__lark-mcp__contact_v3_user_batchGetId
data:
emails: ["user@example.com"] # Replace with actual user email
params:
user_id_type: "open_id"user_id_type Parameter
Always use (most universal, recommended).
"open_id"Optional values: | |
"open_id""union_id""user_id"Core Workflows
Workflow 1: Create Bitable and Add Records (User-accessible Version)
Task Progress:
- [ ] Step 1: Create Base app (⭐ useUAT: true)
- [ ] Step 2: Create table and fields
- [ ] Step 3: Insert records
- [ ] Step 4: Verify dataStep 1: Create Base app
yaml
Tool: mcp__lark-mcp__bitable_v1_app_create
data:
name: "Project Management" # Can be modified to your required name
time_zone: "Asia/Shanghai"
useUAT: true # ⭐ Important: Use user identity to ensure direct accessStep 2: Create Table and Fields
yaml
Tool: mcp__lark-mcp__bitable_v1_appTable_create
path:
app_token: "bascnxxxxxx" # Replace with actual app_token returned from Step 1
data:
table:
name: "Table Name"
default_view_name: "Default View"
fields:
- field_name: "Name"
ui_type: "Text"
- field_name: "Age"
ui_type: "Number"
- field_name: "Status"
ui_type: "SingleSelect"
property:
options:
- name: "In Progress"
- name: "Completed"Note: After successful creation, the response will return , save it for the next step.
table_idStep 3: Insert Records
yaml
Tool: mcp__lark-mcp__bitable_v1_appTableRecord_create
path:
app_token: "bascnxxxxxx" # Replace with actual value returned from Step 1
table_id: "tblxxxxxx" # Replace with actual value returned from Step 2
data:
fields:
Name: "Zhang San"
Age: 25
Status: "In Progress"Step 4: Verify Data
yaml
Tool: mcp__lark-mcp__bitable_v1_appTableRecord_search
path:
app_token: "bascnxxxxxx" # Replace with actual app_token
table_id: "tblxxxxxx" # Replace with actual table_id
params:
page_size: 10Workflow 2: Query Table and Send Messages
Task Progress:
- [ ] Step 1: Query table data
- [ ] Step 2: Process query results
- [ ] Step 3: Construct message
- [ ] Step 4: Send to groupStep 1: Query Data
yaml
Tool: mcp__lark-mcp__bitable_v1_appTableRecord_search
path:
app_token: "bascnxxxxxx" # Replace with actual app_token
table_id: "tblxxxxxx" # Replace with actual table_id
params:
page_size: 10
data:
filter:
conjunction: "and"
conditions:
- field_name: "Status"
operator: "is"
value: ["Pending"]Step 2: Process Query Results
After successful query, the response contains the array, each item includes the record's .
data.itemsfieldsyaml
# Example Response Structure
data:
items:
- record_id: "recxxxx"
fields:
Task Name: "Complete Document"
Status: "Pending"Step 3: Construct Message
Construct message content based on query results:
yaml
# Example: Construct text message
message = "Found " + items.length + " pending tasks:\n"
for each item in items:
message += "- " + item.fields["Task Name"] + "\n"Step 4: Send Message
yaml
Tool: mcp__lark-mcp__im_v1_message_create
data:
receive_id: "oc_xxxxx" # Replace with actual group chat_id
msg_type: "text"
content: '{"text": "Processing results: ..."}'
params:
receive_id_type: "chat_id"Workflow 3: Search Documents and Get Content
Task Progress:
- [ ] Step 1: Search documents
- [ ] Step 2: Get document_id
- [ ] Step 3: Extract document content
- [ ] Step 4: Process textStep 1: Search
yaml
Tool: mcp__lark-mcp__docx_builtin_search
data:
search_key: "Project Report"
count: 10
useUAT: trueStep 2: Get document_id
After successful search, extract the of the first document from the response:
document_idyaml
# Example Response Structure
data:
items:
- document_id: "doxcnxxxxxx" # ← Save this
title: "Project Report"
...Step 3: Get Content
yaml
Tool: mcp__lark-mcp__docx_v1_document_rawContent
path:
document_id: "doxcnxxxxxx" # Replace with actual document_id obtained from Step 2
params:
lang: 0
useUAT: trueCommon Error Troubleshooting
Error 1: "tool not found"
Cause: Incorrect server name spelling
Solution: Ensure to use the prefix (note the hyphens)
mcp__lark-mcp__Error 2: "invalid request"
Cause: Incorrect parameter nesting
Solution: Check the path/params/data hierarchy; path parameters are usually required
Error 3: "field not found"
Cause: Incorrect field name or wrong ID type
Solution:
- Confirm that exactly matches the table field name
field_name - Confirm using the correct ID type (app_token vs table_id)
Error 4: "permission denied"
Cause: Insufficient permissions or wrong token type
Solution:
- Check if the app has access permissions for the resource
- Use for user operations
useUAT: true - Use for backend operations
useUAT: false
Error 5: Message Sending Failed
Cause: Incorrect content format or wrong receive_id_type
Solution:
- content must be a JSON string, not an object
- Use for sending to groups
receive_id_type: "chat_id" - Use for sending to users
receive_id_type: "open_id"
Parameter Verification Checklist
Check before use:
- Server name:
mcp__lark-mcp__tool_name - path parameters are required and correct (app_token, table_id, record_id, etc.)
- content is a JSON string (for message-related operations)
- value is an array (for filter conditions)
- Enumeration values match exactly (user_id_type, operator, etc.)
- Correct ID type (open_id vs chat_id vs app_token)
- useUAT is set correctly (true for users, false for backend)
Issues Encountered in Practice
Issue 1: Created Base Is Inaccessible
Phenomenon:
- Create Base app with
useUAT: false - Creator shows as "Feishu Assistant"
- Current user cannot access directly due to permission restrictions
Solution:
yaml
useUAT: true # ✅ User identity - Creator = current user, accessible directly
useUAT: false # ❌ Tenant identity - Requires additional permission settingsIssue 2: API Permission Addition Failed
Phenomenon:
- Add email permissions via
drive_v1_permissionMember_create - Error code: 1063001 (Invalid parameter)
- Cannot grant external users access via API
Root Cause:
- Resources created with tenant identity have restrictions on API permission additions
- External email permissions may not be supported via API operations
Best Practice:
- Prioritize creating resources using user identity ()
useUAT: true - The creator automatically gets permission
full_access - Avoid complex permission configurations later
Issue 3: Field Type Mismatch
Phenomenon:
- "field not found" when querying Bitable
- Used wrong field ID type
Solution:
yaml
# Get correct IDs from URL (appxxxxx and tblxxxxx are placeholders to replace)
https://xxx.feishu.cn/base/appxxxxx?table=tblxxxxx
↑app_token ↑table_id
# Get field list to confirm field names before querying
Tool: mcp__lark-mcp__bitable_v1_appTableField_listIssue 4: Group Owner Identity Problem
Phenomenon:
- Create groups with
useUAT: true - Creator still shows as app robot (app_id)
- Message sender is "app", not "user"
sender_type
Root Cause:
- only uses user permissions/tokens for operations
useUAT: true - The system-recorded "creator" is always the app itself
- This is a design mechanism of Feishu API
Solution:
yaml
# Must explicitly specify owner_id
Tool: mcp__lark-mcp__im_v1_chat_create
data:
owner_id: "ou_xxxxx" # Specify user as group owner
user_id_list: ["ou_xxxxx"]Note: If is not specified, the group owner defaults to the app robot.
owner_idReference Documents
- Bitable Operation Guide
- Message Sending Guide
- Document Operation Guide
- Group Management Guide
- Permission Management Guide
- Bitable Query Examples
- Message Format Examples