The AgentivUse cases

IT · An afternoon · Thailand

Ask why your LINE bot stopped replying

An MCP server that lets Claude Code operate your LINE OA bot the way its developer would: why it stopped replying (queue health and failed jobs), retry a failed job, how many followers came yesterday and how much push quota is left, and which rich menu a customer sees, with broadcast switched off unless you opt in

Claude CodeLINEAlso works withCursor

The problem

When a LINE OA bot stops answering, the owner hears it from an annoyed customer, and the developer who built it has to dig through logs, the LINE console and the database to find which message got stuck. Follower numbers and the monthly push quota live in yet another console, so nobody looks until a campaign fails to send.

Architecture

  1. Channel
    • Claude Code on admin's machine
  2. Agent
    • Reads queue health
    • Lists failed jobs
    • Retries, pushes, swaps menu
  3. Tools
    • LINE Messaging API
    • Supabase job queue
  4. Human
    • Admin confirms each write

Where the data stays: The server runs locally and collects nothing: the channel access token goes only to api.line.me and the Supabase key only to your own project; failed job text and LINE user ids are read by Claude on the admin's machine.

Design flow

  1. Customer reports the bot went quiet
  2. Admin asks Claude Code why
  3. Queue health and failed jobs read from Supabase
  4. Admin confirms the retry or the pushHuman checkpoint
  5. Job retried, or a push if the reply token expiredOnly sometimes
  6. Followers and push quota checked the same way

Setup

Total time: 1 h 10 min our estimate

  1. 20 min

    The README's plugin route is claude plugin marketplace add MankhongGarden/line-bot-ops-mcp, then claude plugin install line-bot-ops@mankhonggarden; it asks for the values and adds a triage skill. The server starts even with values missing and names the missing variable when a tool needs it.

    Done when: Claude Code lists the line-bot-ops tools after you installed the plugin from the MankhongGarden marketplace (or ran claude mcp add with npx -y line-bot-ops-mcp) and set the LINE token and the two Supabase variables.

  2. 15 min

    A bot built another way keeps its own queue; the LINE tools work with any Messaging API channel.

    Done when: Your bot's Supabase project has the line_jobs and line_users tables from create-line-bot or schema.sql and the queue health tool returns counts; or you left the Supabase variables unset on purpose and use the LINE tools only.

  3. 15 min

    Done when: You asked why the bot stopped replying with the starter prompt, Claude Code reported queue health and the latest failed jobs with their errors, and it proposed actions without taking any.

  4. 10 min

    Done when: One saved prompt returns yesterday's followers and blocks and the push quota used this month, and you know the number at which a campaign would fail to send.

  5. 10 min

    The README marks every write tool with MCP hints and says broadcast is off unless you opt in because it messages every friend and cannot be undone.

    Done when: LINE_MCP_ALLOW_BROADCAST is not set, push, retry and rich menu changes still ask for your confirmation in Claude Code, and the owner has agreed which of these the admin may confirm alone.

Ticks are saved on this browser.

Download the kit (zip)

Starter prompt

Written from how the use case works and its sources. Replace the parts in square brackets.

You operate our LINE OA bot through the line-bot-ops MCP server. A customer says the bot went quiet around [time]. First call the queue health tool and tell me jobs per status, the age of the oldest pending job and anything stuck in processing. Then list the latest failed jobs with their errors and the customer's message text, and explain in plain words what most likely went wrong. Do not retry, push or change any rich menu until I confirm each action; propose the list and wait. If a retry would use an expired reply token, say so and propose a push to that one user instead. Finish with today's followers and blocks and the push quota used this month.

Risks and data

Data

The channel access token and the Supabase service role key give full control of the bot and its database; the README says the key is server side only and must never ship to a browser. Keep both in the admin's local config, rotate them when an admin leaves, and remember that failed jobs and profiles show customers' LINE ids, names and messages to the assistant.

How it goes wrong

The costly failure is a retry that fires a stale reply token and fails again while the customer still waits, or a push sent to the wrong user id. You notice when the failed jobs list grows after a retry, or when a customer answers a push they did not expect. Confirm every write, prefer a push to the one user once the reply token has expired, and never set the broadcast flag on a machine that also runs tests.

Data protection. This use case touches personal data, so check the rules where you operate (for example GDPR, PDPA). Failed jobs carry the customer's LINE user id and message text, and the profile tool returns the user's LINE profile; under Thailand's PDPA these are personal data. The server runs on your own machine and collects nothing, but Claude reads what the tools return, so keep the server on the admin's machine, never put the Supabase service role key in a browser or a shared file, limit who holds the channel access token, and write the bot's privacy notice to say an AI assistant may read messages for support.

