home / mcp / line bot mcp server

LINE Bot MCP Server

MCP server that connects an AI agent to LINE Official Account for messaging, rich menus, and profile access.

Installation
Add the following to your MCP client configuration file.

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.

How to use

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.

How to install

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"
      }
    }
  }
}

Option B: Run with Docker (containerized MCP server)

{
  "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 Development with Inspector

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"

Available tools

push_text_message

Push a simple text message to a user via LINE. Requires userId or DESTINATION_USER_ID and message.text content.

push_flex_message

Push a customizable flex message to a user with specified contents and layout type (bubble or carousel).

broadcast_text_message

Broadcast a simple text message to all followers of your LINE Official Account.

broadcast_flex_message

Broadcast a customizable flex message to all followers who added your LINE Official Account.

get_profile

Retrieve detailed profile information for a LINE user, including display name, picture URL, status message, and language.

get_message_quota

Query the monthly message quota and current usage for your LINE Official Account.

get_rich_menu_list

Fetch the list of rich menus associated with your LINE Official Account.

delete_rich_menu

Remove a specific rich menu by its ID.

set_rich_menu_default

Set a rich menu as the default for your LINE Official Account.

cancel_rich_menu_default

Cancel the default rich menu setting.

create_rich_menu

Create a new rich menu from defined actions, generate an image, and set it as default.