Feishu App Setup Guide¶
Step-by-step procedure to configure a Feishu bot for MetaBot.
Step 1: Create the App¶
- Go to 飞书开放平台开发者控制台: open.feishu.cn/app
- Click "Create Custom App"
- Fill in:
- Name: e.g. "Claude Code"
- Description: e.g. "Feishu to Claude Code bridge bot"
- Icon: Pick any icon and color
- Click Create
Step 2: Record Credentials¶
- In the app dashboard, go to Credentials & Basic Info (left sidebar)
- Copy the App ID (e.g.
cli_xxxx) and App Secret - These go into
.envasFEISHU_APP_IDandFEISHU_APP_SECRET, or intobots.json
Step 3: Add Bot Capability¶
- Go to Add Features (left sidebar under Features)
- Find Bot and click "+ Add"
- This enables the bot feature and adds a "Bot" menu in the sidebar
Step 4: Configure Permissions¶
- Go to Permissions & Scopes (left sidebar under Development Configuration)
- Click "Add permission scopes to app" (blue button)
- In the popup dialog, search for and add these scopes:
im:message— Read and send messages in private and group chatsim:message:readonly— Read messages in private and group chatsim:resource— Upload images and files (needed to send output files back to chat)im:chat:readonly— Read chat info (needed for 2-member group detection)
- Click "Add Scopes"
Optional permissions for advanced features
For wiki sync and document reading, also add:
docx:document:readonly— Read Feishu documentswiki:wiki— Read/write wiki pagesdocx:document— Create/edit documents (for wiki sync)drive:drive— Access drive files
Step 5: Configure Events¶
Service must be running
The subscription mode "persistent connection" requires the bot service to be running when you save. Start the service first (npm run dev), then configure this step.
- Go to Events & Callbacks (left sidebar)
- Click the edit icon next to Subscription mode
- Select "Receive events through persistent connection" (Recommended)
- Click Save — Feishu will validate the WebSocket connection
- Click "Add Events" (now enabled)
- Search for
im.message.receive - Check "Message received" (
im.message.receive_v1) - Click Confirm
- When prompted for suggested scopes, click "Add Scopes"
Step 6: Publish the App¶
- Click "Create Version" in the top banner (or go to Version Management & Release)
- Fill in:
- App version: e.g. "1.0.0"
- Update Notes: e.g. "Initial release"
- Default features should be "Bot" for both mobile and desktop
- Click Save, then Publish in the confirmation dialog
- If the org allows auto-approval for small apps, it goes live instantly
Step 7: Test¶
- Open Feishu Messenger
- Search for your bot name (e.g. "Claude Code")
- Send a test message
- The bot should respond with a streaming card showing Claude's response