A custom integration for Home Assistant that integrates LINE Bot with the Model Context Protocol (MCP).
- 🤖 Full LINE Bot Support — Receive and send various LINE message types.
- 🧠 MCP Server — Let AI assistants (Claude, ChatGPT) control your LINE Bot directly.
- 🏠 Home Assistant Native Integration — Offers services and sensors.
- 📱 Rich Message Types — Text, image, video, audio, location, sticker, Flex, and more.
- 🔄 Smart Auto Reply — Integrates conversation agents for intelligent replies.
- 📊 Real-Time Monitoring — Track bot status and quota usage.
Warning
Auto reply is currently an experimental feature and may not always work as expected.
- Home Assistant 2025.7.0 or later
- A LINE Developers account
Using HACS (recommended):
- Go to LINE Developers Console
- Create a Messaging API Channel
- Copy your Channel Access Token and Channel Secret
- In Home Assistant, add the "LINE Bot MCP" integration
- Provide your Bot ID, Channel Access Token, and Channel Secret
- Go to the attributes of the bot info sensor to view the Webhook endpoint
- Enter the Webhook URL in the LINE Developer Console
# Send a text message
service: notify.linebot_push_message
data:
name: "@bot123"
to: "U1234567890abcdef1234567890abcdef"
messages:
- type: "text"
text: "Hello from Home Assistant!"
# Reply to a message
service: notify.linebot_reply_message
data:
name: "@bot123"
reply_token: "{{ trigger.event.data.reply_token }}"
messages:
- type: "text"
text: "Got your message!"automation:
- alias: "LINE Bot Reply"
trigger:
platform: event
event_type: linebot_@bot123_message_received
action:
service: notify.linebot_reply_message
data:
name: "@bot123"
reply_token: "{{ trigger.event.data.reply_token }}"
messages:
- type: "text"
text: "Hello! This is the Home Assistant LINE Bot"Available tools for AI assistants:
push_message— Send a messagereply_message— Reply to a messageget_quota— Get usage quota
MCP SSE Endpoint:
http://your-ha-url:8123/linebotmcp/sse
| Type | Description | Example |
|---|---|---|
| text | Plain text message | {"type": "text", "text": "Hello"} |
| textV2 | Text with mentions/emojis | Includes mentions and emojis |
| image | Image message | Requires image and preview URLs |
| video | Video message | Requires video and preview URLs |
| audio | Audio message | Requires audio URL and duration |
| location | Location message | Includes coordinates and address |
| sticker | Sticker message | Requires package ID and sticker ID |
| flex | Flex message | Custom layout design |
| imagemap | Imagemap message | Image map with actions |
| template | Template message | Buttons and text layout |
- Agent ID — Specify which conversation agent to use (default:
conversation.google_generative_ai) - Auto Reply — Enable or disable automatic responses
This integration emits the following events:
linebot_mcp_{bot_name}_message_received— When a message is receivedlinebot_mcp_{bot_name}_postback— When a postback is received
Events include the user ID, message content, reply token, and other metadata.
Webhook not receiving messages:
- Check the webhook URL configuration
- Ensure Home Assistant is accessible from the internet
- Verify the Channel Secret
MCP connection failed:
- Check your network connection
- Check Home Assistant logs
Failed to send messages:
- Verify Channel Access Token
- Ensure message format is correct
- Confirm the recipient's user ID
logger:
default: warning
logs:
linebot_mcp: debugThe MCP server part was developed with reference to homeassistant-mcp-server.