rocketchat-mcp
Provides tools for interacting with a Rocket.Chat server's REST API: checking the connection and current user, listing rooms with unread counters, finding users and rooms, reading channel/group/direct-message history and threads, fetching single messages and unread overviews, searching messages in one room or across rooms, sending messages and file uploads to rooms, DMs or threads, and downloading message attachments to a local folder. Tokens can be read-only, disabling all send tools.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
rocketchat-mcp
An MCP server that lets AI coding assistants read, search and send Rocket.Chat messages and files on your behalf.
Uses the public Rocket.Chat REST API, so it works with the free Community Edition (no Enterprise subscription needed)
Authenticates with a Personal Access Token, including tokens created with Require Two Factor Authentication
Runs locally over stdio and works with Claude Code, OpenCode and any other MCP client
Has a read-only mode and is designed for "ask before sending" permission setups
Built against the Rocket.Chat 8.x REST API (developed with 8.9). Older versions that have the same endpoints should work too.
Contents
Related MCP server: mattermost-mcp
Tools
Tool | Description | Rocket.Chat endpoint(s) |
| Connection check: current user and server version |
|
| Your rooms with unread counters; filter by type or name |
|
| Find users and rooms you have not joined yet |
|
| Room / direct-message history, paging via |
|
| Thread root message and its replies |
|
| A single message by ID, with a permalink |
|
| Unread overview, optionally with the unread messages. Does not mark anything as read |
|
| Search in one room or across your rooms |
|
| Send to a room, a direct message ( |
|
| Upload a local file to a room, DM or thread, optionally with a message text and description |
|
| Download a message's attachments (or a single file link) to a local folder | file URLs on the server, |
Rooms can be referenced as #channel, @username, a room ID, a room title, or a room link (https://chat.example.com/channel/general).
Files
send_filetakes a localfilePathplusroom(orthreadId), and optionaltext,descriptionandfileName. The server's own limits apply (Administration → Settings → File Upload: max size, allowed types).download_filetakes amessageId(downloads all files of the message) or afileUrlfrom theread_messagesoutput. Files are saved todestinationDir, or toROCKETCHAT_DOWNLOAD_DIR, or to~/Downloads/rocketchat-mcpby default. Existing files are kept, and new ones get a(1)suffix unlessoverwrite=true. The auth token is sent only to the configured Rocket.Chat server, never to other hosts.
Messages are returned in a compact, LLM-friendly format:
[2026-12-01 10:22:33] @jane (Jane Doe): Can someone review the release notes?
id=Xk2p9... replies=3Requirements
Node.js 18.17 or newer
A Rocket.Chat account that is allowed to create Personal Access Tokens
Installation
git clone https://github.com/petr-iakovenko-01/rocketchat-mcp.git
cd rocketchat-mcp
npm install
npm run buildThis produces dist/index.js. You will point your MCP client to the absolute path of that file.
Creating a Personal Access Token
In Rocket.Chat open your avatar → My Account → Personal Access Tokens. If the section is missing, ask an admin to grant you the
create-personal-access-tokenspermission.Enter a token name and choose Require Two Factor Authentication (recommended, see below).
Click Add and confirm with your password or 2FA code.
Copy the Token and Your user Id from the dialog. The token is shown only once.
Where do I find my User ID?
In the token dialog from step 4. The "Your user Id" value is
ROCKETCHAT_USER_ID. If you closed the dialog, click Regenerate next to the token. The dialog appears again, but the old token stops working.In the browser, without regenerating the token. Open Rocket.Chat while logged in, open DevTools (F12) → Console, and run:
localStorage.getItem('Meteor.userId')If the browser blocks pasting into the console, it tells you what to type to allow it (usually
allow pasting).
The User ID belongs to your user, not to the token, and never changes.
Configuration
The server is configured with environment variables:
Variable | Required | Description |
| yes | Server URL, e.g. |
| yes | Your User ID |
| yes | Your Personal Access Token |
| no |
|
| no | Default folder for |
| no | Request timeout in milliseconds (default |
| no | Path to a PEM CA bundle if your server uses a corporate or self-signed certificate |
Keep the token out of config files you might commit. Store it as a user environment variable instead:
macOS / Linux (~/.bashrc, ~/.zshrc, ...):
export ROCKETCHAT_URL="https://chat.example.com"
export ROCKETCHAT_USER_ID="<your user id>"
export ROCKETCHAT_AUTH_TOKEN="<your token>"Windows (PowerShell, persists for your user):
[Environment]::SetEnvironmentVariable('ROCKETCHAT_URL', 'https://chat.example.com', 'User')
[Environment]::SetEnvironmentVariable('ROCKETCHAT_USER_ID', '<your user id>', 'User')
[Environment]::SetEnvironmentVariable('ROCKETCHAT_AUTH_TOKEN', '<your token>', 'User')Restart your terminal or app afterwards so it picks up the variables.
On Windows, use forward slashes in paths inside JSON configs, e.g.
C:/tools/rocketchat-mcp/dist/index.js.
Using with Claude Code
Option A: CLI. Values are stored in plain text in ~/.claude.json.
claude mcp add rocketchat --scope user \
-e ROCKETCHAT_URL=https://chat.example.com \
-e ROCKETCHAT_USER_ID=<your user id> \
-e ROCKETCHAT_AUTH_TOKEN=<your token> \
-- node /absolute/path/to/rocketchat-mcp/dist/index.js(In PowerShell, use a backtick ` instead of \ for line continuation.)
Option B: .mcp.json. Secrets are read from environment variables, so the file is safe to commit.
{
"mcpServers": {
"rocketchat": {
"command": "node",
"args": ["/absolute/path/to/rocketchat-mcp/dist/index.js"],
"env": {
"ROCKETCHAT_URL": "${ROCKETCHAT_URL}",
"ROCKETCHAT_USER_ID": "${ROCKETCHAT_USER_ID}",
"ROCKETCHAT_AUTH_TOKEN": "${ROCKETCHAT_AUTH_TOKEN}"
}
}
}
}Verify with claude mcp list, or run /mcp inside a session.
Recommended permissions (~/.claude/settings.json or .claude/settings.json): reading runs without prompts, sending always asks.
{
"permissions": {
"allow": [
"mcp__rocketchat__whoami",
"mcp__rocketchat__list_rooms",
"mcp__rocketchat__find",
"mcp__rocketchat__read_messages",
"mcp__rocketchat__read_thread",
"mcp__rocketchat__get_message",
"mcp__rocketchat__get_unread",
"mcp__rocketchat__search_messages",
"mcp__rocketchat__download_file"
],
"ask": ["mcp__rocketchat__send_message", "mcp__rocketchat__send_file"]
}
}Using with OpenCode
Add the server to ~/.config/opencode/opencode.json (global) or opencode.json in a project (OpenCode V2 format):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"servers": {
"rocketchat": {
"type": "local",
"command": ["node", "/absolute/path/to/rocketchat-mcp/dist/index.js"],
"environment": {
"ROCKETCHAT_URL": "{env:ROCKETCHAT_URL}",
"ROCKETCHAT_USER_ID": "{env:ROCKETCHAT_USER_ID}",
"ROCKETCHAT_AUTH_TOKEN": "{env:ROCKETCHAT_AUTH_TOKEN}"
}
}
}
},
"permissions": [
{ "action": "rocketchat_send_message", "resource": "*", "effect": "ask" },
{ "action": "rocketchat_send_file", "resource": "*", "effect": "ask" }
]
}Important: OpenCode allows all tools without prompting by default. Keep the
askrules forrocketchat_send_messageandrocketchat_send_fileso nothing is posted without your confirmation.
Verify with opencode mcp list.
Example prompts
"What did I miss in Rocket.Chat today?"
"Read the last 50 messages in #backend and summarize the decisions."
"Find messages from @jane about the release in the last week."
"Open the thread about the deployment in #ops and tell me if anyone is blocked."
"Draft a reply to Jane's last DM saying I'll review it tomorrow." Review the text, then confirm sending.
"Download the log files from the last message in #ops and find the error."
"Send
./reports/smoke.htmlto the release thread in #qa with a short summary."
Two-factor authentication
Personal Access Tokens can be created with Ignore Two Factor Authentication or Require Two Factor Authentication. With Require, a leaked token cannot be used for sensitive operations without your 2FA code, so it is the safer choice.
How this server handles it:
Reading, searching and sending messages normally do not require a 2FA code. The token behaves like a regular user session.
If Rocket.Chat answers with
totp-required, the tool returnsTWO-FACTOR CODE REQUIRED (method: totp|email)to the assistant. The assistant asks you for the code and repeats the call withtwoFactorCode. The server sends it in thex-2fa-code/x-2fa-methodheaders.With the
emailmethod, Rocket.Chat emails you the code itself.Codes are never stored. TOTP secrets and passwords are intentionally not supported.
Search and rate limits
Search
With
room, the search runs in a single room (chat.search). This is the most reliable option.Without
room, the server first tries Rocket.Chat's server-wide search. It works only if an admin enabled Administration → Settings → Search → Default provider → Global Search. If that returns nothing, it searches yourmaxRooms(default 10) most recently active rooms one by one.Rocket.Chat search syntax is supported:
from:@user,mention:@user,has:url,has:star,is:pinned,before:dd/mm/yyyy,after:dd/mm/yyyy,on:dd/mm/yyyy,order:asc,/regex/.
Rate limits
Rocket.Chat limits API calls per endpoint by default (often 10 calls per minute). On HTTP 429 the server
waits once for the window to reset (up to 15 s) and retries. If the limit is still hit, it returns a clear error.
get_unread and search without room return partial results with a note instead of failing.
Security notes
The server acts as you. Anything sent through
send_messageorsend_fileis posted under your name and cannot be undone by the tool.send_filecan upload any file the MCP process can read. Configure your client to ask beforesend_messageandsend_file(see the permission examples above), or setROCKETCHAT_READ_ONLY=true.Message content returned by the tools is untrusted input for the assistant. Keep confirmation prompts enabled for sending.
Keep
ROCKETCHAT_AUTH_TOKENin environment variables, not in committed files. Revoke the token in My Account → Personal Access Tokens if it leaks.Use
https://. The server warns on stderr if a non-localhttp://URL is configured.
Troubleshooting
Symptom | Fix |
| The variables are not visible to the MCP process. Set them in the client config or restart the client after setting them. |
| Wrong User ID / token pair, or the token was revoked or regenerated. |
| Set |
|
|
| Wait, pass |
Global search finds nothing | Enable Global Search on the server, or pass |
Call whoami first. It confirms the URL, the user and the server version.
Development
npm install
npm run build # compile TypeScript to dist/
npm run inspect # open the MCP Inspector (env variables must be set)Project layout:
src/
├─ index.ts # entry point: config, stdio transport, server instructions
├─ config.ts # environment variable parsing
├─ client.ts # REST client: auth headers, 2FA, rate-limit retry, error mapping
├─ rooms.ts # room resolution (#channel / @user / ID / title / link), subscriptions cache
├─ format.ts # compact message formatting
├─ files.ts # attachment discovery, MIME types, streaming downloads to disk
└─ tools.ts # MCP tool definitionsLogs go to stderr. stdout is reserved for the MCP protocol.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Read conversations and reply from AI assistants with scoped access to your Message.com workspace.
Read Discord channels, threads and message history from an AI assistant via a read-only bot.
Operate GitHub from your AI assistant: repos, PRs, issues, Actions. Previews and read-only mode.
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to read, write, and manage Obsidian notes, folders, and periodic notes via the Local REST API, including search and command execution.14MIT
- AlicenseAqualityDmaintenanceEnables AI coding tools to search and read a user's Mattermost channels and DMs using their own account, allowing AI to answer questions about team conversations with read-only access.10MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI assistants to search PatchXNote records, inspect AI-generated results, create Markdown drafts, and send user-approved messages to webhooks while keeping server data read-only.2-
- AlicenseAqualityBmaintenanceEnables Claude Code to browse and full-text search a Rocket.Chat workspace, including end-to-end encrypted rooms, by decrypting messages, threads and files locally with your own keys and password. It is read-only, exposes rooms, threads, messages and attachments as tools, and cannot send, edit, or react to anything.8MIT