LINE MCP Server Experimental Preview Release
Try the MCP server experimental preview for testing and feedback; functionality may be incomplete and support is limited.
npx -y @line/line-bot-mcp-serverOverview
This MCP (Model Context Protocol) server connects an AI Agent to a LINE Official Account by exposing LINE Messaging API operations as MCP tools. It lets an agent push messages, broadcast content, manage rich menus, and query user/profile information programmatically from within an agent environment. The server is provided as an experimental preview — it is intended for testing and feedback and may not include full functionality or production-grade support.
The implementation is useful when you want an LLM-based assistant to interact with LINE users (for example, sending proactive notifications, replying with rich Flex messages, or looking up profile details) without writing direct Messaging API code inside the agent itself. The server exposes a concise set of tools that map to common LINE operations, simplifying integration with agents such as Claude Desktop or Cline.
Features
- Push text and Flex messages to individual users
- Broadcast text and Flex messages to all followers
- Retrieve user profile and follower IDs
- Query message quota and consumption for an account
- Create, set, cancel, list and delete rich menus (including image upload)
- Experimental preview release: functionality and support are limited
- Works as an MCP server process that your AI agent can call as a tool
Installation / Configuration
Requirements:
- Node.js v20 or later
Install and run via npx (recommended for quick testing). Example configuration for an AI Agent’s MCP server declaration:
Set required environment variables before starting the MCP server:
# Optional default recipient (used when a tool call omits userId)
Start the server (example):
The server process accepts tool invocation payloads according to the MCP specification. Configure your agent to include the MCP server entry shown above.
Available Tools / Resources
The MCP server exposes the following tools (summaries):
push_text_message
- Push a plain text message to a user.
- Inputs: userId (optional if DESTINATION_USER_ID set), message.text (string)
push_flex_message
- Push a Flex message to a user.
- Inputs: userId (optional), message.altText (string), message.contents (JSON), message.contents.type (bubble | carousel)
broadcast_text_message
- Broadcast a plain text message to all followers.
- Inputs: message.text (string)
broadcast_flex_message
- Broadcast a Flex message to all followers.
- Inputs: message.altText (string), message.contents (JSON), message.contents.type
get_profile
- Retrieve a LINE user’s profile (display name, picture URL, status message, language).
- Inputs: userId (optional)
get_message_quota
- Return monthly message quota and current usage.
get_rich_menu_list
- List rich menus associated with the account.
delete_rich_menu
- Delete a rich menu by ID.
- Inputs: richMenuId (string)
set_rich_menu_default
- Set a rich menu as the default.
- Inputs: richMenuId (string)
cancel_rich_menu_default
- Cancel the current default rich menu.
create_rich_menu
- Create/upload/set a rich menu using provided actions (1–6 actions).
- Inputs: chatBarText (string), actions (array)
- Supported action types include: postback, message, uri, datetimepicker, camera, cameraRoll, location, richmenuswitch, clipboard
get_follower_ids
- Fetch follower user IDs with pagination.
- Inputs: start (continuation token), limit (max items)
Tool Input Reference (condensed)
| Tool | Key Inputs |
|---|---|
| push_text_message | userId, message.text |
| push_flex_message | userId, message.altText, message.contents |
| broadcast_text_message | message.text |
| get_profile | userId |
| create_rich_menu | chatBarText, actions[] |
| get_follower_ids | start, limit |
Use Cases
Proactive notifications: An AI agent detects an important event (e.g., ticket update) and calls push_text_message to notify the affected user on LINE.
- Example: agent calls push_text_message with message.text = “Your invoice is ready.”
Rich conversational responses: An agent composes multi-component content and sends it as a Flex message via push_flex_message to display buttons, images and structured text.
- Example: send a product card carousel built as Flex JSON.
Broadcasting announcements: When you need to notify all followers about a maintenance window or new feature, the agent uses broadcast_text_message or broadcast_flex_message.
Profile-aware interactions: Agent queries get_profile to customize responses (greeting by display name or adapting language).
Rich menu automation: Agent creates a context-specific menu for users (create_rich_menu) and sets it as default or switches menus based on user state.
Notes and Limitations
- This is an experimental preview. Expect incomplete features and limited support. Use for testing and feedback only.
- Ensure you comply with LINE Messaging API quotas and messaging policies when sending broadcasts or high-volume messages.
- For full API details and to obtain required tokens, refer to LINE developers documentation and the repository README on GitHub: https://github.com/line/line-bot-mcp-server
For questions or to report issues, open an issue on the GitHub repository.