How the agent works

  1. It starts

    The bot is built on a queue: the LINE webhook verifies the request, writes one job to a Supabase table and answers LINE inside its five second limit, and a worker replies from the queue.

  2. The agent works

    The MCP server runs on the developer's or admin's machine and gives Claude Code twelve tools: queue health (jobs per status, the age of the oldest pending job, jobs stuck in processing), the latest failed jobs with their errors and message text, retry a failed job, find linked users, and on the LINE side the account info, the monthly push quota and what is used, one day's followers and blocks, a user's profile, the rich menus, a push message to one user and linking a rich menu to a user. ', and Claude Code calls the tools and explains.

  3. The result

    Push, rich menu changes and retries are declared as writes, so you confirm each one in Claude Code, and broadcast to every friend is not even registered unless you set an opt in flag; that confirmation is the checkpoint.

Worked example

This is an open source build, not a customer story: line-bot-ops-mcp by the MankhongGarden GitHub organisation (MIT licence), the companion to its create-line-bot template (v0.2, Next.js 16, Supabase and Vercel), whose maintainer writes that every LINE bot they have shipped hit the same six problems and welcomes issues and pull requests 'especially from anyone running LINE bots at scale in Thailand or Japan'. No client business is named and no usage figures are given. The README's own examples: 'Why did the bot stop replying?' answered with line_queue_health, line_failed_jobs and line_retry_job; 'How many followers did we gain yesterday, and how much push quota is left?'; and 'Switch user U123 to the seller menu'. The server runs locally and collects nothing, sends the channel access token only to api.line.me and the Supabase service role key only to your own Supabase URL, validates every LINE id before a request so tool input cannot reach other API paths, and registers line_broadcast only when LINE_MCP_ALLOW_BROADCAST is true, because a broadcast messages every friend and cannot be undone. It warns that reply tokens expire soon after the event, so a retried reply may fail again and a push is the fallback.

The README offers the server for Claude Code (a claude mcp add command, or a plugin that asks for the values and adds a triage skill), for Cursor and for any MCP client through a standard mcpServers config, so Cursor is listed; with Cursor you lose the plugin's triage skill and set the server up by hand. The queue tools need the line_jobs and line_users tables from the companion create-line-bot template or the server's own schema.sql; a bot without that queue gets only the LINE tools. The LINE side is the Messaging API with a long lived channel access token, so this is for a bot you run yourself, not for the chats in LINE OA Manager.

Join the Agent OS Club

Get hours back with a team of AI agents for every department, set up step by step for the tools you use, with a person answering your questions. Founding member price: USD 14.95 a month or USD 150 a year, locked for as long as you stay. Cancel any time.

Founding offer, ends 31 December 2026 or at member 100

Join the Agent OS Club

Building this for an organization? Learn more at theagentiv.com

Sources

Published: 2026-11-27

Related use cases

Your dot gathers the evidence, you decide

Evidence for an internal security review gathered in a separate task by a ChatGPT dot that reports what it could verify and what still needs a person, and a payment flow checked before launch, at a small Detroit cybersecurity firm

ITEffort: An afternoon
ChatGPTAlso works with:Claude

A small IT or security firm has to pull together the evidence for its own internal review while it serves clients and builds a product, and the owner keeps five places open to know what still needs a decision or a follow up. The launch bug that a first time customer hits, such as a signup that never reaches payment, is the one nobody had time to walk through.

New engineers shipping in five days

Engineering decisions recorded in a Git based knowledge base that Claude Code reads at the start of every session, so a new engineer ships a first code change in under five days instead of three to four months, at a North American AI services firm

ITEffort: About a week
Claude CodeAlso works with:OpenAI Codex

Every new developer relearns why the code is the way it is through meetings, handoffs and guesses, and the coding agent they use starts every session knowing nothing either. The first real pull request takes months, and the reasons behind old decisions leave with the people who made them.

Members pick Video

Prototype it before engineering is free

A business team member builds a working first version of a new internal tool in Codex Cloud from the company's own codebase and data, engineers refine and release it with Codex reviewing every pull request in GitHub, and the engineers stay responsible for architecture, security and production

ITEffort: About a week
ChatGPTGitHubSlackAlso works with:Claude Code

Every good idea for an internal tool waits for engineering time, so experiments compete with the core product and most never get built. Written requirements lose the detail the business person had in their head, and the first version engineers deliver is often not what was meant.