/ Каталог / Песочница / LINE Bot
● Официальный line 🔑 Нужен свой ключ

LINE Bot

автор line · line/line-bot-mcp-server

Send LINE messages, rich Flex bubbles, and images to users or groups via the LINE Messaging API — ideal for JP/TW/TH notification flows.

LINE's official MCP wraps the LINE Messaging API. Push text, stickers, images, and Flex Message bubbles to a user by userId or to a group/room by their id. Includes broadcast (to all followers), narrowcast (segment), and profile lookups. Message costs apply beyond the free quota.

Зачем использовать

Ключевые функции

Живое демо

Как выглядит на практике

line-bot.replay ▶ готово
0/0

Установка

Выберите клиент

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "line-bot": {
      "command": "npx",
      "args": [
        "-y",
        "@line/line-bot-mcp-server"
      ]
    }
  }
}

Откройте Claude Desktop → Settings → Developer → Edit Config. Перезапустите после сохранения.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "line-bot": {
      "command": "npx",
      "args": [
        "-y",
        "@line/line-bot-mcp-server"
      ]
    }
  }
}

Cursor использует ту же схему mcpServers, что и Claude Desktop. Конфиг проекта приоритетнее глобального.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "line-bot": {
      "command": "npx",
      "args": [
        "-y",
        "@line/line-bot-mcp-server"
      ]
    }
  }
}

Щёлкните значок MCP Servers на боковой панели Cline, затем "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "line-bot": {
      "command": "npx",
      "args": [
        "-y",
        "@line/line-bot-mcp-server"
      ]
    }
  }
}

Тот же формат, что и Claude Desktop. Перезапустите Windsurf для применения.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "line-bot",
      "command": "npx",
      "args": [
        "-y",
        "@line/line-bot-mcp-server"
      ]
    }
  ]
}

Continue использует массив объектов серверов, а не map.

~/.config/zed/settings.json
{
  "context_servers": {
    "line-bot": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "@line/line-bot-mcp-server"
        ]
      }
    }
  }
}

Добавьте в context_servers. Zed перезагружается автоматически.

claude mcp add line-bot -- npx -y @line/line-bot-mcp-server

Однострочная команда. Проверить: claude mcp list. Удалить: claude mcp remove.

Сценарии использования

Реальные сценарии: LINE Bot

Send a formatted ops alert to an on-call engineer via LINE

👤 JP/TW-based SRE teams where LINE is the standard pager ⏱ ~25 min intermediate

Когда использовать: You want Sentry/Prometheus alerts to ping specific engineers on LINE with a tidy Flex card, not a wall of text.

Предварительные требования
  • LINE Official Account + channel access token — developers.line.biz → Channel → Messaging API → Issue token
  • The engineer's userId (from your bot's webhook events) — Capture userId from a follow or message event; store in your user DB
Поток
  1. Design the Flex bubble
    Design a Flex Message bubble for a Sentry alert: header (issue title), body (event count, release, affected users), buttons (Open in Sentry, Ack).✓ Скопировано
    → Valid Flex JSON Claude can validate
  2. Push to the on-call user
    Push this Flex message to userId U1234567890abcdef with altText 'Sentry alert: <title>'.✓ Скопировано
    → messageId returned, no 400
  3. Handle fallback if user blocked the bot
    If the push fails with 400 (user blocked), multicast to the secondary on-call userIds instead and log the original failure.✓ Скопировано
    → Graceful fallback path

Итог: A polished, actionable alert in LINE within 2 seconds of the underlying event.

Подводные камни
  • altText required and capped at 400 chars — pushes fail silently without it — Always include altText; keep it under 400 chars summarizing the Flex
  • Pushing without the user being a friend of the bot fails 400 — Only push to userIds you captured from a real webhook event — you can't guess them
Сочетать с: sentry

Broadcast a monthly product update to all followers

👤 Marketing teams with a LINE OA presence ⏱ ~20 min intermediate

Когда использовать: Once a month, you send a digest to all followers with 3 headline items and deep links.

Предварительные требования
  • Sufficient messaging quota — Check current quota with getMessageQuota; LINE Push Messages are metered per plan
Поток
  1. Check quota before sending
    Get current message quota consumption and remaining. Confirm we have at least <follower_count> messages left.✓ Скопировано
    → Remaining quota number
  2. Compose a Flex carousel
    Build a Flex carousel with 3 bubbles (title, image, CTA button). Inputs: [topic, image URL, link] × 3.✓ Скопировано
    → Valid Flex carousel JSON
  3. Broadcast
    Broadcast this carousel to all followers with altText '<brand> monthly update'.✓ Скопировано
    → 200 OK, requestId for audit

Итог: A branded monthly broadcast to the whole follower base with click tracking via your redirect links.

Подводные камни
  • Broadcasts are expensive — a big list can blow through the free tier in one send — For non-urgent content consider narrowcast with a segment; or upgrade plan before sending

Let Claude post a standup summary to a team's LINE group

👤 Teams where daily standup lives in a LINE group ⏱ ~20 min intermediate

Когда использовать: Every morning at 9, summarize yesterday's Linear/Sentry activity and post a short digest.

Предварительные требования
  • groupId of the target chat — Capture from a join or message event when the bot is added to the group
