@mulmobridge/line
v1.1.1
Published
LINE bridge for MulmoBridge — connect a LINE bot to MulmoClaude
Readme
@mulmobridge/line
Experimental — please test and report issues.
LINE bridge for MulmoClaude. Uses webhook events — requires a public URL (ngrok for development).
Setup
1. Create a LINE Messaging API Channel
- Go to LINE Developers Console → create a Provider → create a Messaging API channel
- Note the Channel secret (Basic settings tab)
- Issue a Channel access token (Messaging API tab → long-lived)
2. Set up ngrok (for development)
ngrok is a tunneling tool that exposes a local port to the internet so LINE's webhooks can reach your machine.
brew install ngrok
ngrok config add-authtoken <your-token> # from ngrok dashboard
ngrok http 3002
# Copy the https://xxxx.ngrok-free.app URL3. Configure the webhook
In the LINE Developers Console → Messaging API tab:
- Webhook URL:
https://xxxx.ngrok-free.app/webhook— the trailing/webhookis required (without it you get 404) - Use webhook: enabled
- Auto-reply messages: disabled (LINE Official Account settings → Auto-reply messages → OFF, otherwise you get double replies)
4. Run the bridge
# With mock server (testing)
npx @mulmobridge/mock-server &
LINE_CHANNEL_SECRET=... \
LINE_CHANNEL_ACCESS_TOKEN=... \
MULMOCLAUDE_AUTH_TOKEN=mock-test-token \
npx @mulmobridge/line
# With real MulmoClaude
LINE_CHANNEL_SECRET=... \
LINE_CHANNEL_ACCESS_TOKEN=... \
npx @mulmobridge/line5. Add the bot as a friend
Scan the QR code in the LINE Developers Console → Messaging API tab. Send a message — MulmoClaude replies.
Environment Variables
| Variable | Required | Description |
| --------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| LINE_CHANNEL_SECRET | Yes | Channel secret for signature verification |
| LINE_CHANNEL_ACCESS_TOKEN | Yes | Long-lived channel access token |
| LINE_BRIDGE_PORT | No | Webhook port (default: 3002; 0 asks the OS for a free port) |
| MULMOCLAUDE_API_URL | No | Default: auto (.server-port; waits if nothing is published) |
| MULMOCLAUDE_AUTH_TOKEN | No | Bearer token |
| LINE_BRIDGE_DEFAULT_ROLE | No | Role id to seed new bridge sessions with (e.g. coder, general). Applied ONLY when a line session first appears — once the user switches role via /role <id> the session's own role wins. Unknown role ids silently fall back to the server's default with a warn log. |
| BRIDGE_DEFAULT_ROLE | No | Same as above but shared across every bridge. Transport-specific LINE_BRIDGE_DEFAULT_ROLE wins when both are set. |
An unusable value (a typo, a number outside 0-65535) stops the bridge with a message naming the variable, rather than silently starting on the default. A port already in use is reported the same way (#3084).
Auth token persistence across server restarts
The MulmoClaude server regenerates a fresh bearer token on every startup and writes it to <workspace>/.session-token ($MULMOCLAUDE_WORKSPACE_PATH, or ~/mulmoclaude when unset), alongside the port it bound in .server-port.
The bridge follows a restart on its own. When the connection fails it re-reads both files, and if the server came back as a different generation — new token, new port, or both — it rebuilds its socket against it (#3078). You do not have to restart the bridge.
Pinning the token is still useful when the bridge runs on a different machine from the server, where it cannot read the workspace at all: set MULMOCLAUDE_AUTH_TOKEN to the same long random value on both sides. The server then uses it verbatim instead of regenerating.
# Server (one-time setup — same value across restarts)
MULMOCLAUDE_AUTH_TOKEN=long-random-string yarn dev
# Bridge (separate process / machine — same value)
MULMOCLAUDE_AUTH_TOKEN=long-random-string \
<bridge-specific-envs> \
npx <this-package>@latestRecommended: at least 32 characters of random data (the server logs a warning at startup for shorter values).
Notes
- LINE reply tokens expire in 1 minute. Since Claude responses can take longer, the bridge uses push messages instead of reply messages. This requires your bot to be a verified/certified account for push to work with all users, OR the user must have added the bot as a friend first.
- LINE limits messages to 5 per push call and ~5000 chars per message. Long replies are automatically chunked.
- Inbound media — text and image messages are forwarded to the agent. Image bytes are downloaded via the LINE Data API (
/v2/bot/message/<id>/content) using the same channel access token; the actual format (JPEG / PNG / HEIC depending on sender) is preserved via the response Content-Type. The photo-EXIF auto-capture flow (#1222) writes a sidecar atdata/locations/...when GPS data is present. Video / audio / file / sticker messages are not forwarded yet.
Detailed Setup Guide
For step-by-step instructions with troubleshooting:
Ecosystem
Part of the @mulmobridge/* package family.
Shared libraries:
@mulmobridge/client— socket.io client library used by every bridge below@mulmobridge/protocol— wire types and constants@mulmobridge/chat-service— server-side relay + session store@mulmobridge/relay— Cloudflare Workers webhook proxy@mulmobridge/mock-server— mock server for local bridge development
Bridges (one npm package per platform):
@mulmobridge/bluesky— Bluesky DMs over atproto@mulmobridge/chatwork— Chatwork (Japanese business chat)@mulmobridge/cli— interactive terminal bridge@mulmobridge/discord— Discord bot via Gateway@mulmobridge/email— IMAP poll + SMTP reply, threading preserved@mulmobridge/google-chat— Google Chat via MulmoBridge relay@mulmobridge/irc— IRC (Libera, Freenode, custom)@mulmobridge/line— LINE Messaging API via MulmoBridge relay ← this package@mulmobridge/line-works— LINE Works (enterprise LINE)@mulmobridge/mastodon— Mastodon DMs + mentions@mulmobridge/matrix— Matrix / Element@mulmobridge/mattermost— Mattermost@mulmobridge/messenger— Facebook Messenger via MulmoBridge relay@mulmobridge/nostr— Nostr NIP-04 encrypted DMs@mulmobridge/rocketchat— Rocket.Chat@mulmobridge/signal— Signal via signal-cli-rest-api@mulmobridge/slack— Slack Socket Mode@mulmobridge/teams— Microsoft Teams via Bot Framework@mulmobridge/telegram— Telegram bot@mulmobridge/twilio-sms— SMS via Twilio Programmable Messaging@mulmobridge/viber— Viber Public Account bots@mulmobridge/webhook— generic HTTP webhook bridge@mulmobridge/whatsapp— WhatsApp Cloud API via MulmoBridge relay@mulmobridge/xmpp— XMPP / Jabber@mulmobridge/zulip— Zulip
Related projects
Published from the MulmoClaude monorepo by Receptron.
- MulmoClaude — an open-source AI assistant platform that runs on your own computer. Claude Code as the engine, a personal wiki for long-term memory, schema-driven collections for your data, and chat that summons the right GUI (markdown, charts, forms, spreadsheets, wikis) for each task.
- MulmoTerminal — a terminal-first cockpit for running many AI coding agents in parallel. One roster showing every session's summary and PR status, tmux-backed session persistence, git-worktree isolation, one-click PRs, and mobile push with remote reply.
- MulmoTerminal manual — setup, workflows, feature reference, configuration, mobile notifications, and alternative / local model providers. Available in English and Japanese.
License
MIT
