@mulmobridge/rocketchat
v1.1.1
Published
Rocket.Chat bridge for MulmoBridge — connect a Rocket.Chat server (DMs) to MulmoClaude via REST polling
Readme
@mulmobridge/rocketchat
Experimental — please test and report issues.
Rocket.Chat bridge for MulmoClaude. Polls each of the bot user's direct-message rooms via the Rocket.Chat REST API, forwards new messages to MulmoClaude, and posts replies back. Outbound-only — no public URL needed.
Setup
1. Create a bot user
On a server you own (e.g. a self-hosted Rocket.Chat), create a dedicated user for the bot. Public SaaS accounts work too.
2. Generate a personal access token
Log into Rocket.Chat as the bot user (or any account you want the bridge to impersonate) →
- Avatar → My Account → Personal Access Tokens
- Add — uncheck "Ignore Two Factor Authentication" for safety
- Copy the Token and User ID (shown only once)
3. Run the bridge
# Testing with mock server
npx @mulmobridge/mock-server &
ROCKETCHAT_URL=https://rocket.example.com \
ROCKETCHAT_USER_ID=... \
ROCKETCHAT_TOKEN=... \
MULMOCLAUDE_AUTH_TOKEN=mock-test-token \
npx @mulmobridge/rocketchat
# With real MulmoClaude
ROCKETCHAT_URL=https://rocket.example.com \
ROCKETCHAT_USER_ID=... \
ROCKETCHAT_TOKEN=... \
npx @mulmobridge/rocketchatDM the bot user from another Rocket.Chat account and you'll get a reply.
Environment variables
| Variable | Required | Default | Description |
|--------------------------------|----------|---------|-------------|
| ROCKETCHAT_URL | yes | — | Server URL, e.g. https://rocket.example.com |
| ROCKETCHAT_USER_ID | yes | — | Bot user ID (from Personal Access Tokens page) |
| ROCKETCHAT_TOKEN | yes | — | Personal access token |
| ROCKETCHAT_ALLOWED_USERS | no | (all) | CSV of usernames (without @) allowed to converse — empty = everyone |
| ROCKETCHAT_POLL_INTERVAL_SEC | no | 5 | Poll interval in seconds (min 2) |
| MULMOCLAUDE_AUTH_TOKEN | no | auto | MulmoClaude bearer token override |
| MULMOCLAUDE_API_URL | no | auto (.server-port; waits if nothing is published) | MulmoClaude server URL |
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).
How it works
- On startup the bridge calls
GET /api/v1/meto confirm the token works. - Every
ROCKETCHAT_POLL_INTERVAL_SECit lists the bot's DM rooms viaGET /api/v1/im.listand, per room, fetches messages newer than a cached cursor viaGET /api/v1/im.history?roomId=...&oldest=<iso>. - For each new message not authored by the bot (and whose sender is in the allowlist if set), the bridge forwards the text to MulmoClaude keyed by
roomId. - Replies go back via
POST /api/v1/chat.postMessage, chunked at 4 000 chars.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| GET /me: 401 | wrong user ID or token | Regenerate from Personal Access Tokens |
| POST /chat.postMessage: 400 | room doesn't exist or bot not in it | DM the bot user at least once so the DM room is created |
| Messages silently ignored | Sender not in ROCKETCHAT_ALLOWED_USERS | Add their username or clear the env var |
| Rate-limit errors on large deploys | Many DM rooms × short poll interval | Raise ROCKETCHAT_POLL_INTERVAL_SEC |
Security notes
- The personal access token grants full read/write as the bot user. Treat like a password.
- A dedicated bot account is strongly recommended — don't reuse your personal account.
- Without
ROCKETCHAT_ALLOWED_USERS, anyone with an account on the server who DMs the bot will get a reply. Set an allowlist for personal agents. - This v0.1.0 polls the REST API only. Future releases may add the realtime (DDP) websocket for push delivery.
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@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 ← this package@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.
