line-oa-mcp-ultimate
The line-oa-mcp-ultimate server lets AI agents manage a LINE Official Account through natural language. Key capabilities include:
📨 Messaging
Send text, Flex, sticker, image, video, or coupon messages to any target (reply, push, multicast, narrowcast, broadcast)
Three send modes:
send_now,draft(for scheduling), anddry_run(validate + estimate cost only)Built-in quota guardian, quiet-hours warnings, pre-flight validation, and retry-key handling
Find stickers by mood or keyword
🎨 Rich Menus
Create, list, delete, link/unlink (bulk up to 500 users), set/clear default, and upload images
Audit why a specific user sees a particular menu (priority chain inspection)
Manage rich menu aliases for tab-switching
💎 Message Design
Design Flex Messages from templates or raw JSON with preview URLs
Design Imagemap (Rich Messages) with tappable regions and optional inline video
Design Card Messages (buttons, confirm, carousel, image carousel)
🎯 Audiences
Build audiences from CSV (user ID upload) or prior broadcast engagement (clicks/opens)
List, update (add users or rename), and delete audience groups
📊 Insights & Reporting
Get OA status (friend count, quota, webhook status, default rich menu)
Get multi-day OA reports (delivery stats, follower trends, quota usage)
Get per-broadcast engagement stats (impressions, opens, clicks, CTR, per-URL breakdown)
Estimate send cost and monitor narrowcast delivery progress
🎟 Coupons
Create (percentage/fixed/explicit discount), list, get, discontinue native LINE coupons
Get coupon redemption stats and send coupons as messages
🔌 Webhook
Test the webhook endpoint (ping, HTTP status, latency, signature result)
Set or retrieve the webhook URL
👤 User & Operations
Fetch individual user profiles and list followers (cursor-paginated, region-gated)
List all configured OAs, switch the active OA at runtime
Run read-only tools across multiple OAs in parallel (agency bulk reporting)
💻 LIFF & Token
Manage LIFF apps (create, list, update, delete)
Verify access token expiry, bound client ID, and granted scope
🛍 LINE Shopping (Optional, opt-in)
Manage products (create, update, inventory, pricing)
Process orders (list, detail, fulfill, cancel, print parcel labels)
Generate checkout links and manage settlements
Allows AI agents to operate a LINE Official Account through natural language, including sending messages, managing rich menus, audiences, coupons, and more via LINE's Messaging API.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@line-oa-mcp-ultimate Summarize last week's LINE OA performance"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
LINE OA MCP Ultimate
Operate your LINE Official Account from any AI agent — through natural language.
🛠️ Fixed in 2.2.1: run the MCP on your own server and point any AI agent at one URL — it now holds up through real sessions and full broadcasts (no more instant "Internal server error" in HTTP mode), and hosted pictures now cache properly, so thousands of customers opening your broadcast at once barely touch your machine. Thanks to a production field report by Norapat Limpagan! 🙏
🖼️ New in 2.2: attach a picture, say "send this as a Rich Message" — and it appears in your customers' chats. No hosting. No image resizing. No setup.
Quick Start · What you can do · Configuration · Security · Documentation
🇹🇭 คู่มือภาษาไทย: เริ่มต้น 5 นาที · Messaging — 37 tools · LINE Shopping — 14 tools
What is this?
line-oa-mcp-ultimate is a Model Context Protocol server that lets AI agents drive your LINE Official Account through natural conversation — no code, no API knowledge required.
Manage one OA or many — a single account needs just one env var, while agencies can register every client OA in one config file and switch between them with a single command (see Configuration).
It works with Claude Cowork, Claude Code, Cursor, Codex, ChatGPT desktop, OpenClaw, Hermes, or any MCP-compatible host.
Disclaimer: This is an independent open-source project. It is not affiliated with or endorsed by LY Corporation / LINE Corp. "LINE" is a registered trademark of LY Corporation, used here in a descriptive sense.
Related MCP server: LINE OA MCP Ultimate
Why use it?
LINE OA Manager works well — but it's a web UI you have to log into, click through, and operate manually. With this MCP server, the same operations become natural-language requests in your AI host of choice:
Instead of clicking through LINE OA Manager... | Just say... |
Open broadcast composer → pick audience → write text → preview → schedule | "Send a Mother's Day promo to my Bangkok-based 25-44 female audience" |
Resize the artwork to 5 sizes → find somewhere to host it → upload → paste URLs into a Rich Message | "ส่งรูปนี้เป็น Rich Message หาลูกค้าทุกคน" (attach the picture — that's the whole job) |
Navigate Insight → Delivery → pick date range → screenshot | "Summarize last week's performance" |
Open Audience → create from upload → upload CSV → wait | "Create an audience from this CSV: customers_last_month.csv" |
Open Rich Menu → design tabs → upload images → set as default | "Build a Mother's Day rich menu and set it as default" |
Open Coupon → check usage tab → cross-reference clicks | "How many people redeemed my Mother's Day coupon?" |
The MCP server takes care of LINE Messaging API calls, pre-flight validation, quota safety, quiet-hour warnings, and Thai-localized templates. You stay in your AI host and operate your OA the way you think about it — by intent.
🆚 vs the official @line/line-bot-mcp-server
LY Corporation publishes an official LINE Bot MCP server (Apache-2.0, marked preview). It's a clean reference implementation, and ideas from it helped shape this project — if all you need is pushing a text or Flex message to one user from an agent, it may be enough. This project targets running a real OA (or an agency's worth of them) day to day:
| official | |
Tools | 51 (37 messaging + 14 shopping) + 4 resources + 8 guided prompts | 12 (push/broadcast text & Flex, profile, quota read, rich-menu basics, follower IDs) |
LINE Shopping (MyShop) | ✅ 14 opt-in tools — products, stock, orders, parcel labels, settlements, checkout links | ❌ |
Rich Message images | ✅ zero-setup (v2.2) — attach a picture, everything else is automatic and verified delivered-able before "success" | ❌ bring your own hosted URLs |
Multi-OA | ✅ one config file for all client OAs + runtime switch ( | ❌ one OA per server instance |
Quota / quiet-hours guardrails | ✅ pre-flight Quota Guardian, 22:00–08:00 quiet-hours warnings, | ➖ quota read tool ( |
Thai i18n | ✅ every user-facing error/warning in Thai, plus full Thai guides | ❌ English (Japanese README available) |
Rich-menu image generation | ✅ pure-JS satori + resvg (~10 MB, no browser), with a preview-before-deploy loop | ✅ Marp + Puppeteer (downloads headless Chromium), generate-and-upload in one shot |
Transports | stdio + Streamable HTTP with bearer-token auth ( | stdio (npx / Docker) |
Runtime footprint | browser-free — no headless Chromium download | depends on |
Based on the official repo's README and package manifest as of 2026-07 — see their repo for the latest.
Who is it for?
🪐 AI-first marketers who run a LINE OA from their AI workspace.
🏪 SMB owners who already use LINE OA as their primary customer channel and want to automate routine work.
🏢 Marketing agencies managing many client OAs from one dashboard.
💻 Developers building LINE-integrated SaaS, automations, or AI bots.
Free-tier ready — no Premium upgrade required for the core feature set.
What you can do
37 messaging tools + 14 LINE Shopping tools (v2.0, opt-in) + 4 resources + 8 guided prompts, grouped by what you actually want to do:
📨 Send messages (2 tools)
One universal send_message covers every LINE transport (reply / push / multicast / narrowcast / broadcast). Three modes: send_now, draft (for scheduling via LINE OA Manager UI), and dry_run (validate + estimate cost without sending). Message shapes: text, Flex (template or raw JSON), sticker, image, video, native LINE coupon ({ coupon_id }), and a message_json passthrough for pre-built Rich/Card messages. Plus Thai-friendly sticker search.
🎨 Rich Menus (9 tools)
Build a rich menu in one call (create + upload image + set as default), list, delete, and diagnose "why doesn't this user see my menu?". Full lifecycle too: link/unlink a menu to specific users or in bulk (auto-chunked at 500), set/clear the account default, manage rich-menu aliases (tab-switching menus), and swap the image on an existing menu. New in v2.1 — Rich Menu Studio: line_design_rich_menu_image generates the menu image itself (Thai-ready layout templates, pure-JS satori + resvg — no headless browser), lets you preview before deploying, then hands off to line_build_rich_menu.
💎 Message Design (5 tools)
Design Flex Messages from 8 Thai-localized templates or raw JSON, build Rich Messages (imagemap — tappable image regions + optional video), and Card Messages (template — buttons / confirm / carousel / image_carousel). Each returns ready-to-send JSON you hand to send_message. New in v2.2: Rich Messages need zero hosting — attach any image and it's resized, hosted, and verified for you (line_prepare_image + line_image_host_status).
🎯 Audiences (5 tools)
Build retargeting audiences from a CSV or from prior broadcast engagement, list, delete — and update an existing audience (add users, rename).
📊 Insights (5 tools)
Quick OA status snapshot (incl. chat mode), weekly markdown reports, per-broadcast engagement stats, pre-flight send-cost estimation, and narrowcast delivery progress ("did my blast finish?").
🎟 Coupons (2 tools)
Create, list, get, and discontinue native LINE coupons with line_manage_coupon, then broadcast a created coupon straight into chats as a native coupon message via send_message ({ coupon_id }). Pull redemption analytics by combining coupon details with click-audience tracking.
🔌 Webhook (2 tools)
Test your OA's webhook URL and surface LINE's signature verification result, plus set/get the webhook endpoint — quick to wire up or diagnose "why isn't my bot responding?".
👤 Operations (5 tools)
User profile lookup, follower listing, multi-OA listing and switching, and run_on_many_oas for agencies that need to run a read-only tool across all client OAs in parallel.
💻 LIFF & Token (2 tools)
Manage LIFF app lifecycle (create / update / delete / list) and verify your channel access token's validity, expiry, and scope.
🛍️ LINE Shopping (14 tools — v2.0, opt-in)
Turn your agent into a storefront operator. These register only when a MyShop API key is configured (see Configuration) — messaging-only users never see them. Powered by the MyShop Open API (X-API-KEY, no webhook/server required).
Products (7): list, create, update, delete, change price, show/hide, and manage variants — e.g. "เพิ่มสินค้าเสื้อยืด 299 บาท สต็อก 50", "ลดราคาคอลเลกชันนี้ 15%".
Inventory (1): set / increase / decrease stock — "เติมสต็อก V9 อีก 50".
Orders (4): list/search (with polling for new orders via a scheduled task), get detail, fulfill (mark shipped + tracking, mark COD paid, print parcel label), and cancel — "ออกใบปะหน้าให้ออเดอร์ที่จ่ายแล้ววันนี้".
Settlement + Checkout (2): see real income after fees, and create a checkout link to close the sale in chat — "ลูกค้าอยากได้ 2 ชิ้น สร้างลิงก์จ่ายเงิน".
📘 Full Thai guide: docs/myshop-guide-th.md — get the API key, every tool explained, real workflows, safety rules, and troubleshooting.
Resources — auto-refreshing OA snapshot, Flex template catalog, sticker catalog with mood-keyword index, and a Thai festival calendar with marketing promo patterns.
Prompts — guided workflows for daily reports, campaign building, broadcast scheduling, rich menu diagnosis, coupon campaigns, LINE Notify migration, and webhook setup.
Quick Start
Requirements
Node.js 20 or later
A LINE Official Account with Messaging API enabled
A Channel Access Token
No database, no Playwright, no CDN, no public URL, no scheduler infrastructure required.
Step 1 — Get your Channel Access Token
Open the LINE Developers Console.
Pick your provider → open (or create) a Messaging API channel.
Open the Messaging API tab → scroll to Channel access token → click Issue.
Copy the long-lived token. Treat it like a password.
If you don't yet have a LINE Official Account, follow LINE's getting started guide.
Step 2 — Add the MCP server to your AI host
Paste the following block into your host's MCP config file (see table below):
{
"mcpServers": {
"line": {
"command": "npx",
"args": ["-y", "line-oa-mcp-ultimate"],
"env": {
"LINE_CHANNEL_ACCESS_TOKEN": "YOUR_TOKEN_HERE"
}
}
}
}Where to find the config file:
Host | Where to add it |
Claude Cowork | Settings → Developer → Local MCP servers → Edit Config |
Claude Desktop (macOS) |
|
Claude Desktop (Windows) |
|
Claude Code | Run |
Cursor / Codex / ChatGPT desktop | See your host's MCP setup docs — same JSON shape |
⚠️ Don't replace existing MCP servers. Add the
"line"entry alongside any existing entries insidemcpServers.
Step 3 — Restart your AI host
Quit completely (Cmd+Q on macOS) and reopen. On first start the host runs npx -y line-oa-mcp-ultimate, downloads the package from npm, and caches it for subsequent starts.
Step 4 — Verify
In a new chat, try:
Show my LINE OA statusor in Thai:
ดูสถานะ OA หน่อยYou should see a health card with friend count, monthly quota, webhook status, and the default rich menu. That's it — you're now operating your LINE OA from your AI agent.
🛍️ Want LINE Shopping too? (optional)
Add LINE_MYSHOP_API_KEY to the same env block (get it from oaplus.line.biz → Settings → API keys, Admin role). The full config looks like this:
{
"mcpServers": {
"line": {
"command": "npx",
"args": ["-y", "line-oa-mcp-ultimate"],
"env": {
"LINE_CHANNEL_ACCESS_TOKEN": "YOUR_TOKEN_HERE",
"LINE_MYSHOP_API_KEY": "YOUR_MYSHOP_API_KEY_HERE"
}
}
}
}Restart your host — that unlocks 14 shopping tools (products, inventory, orders, parcel labels, settlements, checkout links). Without the key, the server stays messaging-only. See LINE Shopping, the full Thai MyShop guide, and Image hosting.
Configuration
Single-OA mode (default — for most users)
That's the Step 2 snippet above. One environment variable, one OA. Suitable for individual creators, course makers, and most SMB owners.
Multi-OA mode (for agencies)
If you manage several LINE OAs (your own plus client accounts), create a JSON config file at ~/.line-mcp/config.json — the server auto-discovers it, so there's nothing to clone or build:
mkdir -p ~/.line-mcp
nano ~/.line-mcp/config.json # or: code ~/.line-mcp/config.json📘 Full walkthrough (two placement options + security notes) in
docs/multi-oa-setup-th.md. A ready-to-edit template lives inconfig.example.json.
Fill in one entry per OA:
{
"default_oa": "main",
"oas": {
"main": {
"channel_access_token": "TOKEN_1",
"display_name": "Main OA",
"region": "TH",
"myshop_api_key": "MYSHOP_KEY_1"
},
"client_a": {
"channel_access_token": "TOKEN_2",
"display_name": "Client A — Bangkok Cafe"
}
}
}🛍️ LINE Shopping (v2.0): add
"myshop_api_key"to any OA to enable the 14 shopping tools for it (get it fromoaplus.line.biz→ Settings → API keys, Admin role). In single-OA mode, set the env varLINE_MYSHOP_API_KEYinstead. OAs without a key simply keep the messaging tools — the shopping tools never appear and never error.
Then drop the LINE_CHANNEL_ACCESS_TOKEN env var from your MCP config — the server discovers ~/.line-mcp/config.json automatically.
Resolution order:
LINE_MCP_CONFIGenv var (custom path)~/.line-mcp/config.jsonLINE_CHANNEL_ACCESS_TOKENenv var (single-OA fallback)
Switching the active OA at runtime
Ask your AI host:
"Switch to client_a"
→ line_use_oa({ oa_id: "client_a" })Or override per-call with the oa parameter on any tool.
Advanced — HTTP transport (self-hosted)
For agencies and always-on servers, the server also supports Streamable HTTP — run one instance per agent/teammate (the active OA switched by line_use_oa is shared per instance). See docs/http-transport.md.
🖼️ Images & Rich Messages — zero setup (v2.2)
Before 2.2, sending one Rich Message meant: resize your artwork into five exact sizes, find hosting, upload, paste URLs — the step where most shop owners simply gave up. Now the whole workflow is:
Attach a picture. Say "send this as a Rich Message". Done.
What you get, without doing anything:
📐 Every size LINE requires — prepared automatically.
🌍 Your image made reachable for LINE — automatically, wherever you run: your laptop, a server, anywhere. Nothing to sign up for, nothing to configure.
✅ Verified before "success" — the tool checks that LINE can actually pull every size before it ever tells you the send worked. The classic "API said success but customers see a blank image" problem is gone.
🧰 Never a dead end — on locked-down networks where automation isn't possible, you instantly get a ready-made package + 1-minute Thai instructions instead of an error.
One honest rule to remember: LINE collects the image when each customer first opens the message — so keep your machine on until your audience has seen it (the built-in 24-hour window covers a normal broadcast day). Once opened, the image lives on LINE's side permanently.
Full guide + troubleshooting (Thai): docs/image-hosting-th.md
Prefer hosting yourself (agencies, long-running campaigns)? Everything still works the classic way — every image tool accepts a public, direct HTTPS URL to a JPEG/PNG:
✅ Recommended: Cloudflare R2, AWS S3 (public bucket),
raw.githubusercontent.com, Cloudinary, ImageKit — stable, direct URLs.⚠️ Avoid: Google Drive / Dropbox share links — they return an HTML preview page, not a direct image. (The
source_urlinput rewrites these to direct-download form automatically.)
Documentation
Doc | What's in it |
Thai-language quick start (5-minute walkthrough) | |
📨 Messaging full guide — Thai. The messaging tools explained, transports & send modes, real workflows, safety limits, and troubleshooting | |
🛍️ LINE Shopping (MyShop) full guide — Thai. Get the API key, all 14 tools explained, real end-to-end workflows, safety rules, and troubleshooting | |
Per-host MCP setup — Cowork / Claude Desktop / Cursor / Codex (Thai) | |
🖼️ Images & Rich Messages with zero hosting (v2.2) — EN + Thai: how it works, the first-view rule, troubleshooting | |
Multi-OA configuration guide (Thai) | |
Test a local build in Claude Cowork before publishing (Thai) | |
Streamable HTTP transport for self-hosted / remote use | |
Security policy (EN) · threat-model guide for shop owners (Thai) | |
Runnable examples |
🔐 Security
This server operates with live channel access tokens — whoever holds the token is your shop. Treat your MCP config like a password store.
Report vulnerabilities privately via GitHub Security Advisories — see SECURITY.md for scope, response times, and what to include. Please don't open public issues for security problems.
Thai threat-model guide for shop owners: docs/security-th.md — what a leaked token can do, per-OA token isolation, and config-file permissions.
HTTP transport requires auth beyond localhost: binding to any non-loopback host (e.g.
0.0.0.0) requiresMCP_HTTP_TOKEN— every request must then carryAuthorization: Bearer <token>. Without the token the server refuses to expose itself beyond127.0.0.1. Details in docs/http-transport.md.
Versioning
This project follows Semantic Versioning. Current release: v2.2.2 (docs-only republish of 2.2.1) — full history in CHANGELOG.md.
Latest changes (v2.2.1): HTTP transport fixed for real MCP clients — every request now gets its own server instance (overlapping requests no longer 500), non-POST methods answer a clean 405, and self-hosted images serve immutable cache headers + ETag/304 so a reverse proxy or CDN can absorb an entire broadcast wave. Reported from production by Norapat Limpagan — thank you! See CHANGELOG.md.
Previously (v2.2.0): Image Hosting Layer — attach a picture and line_prepare_image resizes it to every size LINE needs, hosts it automatically (own server / quick tunnel / manual-package fallback), and verifies every size is reachable before ever reporting success; line_image_host_status gives a read-only health check.
Previously (v2.0.0): +14 LINE Shopping tools via the MyShop Open API — products, inventory, orders (incl. parcel labels), settlements, and checkout links. API-key only, no webhook/server, fully opt-in (registers only when a MyShop key is set) and non-breaking on the 34 messaging tools. See RELEASE_NOTES_v2.0.0.md.
Previously (v1.1.0): +10 tools completing LINE's token-only Messaging API surface (rich-menu lifecycle, Rich/Card message builders, audience update, webhook set/get, narrowcast progress, token check). See RELEASE_NOTES_v1.1.0.md.
Roadmap
v1.x — Full token-only Messaging API coverage: outbound + rich-menu lifecycle + Rich/Card message builders + audiences + insights + coupons.
v2.0 — ✅ LINE Shopping (MyShop Open API) shipped — products, inventory, orders, parcel labels, settlements, and checkout links (API-key only, no webhook). See RELEASE_NOTES_v2.0.0.md.
v2.1 — ✅ "Trust Release" shipped — Rich Menu Studio (image generation + preview), HTTP bearer auth, security policy + hardening, CI/CD with provenance, coverage-gated test suite. See CHANGELOG.md.
v2.2 — ✅ "Zero-Hosting Release" shipped — attach a picture, say send: auto-resize to all 5 Rich Message sizes, automatic hosting (own server / quick tunnel / manual package — nobody dead-ends), every size verified reachable before success. See CHANGELOG.md.
Future direction is guided by real-world usage and community feedback.
Contributing
PRs are welcome. Please open an issue first to discuss substantial changes.
The one rule: a new tool ships with new tests. Every tool is exercised through a real in-memory MCP client with the LINE API mocked at the fetch boundary (see tests/helpers/) — no live token needed to run the suite.
npm ci
npm run typecheck # strict TypeScript, no `any`
npm test # vitest run
npm run test:coverage # coverage — ≥80% lines, enforced in CI
npm run buildWhen contributing:
Tool names:
line_{action}_{resource}(snake_case, prefixline_).Tool descriptions: English (for LLMs) — Thai examples encouraged.
User-facing strings: Thai-friendly (centralized in
src/i18n/th.ts).Pre-flight validation on every send tool.
Quota Guardian + Quiet Hours on every consumption tool.
Backward compatibility is non-negotiable — never rename or remove existing tools, params, response fields, env vars, or config keys.
PR expectations: CI must be green (test workflow — typecheck, tests with coverage, build on Node 20 & 22), and behavior changes come with a matching CHANGELOG.md line under Unreleased.
Releasing (maintainers)
Move the Unreleased section of CHANGELOG.md to the new version and bump
package.json.git tag vX.Y.Z && git push origin vX.Y.Z.The release workflow runs the full gate (typecheck + tests + build), publishes to npm with
--provenance, and creates a GitHub Release from the matching CHANGELOG section. It needs one repo secret:NPM_TOKEN(npm granular access token with publish rights on this package).
Author
Dr. Wasin Treesinthuros (พี่โต / Dr. Wasin / #จารโต)
CEO at Innovation Vantage
Founder at ForgeAI — AI Transformation Studio
LINE Certified Coach 2026
AI Transformation educator, SaaS builder, university lecturer
This project is part of a broader mission to bring production-grade AI automation to every Thai practitioner — regardless of technical background.
GitHub: @wasintoh
License
MIT © Dr. Wasin Treesinthuros — Innovation Vantage / ForgeAI
Available Tools
37 toolsline_build_audience_from_csvBuild LINE audience from user IDsA
Create a LINE audience by uploading user IDs (or IFAs) — the "CSV from Google Sheets → retargeting audience" flow most Thai SMBs need. LINE indexes for ~5-10 min after creation (line_list_audiences shows IN_PROGRESS then READY). user_ids max 10,000/call; is_ifa true for IFA values instead of LINE user IDs. Region-gated to JP/TW/TH OAs (+premium).
Returns { audience_group_id, name, type, created_unix_ms }.
Example: "สร้าง audience ลูกค้าเดือนก่อน" → { name:"buyers_last_month", user_ids:[...] }.
Inputs: name (required), user_ids (required), oa, is_ifa.
line_build_audience_from_engagementBuild retargeting audience from prior engagementA
Create a LINE audience from people who clicked or opened a previous broadcast/narrowcast — retarget without a CRM. source_request_id is the request_id returned by a prior line_send_message; type 'clicks' (default, optional click_url filter) or 'opens'. The source message must be ≥24h old before the audience is reliable, needs ~50+ users to be usable in narrowcast, and is region-gated to JP/TW/TH (+premium). Feed the resulting audience back into line_send_message target.audience.
Returns { audience_group_id, name, type }.
Inputs: name (required), source_request_id (required), oa, type, +1 more.
line_check_tokenCheck LINE Token ValidityARead-onlyIdempotent
Verify the active OA's channel access token (GET /oauth2/v2.1/verify) — reports bound client_id, remaining lifetime, and granted scope; warns (Thai) when <7 days remain. Run before a campaign: a token expiring mid-send fails silently. An invalid/expired token surfaces a 401 error (no { valid:false } shape).
Returns { valid, client_id, expires_in_seconds, expires_in_days, scope?, warning? }.
Inputs: oa.
line_delete_audienceDelete LINE audienceADestructiveIdempotent
Delete an audience group. Irreversible — requires confirm=true. audience_group_id (numeric) from line_list_audiences.
Returns { success, deleted_id }.
Inputs: audience_group_id (required), oa, confirm.
line_design_cardDesign LINE Card Message (Template)ARead-onlyIdempotent
Build a validated LINE Template message (LINE OA Manager calls it a "Card Message") and return it as JSON to hand to line_send_message via message.message_json. DESIGN ONLY — never calls the LINE API.
kind (required) picks the subtype and enforces LINE limits:
buttons → title?, text, thumbnail_image_url?, actions (1..4 buttons; text ≤60 chars with title/thumb, else ≤160)
confirm → text + exactly 2 buttons (e.g. ตกลง / ยกเลิก)
carousel → columns (≤10, each ≤3 buttons); EVERY column must have the SAME number of buttons (LINE rule)
image_carousel → columns of { image_url (HTTPS), action } (≤10) Actions: uri | message | postback; label ≤20 chars. alt_text (1..400) required.
Returns { message, usage_hint }.
Example: "การ์ดยืนยันการจอง ตกลง/ยกเลิก" → { kind:"confirm", alt_text:"ยืนยันการจอง", text:"ยืนยันคิว 14:00 ไหม?", actions:[{type:"postback",label:"ตกลง",data:"confirm=1"},{type:"message",label:"ยกเลิก",text:"ยกเลิก"}] }.
Inputs: kind (required), alt_text (required), text, title, +3 more.
line_design_flexDesign LINE Flex MessageARead-onlyIdempotent
Compose a validated Flex Message for line_send_message. Modes: template mode { template, data } (Thai-localized, recommended; templates: receipt, voucher, shipping_update, order_confirm, appointment_reminder, promo_simple, course_cert, thank_you); raw mode { flex_json, alt_text } (advanced); or { list_templates: true } to get the catalog with Thai descriptions + required fields per template. DESIGN ONLY — never calls the LINE API.
Feed the result to line_send_message via message.flex_json, or pass { template, data } straight to line_send_message (same templates). Returns { flex_json, alt_text, preview_url (Flex Simulator), size_bytes, warnings[] } (warns near the 30KB bubble limit).
Example: "ออกแบบคูปอง 20% หมด 31 ส.ค." → { template:"voucher", data:{ title:"ส่วนลดวันแม่", code:"MOM20", discount:"ส่วนลด 20%", valid_until:"31 ส.ค. 2026" } }.
Inputs: data, alt_text, template, flex_json, +1 more.
line_design_imagemapDesign LINE Imagemap (Rich Message)ARead-onlyIdempotent
Build a validated Imagemap message (LINE OA Manager calls it a "Rich Message") and return it as JSON to hand to line_send_message via message.message_json. DESIGN ONLY — never calls the LINE API.
Image hosting — two paths: (1) RECOMMENDED: run line_prepare_image first and pass its prepared_key here (hosting + the 5 size variants + verification all handled; base_height auto-derived). (2) Self-hosted: pass base_url of a public HTTPS host serving ${base_url}/1040, /700, /460, /300, /240 (LINE has NO upload API) plus base_height. Canvas width is always forced to 1040; all area coordinates are px on that 1040-wide canvas and must fit inside 1040 × base_height. Optional video area supported.
Returns { message, usage_hint }.
Example (prepared): "ส่งรูปนี้เป็น Rich Message ครึ่งบน-ครึ่งล่าง" → line_prepare_image first, then { prepared_key:"ab12…", alt_text:"โปรเดือนนี้", areas:[{bounds:{x:0,y:0,width:1040,height:520},action:{type:"uri",uri:"https://shop.example.com/a"}},{bounds:{x:0,y:520,width:1040,height:520},action:{type:"uri",uri:"https://shop.example.com/b"}}] }. Example (self-hosted): same but { base_url:"https://cdn.example.com/promo", base_height:1040 } instead of prepared_key.
Inputs: areas (required), alt_text (required), video, base_url, +2 more.
line_estimate_send_costEstimate LINE send costARead-onlyIdempotent
Estimate how many quota messages a planned send will consume, without sending. Useful before confirmation, especially for narrowcast/broadcast. target uses the same shapes as line_send_message; message_count (1-5, default 1) — LINE charges message_count × recipients. Recipients are exact for user_id(s), looked up for a numeric audience, and unknown for filter/everyone (recommends a line_send_message dry_run instead).
Returns { estimated_recipients?, estimated_cost_messages?, quota, cost_share_percent?, notes[] }.
Inputs: target (required), oa, message_count.
line_find_stickerFind LINE sticker by mood/keywordARead-onlyIdempotent
Find LINE stickers from a curated catalog by mood or keyword (Thai or English). Bots may only send stickers from LINE's limited official list, so this picks by intent ("celebration", "ขอบคุณ", "sorry") instead of guessing IDs. Pass the chosen package_id + sticker_id to line_send_message via message.sticker.
Returns { query, count, stickers:[{ package_id, sticker_id, moods, keywords_th, keywords_en, description }] }.
Inputs: query (required), limit, response_format.
line_get_coupon_statsGet LINE coupon redemption statsARead-onlyIdempotent
Read available stats for a LINE coupon. LINE has no dedicated redemption endpoint, so this combines signals: raw coupon detail (some accounts include usage inline) plus, if you pass click_audience_id, the click-audience size as a clickthrough proxy. coupon_id comes from line_manage_coupon. Caveat (surfaced in notes): click-audience size approximates clickthroughs, NOT actual redemptions — for real counts build the coupon Flex with a postback action and listen via webhook.
Returns { coupon_id, raw, click_audience?, estimated_redemptions?, notes[] }.
Inputs: coupon_id (required), oa, response_format, click_audience_id.
line_get_message_statsGet LINE message engagement statsARead-onlyIdempotent
Fetch per-broadcast engagement for a request_id (from a prior line_send_message): impressions, opens, clicks, CTR, and per-URL click breakdown. Caveats (in notes): ~24h data lag (stats stabilize ~T+1); below ~20 unique users LINE returns null for privacy; available only for narrowcast/multicast/broadcast, not reply or push-to-single-user.
Returns { request_id, delivered?, unique_impression?, unique_click?, ctr_percent?, per_url_clicks[], notes[] }.
Inputs: request_id (required), oa, response_format.
line_get_narrowcast_progressGet LINE Narrowcast ProgressARead-onlyIdempotent
Poll the delivery progress of an async narrowcast (GET /v2/bot/message/progress/narrowcast). Narrowcast runs in the background — the send returns a request_id and this reports how far it got. Pass that request_id.
Returns { request_id, phase (waiting|sending|succeeded|failed), status_text, success_count?, failure_count?, target_count?, error_code?, accepted_time?, completed_time? }.
Inputs: request_id (required), oa.
line_get_oa_reportGet LINE OA Report (multi-day digest)ARead-onlyIdempotent
Digest of LINE OA performance over a date range — bundles 8+ Insight API calls into one Thai-friendly markdown report. range: a preset ('today'|'yesterday'|'this-week'|'last-week'|'this-month'|'last-month', default 'last-week') or { from, to } as YYYY-MM-DD. LINE insight data lags T-2 (yesterday is the latest reliable date) and is masked below the ~20-user privacy floor; demographics populate only with enough consented friends (report surfaces these in notes).
Returns { oa_id, range, delivery{total,daily[]}, followers, demographic_available, quota, notes[] }.
Inputs: oa, range, response_format.
line_get_oa_statusGet LINE OA StatusARead-onlyIdempotent
Quick health check of a LINE OA — friend count, monthly quota usage, webhook status, and current default rich menu, aggregating 4 LINE API calls into one card. Good as the first call of a session: current quota and webhook state inform every later decision (send, schedule, switch OA).
Returns { oa, friends?, quota, webhook, default_rich_menu?, region?, health:'OK'|'WARNING'|'ERROR', warnings[] }.
Inputs: oa, response_format.
line_get_user_profileGet LINE User ProfileARead-onlyIdempotent
Fetch a LINE user's profile (display name, picture, status message, language) by user_id. Only works if the user has added the bot, has not blocked it, and consented to share profile — any failure returns an ambiguous 404, surfaced as a clear Thai explanation.
Returns { user_id, display_name, picture_url?, status_message?, language? }.
Inputs: user_id (required), oa, response_format.
line_image_host_statusImage hosting status (providers, tunnel, store)ARead-onlyIdempotent
Report the Image Hosting Layer's current state: which provider line_prepare_image would use (self / local-tunnel / handoff), whether a cloudflared tunnel is live (URL + expiry), how the cloudflared binary would be obtained, and in-memory store usage. READ-ONLY — never starts a tunnel or downloads anything.
Use when line_prepare_image fell back to handoff, a verify failed, or the user asks "why can't it host automatically?". Returns { providers, tunnel, store }.
Inputs: no named parameters.
line_list_audiencesList LINE AudiencesARead-onlyIdempotent
List audience groups on the OA — including ones created in LINE OA Manager UI (chat-tag, friend-path, web-traffic) that CANNOT be created via Messaging API. status: READY (usable in narrowcast now) | IN_PROGRESS (indexing, wait ~10 min) | FAILED | EXPIRED (both need recreate). Filter with status_filter (default 'all') and name_contains (case-insensitive); paginate with limit/page (default 20).
Returns { total, count, page, audiences:[{ audience_group_id, name, status, audience_count?, created, type? }], has_more }.
Inputs: oa, page, limit, name_contains, +2 more.
line_list_followersList LINE OA followersARead-only
Page through every user that has added the OA as a friend. Region-gated: only TH/JP/TW OAs on premium tier — others get LINE 403. page_size 1-1000 (default 300); continuation_token for cursor pagination. For very large OAs (50k+), prefer an engagement audience via line_build_audience_from_engagement over pulling all IDs.
Returns { user_ids[], count, has_more, next_continuation_token? }.
Inputs: oa, page_size, response_format, continuation_token.
line_list_oasList LINE OAs configuredARead-onlyIdempotent
List all LINE Official Accounts available to this MCP instance (from the multi-OA config file, or single-OA env mode). Call before line_use_oa to discover OA IDs.
Returns { active_oa, oas:[{ id, display_name?, region?, is_premium?, is_active }] }.
Inputs: response_format.
line_manage_couponManage LINE OA couponsA
Coupon CRUD on a LINE OA (POST /v2/bot/coupon). modes: create (maps friendly inputs to LINE's schema — dates to UNIX seconds, visibility, etc.), list, get (by coupon_id), discontinue (ends a live coupon; irreversible — requires confirm=true). Deliver a created coupon via line_send_message message.coupon_id. Rate limit: shared 200 req/sec bucket with multicast.
create data: title (≤60, required); discount_type 'percentage'(default)|'fixed'|'explicit' with discount_value (or price_before/price_after for explicit); valid_from/valid_to accept UNIX seconds | 'YYYY-MM-DD' | ISO; visibility PUBLIC|UNLISTED (default UNLISTED); acquisition_type normal|lottery.
Example: "Early Bird ลด 20% 1–8 มิ.ย." → { mode:"create", data:{ title:"Early Bird", discount_type:"percentage", discount_value:20, valid_from:"2026-06-01", valid_to:"2026-06-08", coupon_code:"EARLYBIRD" } }. "ปิด coupon C123" → { mode:"discontinue", coupon_id:"C123", confirm:true }.
Inputs: mode (required), oa, data, confirm, +2 more.
line_manage_liff_appManage LIFF appsA
LIFF app lifecycle CRUD. modes: create (needs config.view {type,url}), list, update (liff_id + partial config), delete (liff_id + confirm=true). Auth note: LIFF Server API uses LINE Login channel tokens; this uses the same Messaging API token — for separate-channel setups see docs.
Example: "สร้าง LIFF tall https://my.app" → { mode:"create", config:{ view:{ type:"tall", url:"https://my.app" } } }.
Inputs: mode (required), oa, config, confirm, +1 more.
line_prepare_imagePrepare an image for LINE (resize + host + verify)A
Make any image sendable to LINE with ZERO hosting knowledge: resizes to the imagemap widths (1040/700/460/300/240), hosts them via the best available provider, HEAD-verifies every size, and returns a prepared_key that line_design_imagemap / line_send_message accept directly.
Provider chain (auto-selected, user never configures): self (HTTP deployments with MCP_PUBLIC_URL) → local-tunnel (default for stdio installs; free cloudflared quick tunnel, outbound-only so it works behind NAT) → handoff (a zip + Thai step-by-step manual instructions — nobody dead-ends).
Why this exists: LINE has no upload API for message images; they must sit on public HTTPS. IMPORTANT (live-verified 2026-07-31): LINE fetches the image when each recipient FIRST VIEWS the message — NOT at send time. Keep this MCP process (and the machine) running until most recipients have opened the message; once viewed, LINE's cache serves the image permanently (survives host shutdown and even device restarts). Default keep-alive: 24h.
Returns { prepared_key, provider, base_url?, image_url?, preview_image_url?, verified, expires_at?, handoff?, warnings }. NEVER claims false success: every returned URL was verified reachable; if verification fails (e.g. the network blocks the tunnel), the tool automatically tears the tunnel down and returns the handoff package instead.
Example: "ส่งรูปนี้เป็น Rich Message" → 1) line_prepare_image { image: { file_path: "/Users/me/promo.png" } } → 2) line_design_imagemap { prepared_key, alt_text, areas } → 3) line_send_message { message: { message_json } }.
Inputs: image (required), purpose, keep_alive_hours.
line_run_on_many_oasRun a tool across many LINE OAsARead-onlyIdempotent
Agency feature — run any read-only line_* tool across many OAs in parallel; per-OA errors are isolated (one bad token doesn't break the run). tool must be one of the supported read-only tools below; oa_ids an array or 'all' (default); parallel concurrency 1-10 (default 5).
Supported tools:
line_get_oa_status
line_get_oa_report
line_list_audiences
line_list_rich_menus
line_test_webhook
Returns { tool, count_ok, count_failed, results[], errors[] }.
Example: "เช็คสถานะทุก OA" → { tool:"line_get_oa_status", oa_ids:"all" }.
Inputs: tool (required), oa_ids, parallel, response_format.
line_send_messageSend LINE Message (universal)A
Universal LINE sender. Auto-picks the API (reply/push/multicast/narrowcast/broadcast) from the target shape; message shape selects text/template/flex/sticker/coupon/image/video. Feed pre-built objects from line_design_imagemap/line_design_card/line_design_flex via message.message_json; native coupons from line_manage_coupon via message.coupon_id; images hosted by line_prepare_image via message.image.prepared_key (no URLs needed).
mode: send_now (default) sends immediately; draft returns a LINE OA Manager handoff package (URL + Flex JSON + steps) — use when the user wants to SCHEDULE, since the Messaging API can't schedule but the OA Manager UI can; dry_run validates + estimates cost without sending.
Safety: pre-flight /validate before spending quota; Quota Guardian blocks if projected cost >95% of remaining quota unless confirm=true; broadcast { everyone:true } requires confirm=true; quiet-hours 22:00–08:00 BKK warns unless force=true; quiet_push silences the recipient device; reply tokens expire ~1 min (falls back to a push hint).
Returns send_now → { success, transport, request_id?, recipient_count_estimated, quota, warnings[] }; draft and dry_run return their own shapes. Narrowcast needs ~24h before line_get_message_stats shows engagement.
Example: "ส่งโปรให้ผู้หญิง 25-44 กรุงเทพ" → target.filter { genders:["female"], ages:["age_25","age_30"], areas:["bangkok"] }.
Inputs: target (required), message (required), oa, mode, +3 more.
line_set_webhook_endpointSet LINE Webhook EndpointAIdempotent
Read or write the LINE OA's webhook URL (PUT/GET /v2/bot/channel/webhook/endpoint). mode 'set' (needs endpoint: public HTTPS, ≤500 chars) or 'get'. Complements line_test_webhook — set here, then ping with line_test_webhook.
Returns { endpoint, active } (re-read after a 'set' to confirm).
Inputs: mode (required), oa, endpoint.
line_test_webhookTest LINE Webhook EndpointAIdempotent
Ping the OA's webhook URL from LINE servers and report HTTP status + latency; LINE checks it returns 200 within timeout and that signature verification works. Use this FIRST whenever a bot stops responding, before debugging anything else. Pass override_endpoint to test a URL other than the configured one. reason surfaces LINE's result: INVALID_REPLY | UNAUTHORIZED (bad channel_secret signature) | SERVER_ERROR (5xx) | TIMEOUT (>10s) | SSL_ERROR.
Returns { success, status_code, latency_ms?, reason, configured_endpoint?, tested_endpoint }.
Inputs: oa, override_endpoint.
line_update_audienceUpdate LINE AudienceA
Mutate an existing LINE audience group. modes: add_users (append user_ids) | rename (set description). audience_group_id from line_list_audiences. Only Messaging-API-created (upload) audiences accept mutation — audiences built in LINE OA Manager UI (chat-tag, friend-path, web-traffic) are read-only and LINE will reject changes.
Returns add_users → { mode, audience_group_id, added_count }; rename → { mode, audience_group_id, new_description }.
Example: "เพิ่ม 3 คนเข้า audience 12345" → { mode:"add_users", audience_group_id:12345, user_ids:["U1","U2","U3"] }.
Inputs: mode (required), audience_group_id (required), oa, user_ids, +1 more.
line_use_oaSwitch active LINE OAAIdempotent
Switch which OA all subsequent tool calls default to (until changed or process restart). In-memory only — does not edit config.json. oa_id from line_list_oas.
Returns { active_oa, display_name }.
Inputs: oa_id (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 37 tools
Most tools are clearly organized by resource and action, and the descriptions are detailed enough to guide selection. A few pairs overlap in purpose—line_estimate_send_cost vs. line_send_message's dry_run, and line_get_coupon_stats vs. line_manage_coupon get—and the three rich-menu creation/update tools require close reading to choose correctly.
The set follows a strong line_<verb>_<noun> convention with consistent clusters like list_*, get_*, delete_*, build_*, design_*, and manage_*. Minor deviations such as line_image_host_status (missing the get_ prefix) and the build vs. design distinction for rich menus keep it from being perfectly uniform.
37 tools is well into the 'too many' range and would be heavy for an agent to navigate in a single context. While the breadth is understandable for an 'ultimate' LINE OA server, several helpers (image_host_status, find_sticker, design_*, estimate_send_cost) could plausibly be consolidated or surfaced as sub-modes.
The tool surface covers the major LINE OA lifecycles—messaging, rich menus, audiences, coupons, LIFF, webhooks, analytics, and multi-OA operation—with very few dead ends. Minor gaps like missing audio/file message types, no coupon update path, and reliance on list endpoints for some single-resource lookups keep it from a perfect score.
Maintenance
Related MCP Connectors
Build and run agents and automations across hundreds of apps using natural language.
Create AI agents that answer customers on WhatsApp, Instagram, Messenger, TikTok and web chat.
Messaging infrastructure for AI agents across iMessage, WhatsApp, Telegram and SMS.
Run WhatsApp Business campaigns from any AI assistant: contacts, segments, and broadcasts.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to operate one or many LINE Official Accounts through natural language — sending broadcasts, Flex/Rich/card messages, building rich menus, coupons, audiences, insights, and LINE Shopping operations, with pre-flight quota checks and quiet-hour guardrails.141 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to operate one or many LINE Official Accounts through natural language — sending broadcasts, Flex and tappable Rich Messages, building Thai-ready rich menus, managing coupons, audiences, insights, and LINE Shopping storefronts. It handles Messaging API calls, pre-flight quota and quiet-hour guardrails, and Thai-localized templates so routine OA work happens by intent instead of clicking through a web console.141 npmMIT
- AlicenseNot gradedqualityAmaintenanceLets AI agents operate one or many LINE Official Accounts through natural language, covering broadcasts, Flex and Rich Messages, rich menus, coupons, audiences, insights, and LINE Shopping. It handles LINE Messaging API calls, image hosting, quota guardrails, and Thai localization so users can manage their OA by intent.141 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to operate one or many LINE Official Accounts through natural language, covering broadcasts and other message types, Flex/Rich/Card message design, rich menus, audiences, insights, coupons, webhooks, LIFF, and LINE Shopping. Includes pre-flight quota safety, quiet-hour warnings, zero-setup image hosting for Rich Messages, and Thai-localized templates and error messages.141 npmMIT