Поток
  1. Assemble the digest upstream
    Pull yesterday's Linear merged PRs and top new Sentry issues. Summarize in 5 bullets.✓ Скопировано
    → Clean 5-bullet markdown
  2. Push to the group
    Push a text message (markdown-free; LINE doesn't render markdown) to groupId Cxxxxx with the 5 bullets as plain lines.✓ Скопировано
    → 200 OK
  3. Ack failures loudly
    If push fails (bot was kicked from the group), write the failure to /logs/line-standup.log and notify me via email.✓ Скопировано
    → Audit trail on failure

Итог: A reliable daily standup digest that silently self-heals and alerts you if broken.

Подводные камни
  • Bot removed from group silently fails push — Subscribe to leave webhook events and mark the group inactive in your DB
  • LINE text messages don't render Markdown or HTML — Use plain text with emoji, or switch to a Flex message for rich formatting
Сочетать с: sentry · linear

Narrowcast a campaign to a geographic or behavioral segment

👤 Growth teams running targeted pushes ⏱ ~20 min advanced

Когда использовать: You want to ping only Tokyo-area followers about an in-person event, not your whole list.

Предварительные требования
  • Audience defined in LINE Official Account Manager — Create an audience (geo, tag, or uploaded userId list) in the OA Manager UI
Поток
  1. List audiences
    List all audiences on our LINE OA. Show name, size, last updated.✓ Скопировано
    → Audience catalog
  2. Compose segment-specific message
    Build a Flex card for the Tokyo meetup — location, date, CTA. Tailor copy for Tokyo-area users.✓ Скопировано
    → Targeted Flex JSON
  3. Narrowcast
    Narrowcast this Flex to audienceId <id>. Confirm the request was accepted.✓ Скопировано
    → 202 Accepted + requestId

Итог: Precision campaigns with lower cost per impression and higher click-through.

Подводные камни
  • Narrowcast to audience < 50 fails for privacy reasons — If segment is tiny, fall back to individual push to the user list instead

Комбинации

Сочетайте с другими MCP — эффект x10

line-bot + sentry

Auto-push a Flex alert to on-call when a critical Sentry issue appears

When a new Sentry issue in project web-prod exceeds 100 events in 5 minutes, push a Flex alert to the on-call LINE user.✓ Скопировано
line-bot + linear

Notify a LINE group when a P0 Linear issue is created

When a Linear issue is labeled P0, push a text message to groupId Cxxxx with the title and URL.✓ Скопировано
line-bot + monday

Push a daily digest of monday.com items due today

Every morning at 9am, gather my monday.com items due today, format as a Flex carousel, push to my LINE user.✓ Скопировано

Инструменты

Что предоставляет этот MCP

ИнструментВходные данныеКогда вызыватьСтоимость
push_message to: userId|groupId|roomId, messages: Message[] Send to a known recipient id 1 message charge
multicast to: userId[], messages: Message[] Same message to <=500 specific users 1 charge per recipient
broadcast messages: Message[] Blast to all followers; confirm quota first 1 charge per follower
narrowcast messages, recipient (audience object), filter? Targeted sends by audience 1 charge per recipient
get_profile userId Personalize a message with the user's display name free
get_message_quota Before any broadcast/narrowcast free

Стоимость и лимиты

Во что обходится

Квота API
LINE API is metered in messages, not requests. Free tier: 500 free push messages/month (developer trial) or 200/month (light plan).
Токенов на вызов
Text message: ~200 tokens request. Flex message: 500–2000 tokens depending on bubble complexity.
Деньги
Light plan free (200 msg/mo), Standard ¥5,000/mo (up to 30k msg), Pro ¥15,000/mo (45k+).
Совет
Use reply_message whenever possible — replies are FREE. Only push when you don't have a replyToken.

Безопасность

Права, секреты, радиус поражения

Минимальные скоупы: Channel access token (long-lived, Messaging API)
Хранение учётных данных: CHANNEL_ACCESS_TOKEN and CHANNEL_SECRET in env vars
Исходящий трафик: All calls to api.line.me and api-data.line.me
Никогда не давайте: Channel secret to client-side code — it's for webhook signature verification only

Устранение неполадок

Частые ошибки и исправления

401 Invalid channel access token

Token expired or revoked. Re-issue at developers.line.biz → Channel → Messaging API.

Проверить: curl -H 'Authorization: Bearer $CHANNEL_ACCESS_TOKEN' https://api.line.me/v2/bot/info
400 The property, altText, must be specified

Every non-text message (image, Flex) requires altText. Add it.

400 The user hasn't added the LINE Official Account as a friend

You can't push to arbitrary userIds — only ones that messaged/followed your bot. Use replyToken instead for this recipient.

429 Monthly limit reached

You hit your plan quota. Upgrade plan or wait until next month; replies remain free.

Проверить: Call get_message_quota

Альтернативы

LINE Bot в сравнении

АльтернативаКогда использоватьКомпромисс
Slack MCPTeam is on Slack (most of Europe/NA)Different audience; LINE wins for JP/TW/TH consumers
Telegram MCPBot target is Telegram usersDifferent geo dominance; no OA/broadcast quotas
WhatsApp Cloud API MCPYou need to reach SEA/LATAM consumersHeavier BSP onboarding; stricter template approval

Ещё

Ресурсы

📖 Читать официальный README на GitHub

🐙 Открытые задачи

🔍 Все 400+ MCP-серверов и Skills