日本語版 READMEはこちら Model Context Protocol (MCP) server implementation that integrates the LINE Messaging API to connect an AI Agent to the LINE Official Account. 1. pushtextmessage - Push a simple text message to a user via LINE. - userId (string?): The user ID to receive a message. Defaults to DESTINATIONUSERID. Either userId or DESTINATIONUSERID must be set. - message.text (string): The plain text
Add this skill
npx mdskills install line/line-bot-mcp-serverComprehensive MCP server with 11 well-documented LINE messaging tools and clear setup instructions
1[日本語版 READMEはこちら](README.ja.md)23# LINE Bot MCP Server45[](https://www.npmjs.com/package/@line/line-bot-mcp-server)67[Model Context Protocol (MCP)](https://github.com/modelcontextprotocol) server implementation that integrates the LINE Messaging API to connect an AI Agent to the LINE Official Account.891011> [!NOTE]12> This repository is provided as a preview version. While we offer it for experimental purposes, please be aware that it may not include complete functionality or comprehensive support.1314## Tools15161. **push_text_message**17 - Push a simple text message to a user via LINE.18 - **Inputs:**19 - `userId` (string?): The user ID to receive a message. Defaults to DESTINATION_USER_ID. Either `userId` or `DESTINATION_USER_ID` must be set.20 - `message.text` (string): The plain text content to send to the user.212. **push_flex_message**22 - Push a highly customizable flex message to a user via LINE.23 - **Inputs:**24 - `userId` (string?): The user ID to receive a message. Defaults to DESTINATION_USER_ID. Either `userId` or `DESTINATION_USER_ID` must be set.25 - `message.altText` (string): Alternative text shown when flex message cannot be displayed.26 - `message.contents` (any): The contents of the flex message. This is a JSON object that defines the layout and components of the message.27 - `message.contents.type` (enum): Type of the container. 'bubble' for single container, 'carousel' for multiple swipeable bubbles.283. **broadcast_text_message**29 - Broadcast a simple text message via LINE to all users who have followed your LINE Official Account.30 - **Inputs:**31 - `message.text` (string): The plain text content to send to the users.324. **broadcast_flex_message**33 - Broadcast a highly customizable flex message via LINE to all users who have added your LINE Official Account.34 - **Inputs:**35 - `message.altText` (string): Alternative text shown when flex message cannot be displayed.36 - `message.contents` (any): The contents of the flex message. This is a JSON object that defines the layout and components of the message.37 - `message.contents.type` (enum): Type of the container. 'bubble' for single container, 'carousel' for multiple swipeable bubbles.385. **get_profile**39 - Get detailed profile information of a LINE user including display name, profile picture URL, status message and language.40 - **Inputs:**41 - `userId` (string?): The ID of the user whose profile you want to retrieve. Defaults to DESTINATION_USER_ID.426. **get_message_quota**43 - Get the message quota and consumption of the LINE Official Account. This shows the monthly message limit and current usage.44 - **Inputs:**45 - None467. **get_rich_menu_list**47 - Get the list of rich menus associated with your LINE Official Account.48 - **Inputs:**49 - None508. **delete_rich_menu**51 - Delete a rich menu from your LINE Official Account.52 - **Inputs:**53 - `richMenuId` (string): The ID of the rich menu to delete.549. **set_rich_menu_default**55 - Set a rich menu as the default rich menu.56 - **Inputs:**57 - `richMenuId` (string): The ID of the rich menu to set as default.5810. **cancel_rich_menu_default**59 - Cancel the default rich menu.60 - **Inputs:**61 - None6211. **create_rich_menu**63 - Create a rich menu based on the given actions. Generate and upload an image. Set as default.64 - **Inputs:**65 - `chatBarText` (string): Text displayed in chat bar, also used as rich menu name.66 - `actions` (array): The actions of the rich menu. You can specify minimum 1 to maximum 6 actions. Each action can be one of the following types:67 - `postback`: For sending a postback action68 - `message`: For sending a text message69 - `uri`: For opening a URL70 - `datetimepicker`: For opening a date/time picker71 - `camera`: For opening the camera72 - `cameraRoll`: For opening the camera roll73 - `location`: For sending the current location74 - `richmenuswitch`: For switching to another rich menu75 - `clipboard`: For copying text to clipboard7677## Installation (Using npx)7879requirements:80- Node.js v20 or later8182### Step 1: Create LINE Official Account8384This MCP server utilizes a LINE Official Account. If you do not have one, please create it by following [this instructions](https://developers.line.biz/en/docs/messaging-api/getting-started/#create-oa).8586If you have a LINE Official Account, enable the Messaging API for your LINE Official Account by following [this instructions](https://developers.line.biz/en/docs/messaging-api/getting-started/#using-oa-manager).8788### Step 2: Configure AI Agent8990Please add the following configuration for an AI Agent like Claude Desktop or Cline.9192Set the environment variables or arguments as follows:9394- `CHANNEL_ACCESS_TOKEN`: (required) Channel Access Token. You can confirm this by following [this instructions](https://developers.line.biz/en/docs/basics/channel-access-token/#long-lived-channel-access-token).95- `DESTINATION_USER_ID`: (optional) The default user ID of the recipient. If the Tool's input does not include `userId`, `DESTINATION_USER_ID` is required. You can confirm this by following [this instructions](https://developers.line.biz/en/docs/messaging-api/getting-user-ids/#get-own-user-id).9697```json98{99 "mcpServers": {100 "line-bot": {101 "command": "npx",102 "args": [103 "@line/line-bot-mcp-server"104 ],105 "env": {106 "CHANNEL_ACCESS_TOKEN" : "FILL_HERE",107 "DESTINATION_USER_ID" : "FILL_HERE"108 }109 }110 }111}112```113114## Installation (Using Docker)115116### Step 1: Create LINE Official Account117118This MCP server utilizes a LINE Official Account. If you do not have one, please create it by following [this instructions](https://developers.line.biz/en/docs/messaging-api/getting-started/#create-oa).119120If you have a LINE Official Account, enable the Messaging API for your LINE Official Account by following [this instructions](https://developers.line.biz/en/docs/messaging-api/getting-started/#using-oa-manager).121122123### Step 2: Build line-bot-mcp-server image124125Clone this repository:126127```128git clone git@github.com:line/line-bot-mcp-server.git129```130131Build the Docker image:132133```134docker build -t line/line-bot-mcp-server .135```136137### Step 3: Configure AI Agent138139Please add the following configuration for an AI Agent like Claude Desktop or Cline.140141Set the environment variables or arguments as follows:142143- `mcpServers.args`: (required) The path to `line-bot-mcp-server`.144- `CHANNEL_ACCESS_TOKEN`: (required) Channel Access Token. You can confirm this by following [this instructions](https://developers.line.biz/en/docs/basics/channel-access-token/#long-lived-channel-access-token).145- `DESTINATION_USER_ID`: (optional) The default user ID of the recipient. If the Tool's input does not include `userId`, `DESTINATION_USER_ID` is required.146You can confirm this by following [this instructions](https://developers.line.biz/en/docs/messaging-api/getting-user-ids/#get-own-user-id).147148149```json150{151 "mcpServers": {152 "line-bot": {153 "command": "docker",154 "args": [155 "run",156 "-i",157 "--rm",158 "-e",159 "CHANNEL_ACCESS_TOKEN",160 "-e",161 "DESTINATION_USER_ID",162 "line/line-bot-mcp-server"163 ],164 "env": {165 "CHANNEL_ACCESS_TOKEN" : "FILL_HERE",166 "DESTINATION_USER_ID" : "FILL_HERE"167 }168 }169 }170}171```172173## Local Development with Inspector174175You can use the MCP Inspector to test and debug the server locally.176177### Prerequisites1781791. Clone the repository:180```bash181git clone git@github.com:line/line-bot-mcp-server.git182cd line-bot-mcp-server183```1841852. Install dependencies:186```bash187npm install188```1891903. Build the project:191```bash192npm run build193```194195### Run the Inspector196197After building the project, you can start the MCP Inspector:198199```bash200npx @modelcontextprotocol/inspector node dist/index.js \201 -e CHANNEL_ACCESS_TOKEN="YOUR_CHANNEL_ACCESS_TOKEN" \202 -e DESTINATION_USER_ID="YOUR_DESTINATION_USER_ID"203```204205This will start the MCP Inspector interface where you can interact with the LINE Bot MCP Server tools and test their functionality.206207## Versioning208209This project respects semantic versioning210211See http://semver.org/212213## Contributing214215Please check [CONTRIBUTING](./CONTRIBUTING.md) before making a contribution.216
Full transparency — inspect the skill content before installing.