{
  "markdown": "# Feishu\n\n[中文文档](./README.zh-CN.md)\n\nConnect a Feishu bot to Claude Code with an MCP server.\n\nWhen the bot receives a message, the MCP server forwards it to Claude and provides tools to reply, react, and edit messages.\n\n## Prerequisites\n\n- [Bun](https://bun.sh) — the MCP server runs on Bun. Install with `curl -fsSL https://bun.sh/install | bash`\n\n## Quick Setup\n> Default pairing flow for a single-user DM bot. See [ACCESS.md](./ACCESS.md) for groups and multi-user setups.\n\n**1. Create a Feishu app and bot**\n\nGo to the [Feishu Open Platform](https://open.feishu.cn) (or [Lark Developer](https://open.larksuite.com) for the international version) and create a custom app.\n\nNavigate to **Add App Capabilities** and enable **Bot**.\n\n**2. Configure event subscriptions**\n\nGo to **Event Subscriptions** → **Event Configuration** and add the event `im.message.receive_v1` (receive messages).\n\nSelect **Long Connection** (WebSocket) as the subscription method — the bot connects outbound, no public IP required.\n\n**3. Enable permissions**\n\nGo to **Permissions & Scopes** and enable the following:\n\n- `im:message` — read messages\n- `im:message:send_as_bot` — send messages as bot\n- `im:resource` — access message resources (files, images)\n- `im:chat` — access chat info\n- `im:message.reactions:write_only` — add emoji reactions\n\n**4. Get credentials**\n\nGo to **Credentials & Basic Info** and copy the **App ID** and **App Secret**.\n\n**5. Publish the app**\n\nSubmit the app for review and get it approved by a tenant admin. You can use a test enterprise for development.\n\n**6. Install the plugin**\n\nThe following are Claude Code commands — start a session with `claude` first.\n\nAdd the marketplace, then install the plugin:\n```\n/plugin marketplace add ezagent42/ezagent42\n/plugin install feishu@ezagent42\n```\n\n**7. Configure credentials**\n\n```\n/feishu:configure cli_xxxx your_app_secret\n```\n\nThis writes `FEISHU_APP_ID=...` and `FEISHU_APP_SECRET=...` to `~/.claude/channels/feishu/.env`.\n\nFor Lark international, add the `--lark` flag:\n```\n/feishu:configure cli_xxxx your_app_secret --lark\n```\n\n**8. Restart with channel flag**\n\nExit the current session and restart with:\n\n```sh\nclaude --dangerously-load-development-channels plugin:feishu@ezagent42\n```\n\n> **Note:** The Feishu channel is not yet on the Claude Code official approved channels allowlist. You must use the `--dangerously-load-development-channels` flag to start. This flag only bypasses the allowlist check and does not skip other security checks.\n\n**9. Pair**\n\nAfter starting Claude Code, DM your bot on Feishu — it will reply with a pairing code. In the Claude Code session, run:\n\n```\n/feishu:access pair <code>\n```\n\nYour DM messages will now be forwarded to Claude.\n\n**10. Lock down access**\n\nPairing is only used to obtain your ID. After pairing, switch to `allowlist` mode to prevent strangers from triggering pairing. Ask Claude to do it, or run `/feishu:access policy allowlist` directly.\n\n## Access Control\n\nSee **[ACCESS.md](./ACCESS.md)** — covers DM policies, group chats, mention detection, delivery configuration, skill commands, and the `access.json` structure.\n\nQuick reference: IDs use the Feishu **open_id** format (e.g. `ou_xxxx`). Default policy is `pairing`; group chats must be enabled per chat_id.\n\n## Tools Available to Claude\n\n| Tool | Purpose |\n| --- | --- |\n| `reply` | Send a message to a chat. Params: `chat_id` + `text`, optional `reply_to` (message ID for quote-reply) and `files` (absolute paths for attachments) — up to 10 files, 25MB each. Auto-chunked; images and files sent as separate messages. Returns sent message ID. |\n| `react` | Add an emoji reaction to a message. Uses Feishu emoji_type strings like `THUMBSUP`, not Unicode. |\n| `edit_message` | Edit a message previously sent by the bot. Useful for \"processing...\" → result progress updates. Only works on bot's own text/rich-text messages. |\n| `fetch_messages` | Fetch recent chat history (chronological order). Up to 50 messages per call. Each line includes a message ID usable for `reply_to`. |\n| `download_attachment` | Download attachments from a message to `~/.claude/channels/feishu/inbox/`. Returns file path and metadata. Use when `fetch_messages` shows a message has attachments. |\n\n## Attachments\n\nAttachments are **not** downloaded automatically. The `<channel>` notification lists each attachment's name and type — Claude calls `download_attachment(chat_id, message_id)` to fetch them on demand. Files are saved to `~/.claude/channels/feishu/inbox/`.\n\n## Lark International\n\nSet `FEISHU_DOMAIN=https://open.larksuite.com` in `~/.claude/channels/feishu/.env`, or use the `--lark` flag during configuration:\n\n```\n/feishu:configure cli_xxxx your_app_secret --lark\n```\n\n",
  "bytes": 4732,
  "sha": "15f5f3a4b601867495ee6c8b41ae0bf505560cb61d84772ebbd1970e872539d8",
  "repo_slug": "ezagent42/feishu-claude-code-channel",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_ezagent42_feishu_claude_code_channel_fei_ad3b1e61/readme"
}