rocket-cli
Provides tools for interacting with Rocket.Chat, including reading messages, searching, managing threads, sending messages, uploading files, and triaging attention items (mentions, unread DMs, threads, channels) via a local SQLite cache.
Click on "Install 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., "@rocket-cliwhat did I miss?"
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.
rocket-cli
Rocket.Chat bridge with a local SQLite/FTS5 cache — CLI for humans, MCP server for LLM agents.
On first read a room is backfilled (up to 500 messages / 30 days). Subsequent reads hit chat.syncMessages for deltas (60 s TTL), then serve from SQLite — zero network on cache-fresh rooms. Full-text search runs across all cached rooms locally via FTS5; when scoped to a room it falls back to the server and ingests the results into the cache.
graph LR
Agent["LLM Agent\n(Claude · MCP stdio)"]
Human["Human\n(CLI)"]
subgraph Core["Core"]
RD["RoomDirectory"]
SE["SyncEngine"]
SS["SearchService"]
AT["Attention\n(mentions · unread)"]
ED["EmojiDirectory"]
end
subgraph Cache["SQLite cache"]
MSG["messages\n+ FTS5 index"]
META["rooms · emojis"]
end
RC["Rocket.Chat\n(REST API)"]
Agent -->|"MCP tools"| Core
Human -->|"commands"| Core
Core -->|"cache hit: 0 network, sub-ms"| Cache
Core -->|"miss/stale: backfill + syncMessages deltas"| RC
RC -->|"write-through"| Cache
Agent <-->|"open_url / permalinks"| RC
classDef cache fill:#f0f7ff,stroke:#4a90d9,stroke-width:2px
class Cache cacheArchitecture at a glance: agents and humans share one Core; the SQLite cache absorbs most reads; the server is only hit on cache miss or write.
What needs my attention
The headline feature: one call answers "what did I miss?". get_attention (MCP) / rocket-cli attention (CLI) fuses mentions of you, unread DMs, unread thread replies, and unread channel messages into a single prioritized, deduplicated digest — a message that both mentions you and is unread appears once, in the mentions section, flagged alsoUnread. Every item carries a clickable Rocket.Chat link, and the whole flow is strictly read-only (it never clears a single unread badge). Paste any of those links back to the agent via open_url (or rocket-cli open <url>) and you get the surrounding conversation plus the ids needed to reply — a full triage-to-reply round-trip without leaving the chat.
Related MCP server: SynapBus
Install
Requirements: Node >= 20, npm
git clone <repo-url> # or your fork/path
cd rocket-cli
npm install
npm run build
npm link # optional: puts `rocket-cli` on your PATHAfter npm link, examples below can use rocket-cli instead of node dist/cli.js.
Get your credentials
Open Rocket.Chat in your browser → click your avatar (top-left) → My Account → Personal Access Tokens
If the section is missing: an admin must enable the
API_Enable_Personal_Access_Tokenssetting, and your role needs thecreate-personal-access-tokenspermissionName the token (e.g.
rocket-cli), check Ignore Two Factor Authentication (without it, API calls may demand TOTP codes the CLI cannot answer), then click AddCopy both the token and the user ID — they appear together in the same confirmation dialog, and the token is shown only once
Copy the example env file and fill in your values:
cp .env.example .envSet
ROCKETCHAT_URL,ROCKETCHAT_TOKEN, andROCKETCHAT_USER_ID. The CLI auto-loads.envfrom the directory you run it in; real environment variables always take precedence.
Quickstart
rocket-cli rooms # lists rooms you're subscribed to — verifies auth
rocket-cli sync --all # initial backfill into the local cache
rocket-cli messages general -n 20
rocket-cli search "deploy"Cache reset: rm ~/.local/share/rocket-cli/cache.db* — next run re-syncs from the server.
CLI usage
All commands accept --json for machine-readable output.
# List rooms you belong to
node dist/cli.js rooms
node dist/cli.js rooms --type channel
node dist/cli.js rooms --filter infra
# Sync a room or all rooms
node dist/cli.js sync #dev
node dist/cli.js sync --all
node dist/cli.js sync --all --force # bypass TTL, re-fetch everything
# Read messages
node dist/cli.js messages #dev -n 50
node dist/cli.js messages #dev -n 20 --before 2026-06-01T00:00:00.000Z
# Show everything unread since you last read each room (read-only — never clears badges)
node dist/cli.js unread
node dist/cli.js unread --limit 20 --no-threads
# One-call triage: mentions + unread DMs + threads + channels, prioritized & deduplicated
node dist/cli.js attention
node dist/cli.js attention --since-days 2 --limit 20 --all-broadcasts
# Just the messages that mention you, across all cached rooms (read-only)
node dist/cli.js mentions
node dist/cli.js mentions --since-days 14 --all-broadcasts
# Show the conversation around a message id (from search, mentions, or a link)
node dist/cli.js context <message-id>
node dist/cli.js context <message-id> --before 20 --after 10
# Paste any Rocket.Chat web link to open its content + how to reply
node dist/cli.js open "https://chat.example.com/channel/general?msg=<id>"
# Full-text search (cross-room by default)
node dist/cli.js search "deploy error"
node dist/cli.js search "deploy error" --room #dev
node dist/cli.js search "deploy error" --room #dev --author jsmith --limit 10
# Send a message
node dist/cli.js send #dev "Hello team"
node dist/cli.js send #dev "Fixed in the next build" --thread <parent-message-id>
# List threads in a room; show a specific thread
node dist/cli.js threads general -n 10
node dist/cli.js thread <parent-message-id>
# Watch for messages matching a query (local FTS)
node dist/cli.js watch "deploy error" --once
node dist/cli.js watch "incident" --room #ops --interval 30
# Upload a file to a room
node dist/cli.js upload general /path/to/report.pdf --text "Q2 report"
# Download an attachment (use the link from `messages` output: [file] name -> /file-upload/…)
node dist/cli.js download /file-upload/abc123/report.pdf --out /tmp/report.pdf
# List custom emojis registered on the server
node dist/cli.js emojis
node dist/cli.js emojis --filter rocket
node dist/cli.js emojis --sync # force a refresh, ignore TTL
node dist/cli.js emojis --export /tmp/emoji # save every emoji image to a directory
# Start the MCP stdio server (used by Claude Code / Claude Desktop)
node dist/cli.js serverooms flags
Flag | Description |
| Filter by type: |
| Case-insensitive name substring filter |
sync flags
Flag | Description |
| Room name, |
| Sync every subscribed room sequentially |
| Bypass TTL and re-sync even if cache is fresh |
messages flags
Flag | Description |
| Number of messages to show (default 30) |
| Show messages older than this ISO 8601 timestamp |
| Include system messages (joins, topic changes, etc.) |
unread flags
Read-only: lists messages with ts newer than each room's server-side last-read watermark (the marker the UI sets when you open a room). It never calls subscriptions.read and never clears unread badges. Rooms with no read marker fall back to a newest-N approximation, flagged in the output.
Flag | Description |
| Max messages per room (default 50) |
| Skip unread thread replies (threads shown by default) |
attention flags
Read-only one-call triage. Runs the mentions and unread views, then fuses them into prioritized sections — MENTIONS, DIRECT MESSAGES, THREADS, CHANNELS — deduplicated by message id (a mentioned message that is also unread is shown once, under mentions, flagged also unread). Every item carries a clickable link. Never clears a badge.
Flag | Description |
| How far back to look for mentions, in days (default 7) |
| Max items per section (default 30) |
| Also include channel-wide @all/@here mentions |
mentions flags
Flag | Description |
| How far back to look, in days (default 7) |
| Max total mentions to show (default 50) |
| Also include channel-wide @all/@here mentions |
context flags
Flag | Description |
| The message to center the conversation on |
| Messages to show before the target (0-50, default 10) |
| Messages to show after the target (0-50, default 5) |
open flags
Paste any Rocket.Chat web link — a message, a thread, or a plain channel — and open resolves it, prints the surrounding conversation (target marked →), and shows how to reply.
Flag | Description |
| Any Rocket.Chat link: message, thread, or channel |
| Number of messages of context to show (default 20) |
search flags
Flag | Description |
| Limit to one room and enable server-side fallback |
| Filter by author username |
| Maximum results (default 20) |
send flags
Flag | Description |
| Reply to the thread with this parent message id |
threads flags
Flag | Description |
| Number of threads to show (default 25) |
| Filter threads by parent message text |
thread flags
Flag | Description |
| Number of replies to show (default 50) |
watch flags
Flag | Description |
| Limit to a specific room (default: all rooms) |
| Poll interval in seconds (default 60) |
| Run a single pass over the last 24 h and exit |
| Post each match to this room or user |
| Append matches as JSON lines to a file |
upload flags
Flag | Description |
| Caption message for the attachment |
| Attach inside the thread with this parent message id |
| Override the uploaded file name |
download flags
Flag | Description |
| Where to save the file (default: |
emojis flags
Flag | Description |
| Case-insensitive name substring filter |
| Force a refresh, ignoring the cache TTL |
| Fetch and write each emoji image as |
Image caching can be disabled with ROCKET_CLI_EMOJI_IMAGES=false (metadata only); --export and get_custom_emoji then degrade to names/aliases plus the server image URL.
MCP server for Claude Code
Add to .mcp.json in your project root (or ~/.claude/mcp.json for global):
{
"mcpServers": {
"rocketchat": {
"command": "node",
"args": ["/absolute/path/to/rocket-cli/dist/cli.js", "serve"],
"env": {
"ROCKETCHAT_URL": "${ROCKETCHAT_URL}",
"ROCKETCHAT_TOKEN": "${ROCKETCHAT_TOKEN}",
"ROCKETCHAT_USER_ID": "${ROCKETCHAT_USER_ID}"
}
}
}
}Use ${VARIABLE} env-expansion so the token is read from your shell environment, not stored literally in the file. Never commit a .mcp.json with a real token.
For Claude Desktop, add an equivalent entry under mcpServers in ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) with the same command/args/env structure.
See .mcp.json.example at the repo root for a copy-paste starting point.
CLI alternative — register with the claude CLI instead of editing .mcp.json manually:
claude mcp add rocketchat \
-e ROCKETCHAT_URL=https://chat.example.com \
-e ROCKETCHAT_TOKEN=your-token \
-e ROCKETCHAT_USER_ID=your-user-id \
-- node /absolute/path/to/rocket-cli/dist/cli.js serveThe -e flag sets env vars scoped to this MCP server; they are not exported to your shell. Run claude mcp add --help for scope and transport options.
MCP tools
Seventeen tools are exposed to the LLM agent:
Tool | What it does | Key inputs |
| List subscribed channels, groups, and DMs |
|
| Read messages from a room, newest first |
|
| One-call triage of everything needing attention — mentions, unread DMs, unread threads, unread channels, prioritized + deduplicated, every item linked (read-only) |
|
| List everything unread since you last read each room (read-only; never clears badges) |
|
| Messages that mention the user (@username) across all cached rooms, each with a link (read-only) |
|
| Show the conversation around a message id; thread replies pivot to their whole thread |
|
| Open any pasted Rocket.Chat link (message, thread, or channel) and return its content + the ids needed to reply/react |
|
| Read a full thread (parent + replies) |
|
| List active threads in a room by last activity |
|
| Full-text search across all cached rooms |
|
| Post to a room or reply in a thread |
|
| Add or remove an emoji reaction on a message |
|
| Look up a user's profile by username or id |
|
| Attach a local file to a room or thread |
|
| Download a message attachment to local disk |
|
| List custom emojis registered on this server (beyond unicode) |
|
| Show a custom emoji's image (returns image content) |
|
get_messages and list_threads return an envelope with room, syncedThrough, and coverage so the agent knows the freshness and depth of the cached data. Thread parents in get_messages carry a replyCount; pass that message's id as threadId to get_thread_messages.
Attachment links appear in get_messages output as [file] name -> /file-upload/…; pass the part after -> as fileUrl to download_attachment.
Architecture
Lazy backfill — first access to a room fetches up to 500 messages / 30 days via
channels.history/groups.history/im.history.Delta sync — subsequent reads call
chat.syncMessages(lastUpdate)(60 s TTL), applying edits and deletions into the local store.FTS5 search — BM25-ranked full-text search across all cached rooms; if results are thin and a room is specified, falls back to
chat.searchand ingests the server results into the cache.Write-through sends —
chat.postMessageresponse is upserted into the local DB, so the sent message appears in the nextget_messageswithout a sync round-trip.Threads on demand —
ensureThreadLoadedcheckstcountvs local reply count and backfills gaps viachat.getThreadMessages.
DB location: ~/.local/share/rocket-cli/cache.db (XDG data home). Override with ROCKET_CLI_DB.
Environment variables
Variable | Required | Default | Description |
| yes | — | Base URL of your Rocket.Chat server (e.g. |
| yes | — | Personal Access Token |
| yes | — | Your Rocket.Chat user id |
| no |
| Override the SQLite database path |
| no |
| How long before a cached room is considered stale |
| no |
| Max messages to fetch on initial room backfill |
| no |
| Cache custom-emoji image bytes. |
Known issues
See docs/KNOWN_ISSUES.md.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jeanfbrito/rocket-cli'
If you have feedback or need assistance with the MCP directory API, please join our Discord server