home / mcp / line bot mcp server

LINE Bot MCP Server

MCP server that connects LINE Official Accounts with an AI agent via stdio or SSE transports.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "acquo-line-bot-mcp-server-sse": {
      "command": "npx",
      "args": [
        "@line/line-bot-mcp-server"
      ],
      "env": {
        "MCP_PORT": "3000",
        "MCP_TRANSPORT": "sse",
        "DESTINATION_USER_ID": "FILL_HERE",
        "CHANNEL_ACCESS_TOKEN": "FILL_HERE"
      }
    }
  }
}

You can connect an AI agent to LINE Official Accounts using the LINE Bot MCP Server with SSE transport. It supports local stdio execution and HTTP-based Server-Sent Events (SSE), letting your agent push messages to LINE users, fetch profiles, manage rich menus, and broadcast content through a simple MCP interface.

How to use

Choose your transport method and run the MCP server as part of your AI workflow. With stdio you run the MCP server as a local process and communicate through standard input/output. With SSE you run a local process that also exposes HTTP endpoints to receive requests from web apps. Your AI agent can push text or flex messages, broadcast to followers, retrieve user profiles, check quotas, and manage rich menus using the available tools.

How to install

Prerequisites you need before starting are: Node.js v20 or later.

Step 1 Create a LINE Official Account and enable the Messaging API. This account is required for the MCP server to send messages on your behalf.

Step 2 Configure your AI agent. Set the environment variables for your integration to enable the MCP server to authenticate with LINE and to determine where to send messages. Required variables include CHANNEL_ACCESS_TOKEN and DESTINATION_USER_ID. Optional variables include MCP_TRANSPORT and MCP_PORT for SSE usage.

Configuration and example MCP server entries

The MCP server can be run in two configurations. Use one or both to suit your deployment. Each configuration runs the same MCP server binary but with different environment settings.

{
  "mcpServers": {
    "line-bot": {
      "command": "npx",
      "args": [
        "@line/line-bot-mcp-server"
      ],
      "env": {
        "CHANNEL_ACCESS_TOKEN" : "FILL_HERE",
        "DESTINATION_USER_ID" : "FILL_HERE"
      }
    }
  }
}

Using stdio transport (default)

Run the MCP server with stdio transport by starting the CLI as shown. This uses a local process and standard I/O for communication.

{
  "mcpServers": {
    "line-bot": {
      "command": "npx",
      "args": [
        "@line/line-bot-mcp-server"
      ],
      "env": {
        "CHANNEL_ACCESS_TOKEN" : "FILL_HERE",
        "DESTINATION_USER_ID" : "FILL_HERE"
      }
    }
  }
}

Using SSE transport

Run the MCP server with SSE transport to expose HTTP endpoints for web-based integrations. This is useful when your AI agent or web app communicates over HTTP.

{
  "mcpServers": {
    "line-bot": {
      "command": "npx",
      "args": [
        "@line/line-bot-mcp-server"
      ],
      "env": {
        "CHANNEL_ACCESS_TOKEN" : "FILL_HERE",
        "DESTINATION_USER_ID" : "FILL_HERE",
        "MCP_TRANSPORT" : "sse",
        "MCP_PORT" : "3000"
      }
    }
  }
}

MCP server endpoints when using SSE

When SSE transport is enabled, the server provides HTTP endpoints for web-based usage. Typical endpoints include GET /sse to establish a connection, POST /messages to send messages to the server, and GET /health for a health check.

Example Docker usage

You can run a pre-built image to simplify deployment. The recommended approach uses the SSE-enabled image.

docker pull acquojp/line-bot-mcp-server-sse:latest

# Run with required tokens and IDs
docker run --rm -p 3000:3000 \
  -e CHANNEL_ACCESS_TOKEN="your_token" \
  -e DESTINATION_USER_ID="your_user_id" \
  acquojp/line-bot-mcp-server-sse:latest

Tools

Push a simple text message with push_text_message to a user. Push a flex message with push_flex_message. Broadcast messages with broadcast_text_message or broadcast_flex_message. Retrieve user profiles with get_profile. Check quotas with get_message_quota. Manage rich menus with get_rich_menu_list, delete_rich_menu, set_rich_menu_default, and cancel_rich_menu_default.

Security and operational notes

Keep your Channel Access Token secure. Use environment variable injection or secret management in your deployment to avoid exposing tokens in code or logs. When using SSE, ensure your HTTP server is exposed only to trusted clients and consider enabling TLS in production deployments.

Troubleshooting

If messages fail to send, verify that the Channel Access Token is correct and that your LINE Official Account has Messaging API enabled. Check that DESTINATION_USER_ID is set or provided by the tool input. For SSE, confirm MCP_PORT is open and not blocked by your firewall.

Available tools

push_text_message

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

push_flex_message

Push a highly customizable flex message to a user via LINE. Includes altText and a JSON content definition.

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 of your LINE Official Account.

get_profile

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

get_message_quota

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

get_rich_menu_list

Retrieve the list of rich menus tied to your LINE Official Account.

delete_rich_menu

Delete a specified rich menu by its ID.

set_rich_menu_default

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

cancel_rich_menu_default

Cancel the default rich menu setting.

LINE Bot MCP Server - acquo/line-bot-mcp-server-sse