line-platform-interface-server-mcp
Facilitates AI agent interaction with a LINE Official Account via the Messaging API, enabling the transmission and retrieval of messages, including rich, structured layouts, and access to subscriber profile data and bulk messaging capabilities.
Author

line
Quick Info
Actions
Tags
日本語版 READMEはこちら
LINE Bot MCP Server
Implementation of the Model Context Protocol (MCP) server layer, designed to bridge an Artificial Intelligence Agent with a LINE Official Account through the utilization of the LINE Messaging API.
[!NOTE] This package is currently distributed as an early access release. It is intended primarily for trial use and experimentation, and may lack certain finalized features or complete official support documentation.
Available Functions
- transmit_text_message
- Dispatches a standard text-only communication to an individual LINE recipient.
- Parameters:
user_id(string?): Identifier for the message recipient. Resolves to the configuredDESTINATION_USER_IDif unspecified. One must be provided.message.text(string): The textual payload intended for the user.
- transmit_rich_message
- Sends a highly customizable, visually complex message structure (Flex Message) to a recipient on LINE.
- Parameters:
user_id(string?): Identifier for the message recipient. Resolves to the configuredDESTINATION_USER_IDif unspecified. One must be provided.message.altText(string): Fallback text displayed when the rich content rendering fails.message.content(any): The complete JSON definition governing the Flex Message's arrangement and elements.message.contents.type(enum): Defines the container type: 'bubble' for singular content blocks or 'carousel' for swipeable collections.
- mass_notify_text
- Issues a plain text broadcast to every end-user subscribed to the connected LINE Official Account.
- Parameters:
message.text(string): The plain text content for the broad distribution.
- mass_notify_rich
- Distributes a complex, customizable Flex Message to the entire follower base of the LINE Official Account.
- Parameters:
message.altText(string): Alternative text displayed if the rich content is unavailable.message.content(any): The structured JSON object detailing the visual composition of the message.message.contents.type(enum): Specifies the primary container type: 'bubble' or 'carousel'.
- fetch_subscriber_profile
- Retrieves comprehensive identity data for a specified LINE user, including their displayed name, avatar URL, status message, and preferred language settings.
- Parameters:
user_id(string?): The unique identifier of the subscriber whose data is sought. Defaults toDESTINATION_USER_ID.
- query_message_sending_limits
- Examines the current monthly message sending allowance and consumption metrics for the registered LINE Official Account.
- Parameters:
- None specified.
- retrieve_rich_menu_definitions
- Fetches the catalogue of all configured Rich Menu assets linked to the LINE Official Account.
- Parameters:
- None specified.
- decommission_rich_menu
- Permanently erases a specific Rich Menu resource using its unique identifier.
- Parameters:
richMenuId(string): The unique identifier of the Rich Menu resource targeted for removal.
- designate_rich_menu_primary
- Designates a specified Rich Menu as the default interactive menu for users.
- Parameters:
richMenuId(string): The unique identifier of the menu to be set as the primary/default option.
- revoke_rich_menu_primary_status
- Deactivates any currently set default Rich Menu configuration.
- Parameters:
- None specified.
Deployment via npx
Required Foundation: - Node.js version 20 or higher
Stage 1: Establish LINE Official Account Prerequisites
This server component necessitates an active LINE Official Account. If one is unavailable, please proceed with creation following these guidelines.
If an account exists, ensure the Messaging API functionality is activated by referencing this procedure.
Stage 2: Configure Agent Environment
Integrate the subsequent configuration details into your operational AI Agent environment (e.g., Claude Desktop or Cline):
Set the required environment variables or command-line arguments:
CHANNEL_ACCESS_TOKEN: (Mandatory) The authorized token for API access. Obtainable per these instructions.DESTINATION_USER_ID: (Optional) The default target identifier for one-to-one messages. Essential if the function call omits auser_id. Reference this resource for retrieval.
Configuration Snippet Example:
{
"mcpServers": {
"line-bot": {
"command": "npx",
"args": [
"@line/line-bot-mcp-server"
],
"env": {
"CHANNEL_ACCESS_TOKEN" : "FILL_HERE",
"DESTINATION_USER_ID" : "FILL_HERE"
}
}
}
}
Deployment via Docker Containerization
Stage 1: LINE Official Account Setup
(Repeat of prerequisite setup for LINE OA and API enablement as described above.)
Stage 2: Construct the line-bot-mcp-server Image
Acquire source code via Git:
git clone git@github.com:line/line-bot-mcp-server.git
Build the container artifact:
docker build -t line/line-bot-mcp-server .
Stage 3: Configure AI Agent for Docker Execution
Supply these configuration directives to your AI Agent framework:
mcpServers.args: (Mandatory) Specifies the location or executable path for the server wrapper.CHANNEL_ACCESS_TOKEN: (Mandatory) Required API credential.DESTINATION_USER_ID: (Optional) Default recipient identifier if not supplied in specific tool invocations.
Docker Run Example:
{
"mcpServers": {
"line-bot": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"CHANNEL_ACCESS_TOKEN",
"-e",
"DESTINATION_USER_ID",
"line/line-bot-mcp-server"
],
"env": {
"CHANNEL_ACCESS_TOKEN" : "FILL_HERE",
"DESTINATION_USER_ID" : "FILL_HERE"
}
}
}
}
Local Iteration Utilizing the MCP Inspector
Testing and debugging capabilities are accessible via the MCP Inspector utility running locally.
Required Preparatory Steps
- Clone the repository and navigate into the directory:
git clone git@github.com:line/line-bot-mcp-server.git
cd line-bot-mcp-server
- Install required dependencies:
npm install
- Compile the source code:
npm run build
Launching the Inspector Session
Execute the following command to initialize the local server accessible via the Inspector UI:
npx @modelcontextprotocol/inspector node dist/index.js
This action initiates the interface where you can examine and validate the functionality of the LINE Bot MCP Server tools.
Version Control Standard
This software adheres to the principles of semantic versioning. Refer to http://semver.org/ for details.
Collaboration Guidelines
Consult CONTRIBUTING prior to submitting any modifications or enhancements.
WIKIPEDIA: Enterprise management utilities encompass the array of systems, software applications, oversight mechanisms, computational frameworks, and systematic approaches leveraged by organizations to effectively navigate volatile market conditions, maintain competitive advantage, and elevate overall operational performance.
