# Configure Feishu

MOI connects to a Feishu app bot through a managed, long-lived connection. Prepare and publish an app on the Feishu Open Platform, then enter its **App ID** and **App Secret** in MOI. No public domain, callback URL, or tool instance is required.

Console menu locations can change. Use the current Feishu interface to find the capabilities and credentials described below.

## 1. Prepare a Feishu app

1. Open the [Feishu Open Platform](https://open.feishu.cn/app), create a custom enterprise app, and enable its bot capability.
2. Under **Events & Callbacks**, select the option to receive events through a long-lived connection.
3. Subscribe to the receive-message event, `im.message.receive_v1`.
4. Publish the app and make it available to the people who will use the agent.

## 2. Configure the connection in MOI

1. Open the target agent card's **⋯** menu and select **Two-way messaging**.
2. Select **Feishu App Bot**. If a receiving-method selector is shown, choose **Long-lived connection**.
3. Enter **App ID** and **App Secret**. App Secret is required for a new connection. When editing an existing connection, leave it blank to keep its current value, or enter a new value and save to replace it.
4. Select a **Runtime model**.
5. Click **Save and continue** to start connecting.

## 3. Test the connection

1. In MOI, check for **Configuration saved** and **MOI receiving enabled**, then wait for **Connection established**.
2. Send the bot a direct message in Feishu, or add it to a test group and mention it in a message.
3. Confirm **Real message received** in MOI, then confirm that the agent replies in the original Feishu conversation.

**Real message received** confirms incoming-message reception only. If no reply arrives, check the runtime model and the execution result in the corresponding MOI conversation. See [Connection status and troubleshooting](troubleshoot.md).

## Next steps

- [Use a connected agent](usage.md)
- [Connection status and troubleshooting](troubleshoot.md)
