# LINE — how to use (mcp.ai)

Connect your LINE account and use 13 tools for communication straight from your AI agent. Connect with your own API key. Use a LINE Official Account's Messaging API channel to manage messages, audiences, and rich menus.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_line?ms=1787291520000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `line_create_rich_menu`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/line`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/line/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/line/create/rich/menu` — Create a rich-menu definition and return its ID. Creation alone does not display it: upload an image, then set it as default or link it to a user.
  - body: { name: string, size: object, areas: object[], selected: boolean, chat_bar_text: string }
- `POST https://api.mcp.ai/api/line/create/rich/menu/with/image` — Create a rich-menu definition and upload its JPEG or PNG image in one call. If image upload fails, the newly created definition is deleted automatically. The finished menu must still be set as default
  - body: { name: string, size: object, areas: object[], image: object, selected: boolean, chat_bar_text: string }
- `POST https://api.mcp.ai/api/line/delete/rich/menu` — Permanently delete a rich menu by ID. Delete only a menu the caller owns or explicitly intends to remove.
  - body: { rich_menu_id: string }
- `POST https://api.mcp.ai/api/line/download/message/content/preview` — Download LINE's reduced-size preview image for a retained image or video message whose contentProvider.type is line.
  - body: { message_id: string }
- `POST https://api.mcp.ai/api/line/get/message/delivery/count` — Get the number of reply, push, multicast, or broadcast messages sent on one UTC+9 calendar date. A result can be unready, unavailable_for_privacy, or out_of_service instead of containing a count.
  - body: { date: string, message_type: string }
- `POST https://api.mcp.ai/api/line/get/rich/menu` — Get one Messaging API rich-menu definition by ID, including its canvas, tappable areas, and actions.
  - body: { rich_menu_id: string }
- `POST https://api.mcp.ai/api/line/link/or/unlink/user/rich/menu` — Link or unlink a per-user rich menu. WARNING: LINE can return HTTP 200 even when nothing changed for a nonexistent, deleted, blocked, non-friend, or cross-channel user; success confirms request accept
  - body: { user_id: string, operation: string, rich_menu_id?: string }
- `POST https://api.mcp.ai/api/line/list/chat/member/ids` — Return one page of member user IDs for a group or legacy room containing the bot. Requires a verified or premium LINE Official Account; room applies only to legacy multi-person chats.
  - body: { chat_id: string, chat_type: string, next_cursor?: string }
- `POST https://api.mcp.ai/api/line/list/follower/ids` — Return one page of user IDs for friends of the LINE Official Account. This endpoint requires a verified or premium LINE Official Account and excludes blockers, deleted users, and users without profile
  - body: { limit?: integer, next_cursor?: string }
- `POST https://api.mcp.ai/api/line/list/rich/menus` — List all rich menus created through the Messaging API. Menus created in LINE Official Account Manager are not included.
- `POST https://api.mcp.ai/api/line/mark/messages/as/read` — Mark all messages through a webhook-issued read token as read. The token must have been received by this exact bot; this operation cannot be undone.
  - body: { mark_as_read_token: string }
- `POST https://api.mcp.ai/api/line/set/or/clear/default/rich/menu` — Set or clear the Messaging API default rich menu. Setting requires an image-backed rich menu; clearing does not delete the menu and does not clear a default managed in LINE Official Account Manager.
  - body: { operation: string, rich_menu_id?: string }
- `POST https://api.mcp.ai/api/line/upload/rich/menu/image` — Upload a JPEG or PNG image for a rich menu. An image cannot be replaced for the same rich-menu ID; create a new menu to use another image.
  - body: { image: object, rich_menu_id: string }

## Example prompts
- "What can I do in LINE?"
- "Show me a summary of my LINE account"

## More
- Page: https://mcp.ai/line
- Agent spec (llms.txt): https://mcp.ai/line/llms.txt
- Postman collection: https://mcp.ai/line/postman.json
