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
- Channel
- Claude Code on admin's machine
- Agent
- Reads queue health
- Lists failed jobs
- Retries, pushes, swaps menu
- Tools
- LINE Messaging API
- Supabase job queue
- 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
- Customer reports the bot went quiet
- Admin asks Claude Code why
- Queue health and failed jobs read from Supabase
- Admin confirms the retry or the pushHuman checkpoint
- Job retried, or a push if the reply token expiredOnly sometimes
- Followers and push quota checked the same way
Setup
Total time: 1 h 10 min our estimate
- 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.
- 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.
- 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.
- 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.
- 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.
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.
How the agent works
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.
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.
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 ClubBuilding this for an organization? Learn more at theagentiv.com
Sources
- https://github.com/MankhongGarden/line-bot-ops-mcp
- https://raw.githubusercontent.com/MankhongGarden/line-bot-ops-mcp/main/README.md
- https://raw.githubusercontent.com/MankhongGarden/create-line-bot/main/README.md
Published: 2026-11-27