Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish

on:
release:
types: [published]
workflow_dispatch:

permissions:
id-token: write # PyPI Trusted Publishing + mcp-publisher GitHub OIDC
contents: read

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Set up uv
uses: astral-sh/setup-uv@v8

- name: Build sdist and wheel
run: uv build

- name: Publish to PyPI (Trusted Publishing)
uses: pypa/gh-action-pypi-publish@release/v1

- name: Install mcp-publisher
run: |
curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher

- name: Wait for PyPI to index the new release
run: sleep 20

- name: Publish to MCP Registry (GitHub OIDC)
run: |
./mcp-publisher login github-oidc
./mcp-publisher publish
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ wheels/
.venv

# Log
rocketchat_mcp.log
rocketchat_mcp.log*
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 millerchou

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
14 changes: 14 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
rocketchat-mcp

This project is a fork of https://github.com/elieworkspace/rocketchat-mcp
(original author: elieworkspace).

The upstream repository is published without an explicit license, so its
original portions remain under the original author's copyright. This fork
retains the upstream commit history and authorship.

Modifications and additions in this fork — including Personal Access Token
authentication, additional tools (direct messages, file upload/download,
unread checking, message search, pagination), and reliability/security
improvements — are Copyright (c) 2026 millerchou and are released under the
MIT License (see LICENSE).
117 changes: 78 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,101 @@
# MCP Rocket.Chat Setup Guide
<!-- mcp-name: io.github.millerchou/rocketchat-mcp -->

Follow these steps to set up and configure MCP Rocket.Chat on your local machine.
# rocketchat-mcp

## 1. Clone the Repository
An [MCP](https://modelcontextprotocol.io) server for [Rocket.Chat](https://rocket.chat).
It lets MCP clients (Claude Desktop, Cursor, Claude Code, etc.) send and read
messages, send DMs, search history, upload/download files, and manage channels
on a Rocket.Chat workspace over stdio.

```bash
git clone git@github.com:elieworkspace/mcp-rocketchat.git
cd mcp-rocketchat
```
> Actively maintained fork of
> [elieworkspace/rocketchat-mcp](https://github.com/elieworkspace/rocketchat-mcp),
> adding Personal Access Token auth, more tools, and reliability/security
> improvements. See [NOTICE](NOTICE) for attribution.

## 2. Start Rocket.Chat with Docker
## Tools

```bash
docker compose up -d
```
| Tool | Description |
| --- | --- |
| `send_message_in_channel` | Send a message to a channel |
| `send_direct_message` | Send a direct message to a user |
| `delete_message` | Delete a message (your own, unless the role has force-delete) |
| `get_channel_messages` | Read history of a channel/group/DM; supports `offset` paging and accepts a room ID or name |
| `search_messages` | Keyword search within a room (`chat.search`) |
| `get_unread` | List rooms with unread messages and their latest content |
| `send_file` | Upload a file to a channel or `@user` |
| `download_attachment` | Download a message's attachments to local files |
| `list_all_rooms` | List channels, groups and DMs &lowast; |
| `list_users` | List users &lowast; |
| `get_user_info` | Get a user's profile |
| `create_channel` | Create a channel |

Access Rocket.Chat at [http://localhost:3000](http://localhost:3000).
&lowast; `list_all_rooms` and `list_users` call workspace-wide endpoints
(`channels.list` / `users.list`) that require admin or the corresponding
`view-*` permission. Every other tool works for a normal chat user.

## 3. Initial Configuration
## Authentication

- Save your admin username and password.
- Navigate to [http://localhost:3000/admin/settings/Accounts#:rbb:](http://localhost:3000/admin/settings/Accounts#:rbb:)
Disable 2FA and click **Save**.
A normal chat user is enough for the core tools. A **Personal Access Token** is
recommended — it keeps the token out of process arguments:

## 4. Set Up Python Environment
| Variable | Description |
| --- | --- |
| `ROCKETCHAT_SERVER_URL` | Workspace URL, e.g. `https://chat.example.com` |
| `ROCKETCHAT_USER_ID` | Your Rocket.Chat user ID |
| `ROCKETCHAT_AUTH_TOKEN` | Personal Access Token |
| `ROCKETCHAT_WATCHDOG_INTERVAL` | (optional) orphan-watchdog interval in seconds, default `60` |

Username/password is also supported via `--username` / `--password`.
Use `--no-verify-ssl` for self-signed certificates.

## Usage

### Run with uvx

```bash
uv venv
.venv\Scripts\activate
uv add mcp[cli] httpx
uvx rocketchat-mcp --server-url https://chat.example.com
```

## 5. Client Configuration Example
To run the latest unreleased code straight from GitHub instead:

Add the following configuration to your client, replacing `-username-` and `-password-` with your credentials:
```bash
uvx --from git+https://github.com/millerchou/rocketchat-mcp rocketchat-mcp --server-url https://chat.example.com
```

### Client configuration

```json
{
"mcpServers": {
"mcp-rocketchat": {
"command": "uv",
"args": [
"--directory",
"C:/Users/-username-/Desktop/mcp-rocketchat",
"run",
"rocketchat.py",
"--server-url", "http://localhost:3000",
"--username", "-username-",
"--password", "-password-"
]
}
"mcpServers": {
"rocketchat": {
"command": "uvx",
"args": ["rocketchat-mcp"],
"env": {
"ROCKETCHAT_SERVER_URL": "https://chat.example.com",
"ROCKETCHAT_USER_ID": "your_user_id",
"ROCKETCHAT_AUTH_TOKEN": "your_personal_access_token"
}
}
}
}
```

---
### Local development

```bash
git clone https://github.com/millerchou/rocketchat-mcp
cd rocketchat-mcp
uv run rocketchat.py --server-url https://chat.example.com \
--auth-token "$ROCKETCHAT_AUTH_TOKEN" --user-id "$ROCKETCHAT_USER_ID"
```

## Reliability

Persistent HTTP connection pool, room-endpoint caching, log rotation (1 MB),
and an orphan watchdog that self-exits when the MCP client process dies.

**Tip:**
Make sure Docker and Python are installed on your system before starting.
## License

For more details, refer to the [Rocket.Chat documentation](https://docs.rocket.chat/).
Modifications in this fork are released under the [MIT License](LICENSE).
This is a fork of upstream code originally published without a license; see
[NOTICE](NOTICE) for details.
4 changes: 4 additions & 0 deletions glama.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://glama.ai/mcp/schemas/server.json",
"maintainers": ["millerchou"]
}
30 changes: 27 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
[project]
name = "rocketchat"
name = "rocketchat-mcp"
version = "0.1.0"
description = "Add your description here"
description = "MCP server for Rocket.Chat — send and read messages, DMs, search, files, and channels over stdio"
readme = "README.md"
requires-python = ">=3.13"
requires-python = ">=3.10"
license = "MIT"
license-files = ["LICENSE", "NOTICE"]
authors = [{ name = "millerchou" }]
keywords = ["mcp", "model-context-protocol", "rocketchat", "rocket-chat", "llm", "ai", "chat"]
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
"Topic :: Communications :: Chat",
]
dependencies = [
"httpx>=0.28.1",
"mcp[cli]>=1.12.3",
]

[project.urls]
Homepage = "https://github.com/millerchou/rocketchat-mcp"
Repository = "https://github.com/millerchou/rocketchat-mcp"
Issues = "https://github.com/millerchou/rocketchat-mcp/issues"

[project.scripts]
rocketchat-mcp = "rocketchat:main"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
include = ["rocketchat.py"]
Loading