Create Line Bot
БесплатноПоддерживаетсяScaffold a LINE bot that survives production (Next.js + Supabase + Vercel), with a built-in MCP server so Claude or Cursor can run it: queue health, retries, pu
Описание
Scaffold a LINE bot that survives production (Next.js + Supabase + Vercel), with a built-in MCP server so Claude or Cursor can run it: queue health, retries, push, Rich Menu.
README
Scaffold a LINE bot that survives production.
npx create-line-bot my-bot
Next.js 16 (App Router) + Supabase + Vercel. No @line/bot-sdk, no heavy imports in the webhook
path — because the webhook has five seconds and cold starts eat them.
Why this exists
Starting a LINE bot is easy. Keeping one alive is not. Every LINE bot I have shipped hit the same six problems, and none of them are in the quickstart:
| Problem | What this template does |
|---|---|
| LINE times out the webhook after 5 seconds, and a cold start with a fat SDK import eats most of it | Webhook verifies, writes one row, returns 200; work moves to a separate worker route via after() |
| LINE retries webhooks, and serverless functions can run twice | Four independent idempotency layers — event id, reply token, job claim, business dedupe key |
| A reply token is single-use; spending it twice throws | Conditional update claims the token before it is spent |
| Rich Menu uploads are not idempotent — run the script twice, get two menus | Name-based uploader that removes the previous menu first |
| LIFF ID tokens are trusted client-side far too often | Token is verified against LINE's API server-side on every link |
.env.local is not read by Vercel |
Deploy section spells out vercel env add per variable |
Operate it from Claude, Cursor or any AI agent
Every generated project comes wired to line-bot-ops-mcp, an MCP server that reads its own queue and database. Open the project in Claude Code and ask:
"Why did the bot stop replying?" →
line_queue_health,line_failed_jobs,line_retry_job"How many followers did we gain yesterday, and how much push quota is left?" "Switch user U123… to the seller menu."
Generic LINE MCP servers can send messages. This one also knows your webhook queue, so it can tell you why a message was never answered. Broadcast is off unless you opt in.
Already have a bot? Run the same server on its own: npx -y line-bot-ops-mcp.
What you get
src/app/api/line/webhook/route.ts signature verify + fast ack
src/app/api/line/worker/route.ts claim jobs, reply, retry safely
src/app/api/liff/link/route.ts server-side ID token verification
src/app/liff/page.tsx LIFF init + login
src/lib/line.ts signature, reply, push, verifyIdToken (fetch only)
src/lib/jobs.ts enqueue, claim, reply-token guard
scripts/rich-menu.ts idempotent Rich Menu uploader
.mcp.json Claude Code loads line-bot-ops-mcp automatically
supabase/migrations/0001_init.sql line_jobs, line_users, claim_line_jobs()
Setup
The generated project ships its own README with the full table of environment variables, the message-flow diagram, and the deploy steps. Short version:
npx create-line-bot my-bot
cd my-bot
npm install
cp .env.example .env.local # LINE + Supabase credentials
npm run db:push
npm run dev
Then set the channel webhook to https://<origin>/api/line/webhook.
The long-form versions
Each shortcut above started as a written-up incident:
- Surviving LINE's 5-second webhook timeout on Vercel
- Role-based LINE Rich Menu architecture
- Meta Pixel undercounts inside LIFF — use CAPI
- Why error.tsx misses async Server Component errors
- PDPA-strict analytics on Next.js + Supabase
- Pre-launch smoke test for Next.js + Supabase + Stripe
Upstream fixes
Fixes found while building this, sent back to LINE's own repositories:
- line/line-bot-mcp-server#635 — Flex message schema now accepts the documented
%, keyword and decimalpxsize values (merged)
Status
v0.2 — bot + LIFF + Supabase on Vercel, wired to an MCP server to run it from an AI agent. Issues and PRs welcome, especially from anyone running LINE bots at scale in Thailand or Japan.
Sponsor
LINE changes its Messaging API several times a year, and a scaffolder is only useful if what it generates still works on the day you run it. Sponsorship pays for keeping it that way: tracking API changes, re-testing the template against new Next.js and Supabase releases, and answering issues.
If your team runs a bot built from this, sponsor on GitHub.
Privacy
The CLI and the generated app send nothing to the maintainer. See PRIVACY.md.
License
MIT
Установить Create Line Bot в Claude Desktop, Claude Code, Cursor
unyly install create-line-botСтавит в Claude Desktop, Claude Code, Cursor и VS Code — сам разбирается с npx, uvx и сборкой из исходников.
Впервые? Поставь CLI: curl -fsSL https://unyly.org/install | sh
Или настроить вручную
Выполни в терминале:
claude mcp add create-line-bot -- npx -y create-line-botПошаговые гайды: как установить Create Line Bot
FAQ
Create Line Bot MCP бесплатный?
Да, Create Line Bot MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Create Line Bot?
Нет, Create Line Bot работает без API-ключей и переменных окружения.
Create Line Bot — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Create Line Bot в Claude Desktop, Claude Code или Cursor?
Открой Create Line Bot на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
Opencode Omniroute Plugin
OpenCode plugin for the OmniRoute AI Gateway. Drives dynamic model discovery, /connect auth flow, and multi-instance OmniRoute providers via the official @openc
автор: GitHub ActionsRoblox Studio
Enables AI coding tools to control Roblox Studio for workspace exploration, instance manipulation, and script management. It provides tools for playtesting, sce
автор: paralovAntigravity Drawio
MCP server that enables AI assistants to create, parse, render, and validate Draw.io diagrams programmatically.
автор: S-SUJAN-SFetch
Web content fetching and conversion for efficient LLM usage.
AWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
автор: modelcontextprotocolSpring AI MCP Server
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
llm-analysis-assistant
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
автор: xuzexin-hzMCP-Agent
A simple, composable framework to build agents using Model Context Protocol by [LastMile AI](https://www.lastmileai.dev)
автор: lastmile-aiSpring AI MCP Client
Provides auto-configuration for MCP client functionality in Spring Boot applications.
mcp.natoma.ai
A Hosted MCP Platform to discover, install, manage and deploy MCP servers by [Natoma Labs](https://www.natoma.ai)
Compare Create Line Bot with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории ai
