home / mcp / line bot mcp server
MCP server that connects an AI agent to LINE Official Account for messaging, rich menus, and profile access.
Configuration
View docs{
"mcpServers": {
"line-line-bot-mcp-server": {
"command": "npx",
"args": [
"@line/line-bot-mcp-server"
],
"env": {
"DESTINATION_USER_ID": "FILL_HERE",
"CHANNEL_ACCESS_TOKEN": "FILL_HERE"
}
}
}
}The LINE Bot MCP Server lets you connect an AI agent to a LINE Official Account through the Model Context Protocol (MCP). It provides tools to send messages, manage rich menus, retrieve user profiles, and monitor quotas, all via MCP-compatible clients.
You use an MCP client to load the LINE Bot MCP Server and access its tools. You can send simple or flex messages to individual users, broadcast messages to all followers, manage rich menus, and retrieve user profiles or account quotas. Each tool is invoked through MCP calls from your agent or automation layer, enabling interactive conversations and rich message flows on LINE.
Prerequisites: Node.js v20 or later.
Step 1: Create a LINE Official Account and enable the Messaging API. Follow the setup instructions to obtain your Channel Access Token and configure your LINE account for MCP use.
Step 2: Configure your AI agent with the required environment variables.
Choose one of the following run methods to start the MCP server.
Option A: Run with npx (local MCP server)
{
"mcpServers": {
"line-bot": {
"command": "npx",
"args": [
"@line/line-bot-mcp-server"
],
"env": {
"CHANNEL_ACCESS_TOKEN" : "FILL_HERE",
"DESTINATION_USER_ID" : "FILL_HERE"
}
}
}
}{
"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"
}
}
}
}You can test and debug the server locally using the MCP Inspector.
Prerequisites and steps are provided to clone the project, install dependencies, build, and run the inspector. Use the inspector to interact with the LINE Bot MCP Server tools and verify their behavior.
# Prerequisites
git clone [email protected]:line/line-bot-mcp-server.git
cd line-bot-mcp-server
# Install dependencies
npm install
# Build the project
npm run build
# Run the MCP Inspector
npx @modelcontextprotocol/inspector node dist/index.js \
-e CHANNEL_ACCESS_TOKEN="YOUR_CHANNEL_ACCESS_TOKEN" \
-e DESTINATION_USER_ID="YOUR_DESTINATION_USER_ID"Push a simple text message to a user via LINE. Requires userId or DESTINATION_USER_ID and message.text content.
Push a customizable flex message to a user with specified contents and layout type (bubble or carousel).
Broadcast a simple text message to all followers of your LINE Official Account.
Broadcast a customizable flex message to all followers who added your LINE Official Account.
Retrieve detailed profile information for a LINE user, including display name, picture URL, status message, and language.
Query the monthly message quota and current usage for your LINE Official Account.
Fetch the list of rich menus associated with your LINE Official Account.
Remove a specific rich menu by its ID.
Set a rich menu as the default for your LINE Official Account.
Cancel the default rich menu setting.
Create a new rich menu from defined actions, generate an image, and set it as default.