rocketchat-mcp

rocketchat-mcp

MCP server for Rocket.Chat, enabling AI agents to interact with Rocket.Chat workspaces via tools like listing users, sending messages, and managing channels.

Category
访问服务器

README

MCP Rocket.Chat Setup Guide

Rocket.Chat MCP server for Nanobot, Cursor, and Claude Desktop. Use it as:

  • HTTP server (Docker) — no credentials in the container; clients (e.g. Nanobot) send credentials in request headers.
  • Stdio — credentials from environment or CLI args.

Credentials

When using HTTP (recommended with Nanobot in Docker): the MCP server runs without credentials. Pass them in Nanobot’s config under mcpServers.<name>.headers; they are sent with every request. No .env or container env needed.

When using stdio or optional Docker defaults: use environment variables or CLI args.

Use either username/password or user ID + auth token (token takes precedence when both are set).

Source Server URL Username / Password User ID / Auth Token
Headers X-RocketChat-Server-URL or X-RocketChat-URL X-RocketChat-Username, X-RocketChat-Password X-RocketChat-User-Id, X-RocketChat-Auth-Token
Env ROCKETCHAT_SERVER_URL or ROCKETCHAT_URL ROCKETCHAT_USERNAME, ROCKETCHAT_PASSWORD ROCKETCHAT_USER_ID, ROCKETCHAT_AUTH_TOKEN
CLI --server-url --username, --password (not available)

Run as MCP inside Nanobot via HTTP (recommended)

The MCP server runs without credentials in the container. Credentials are sent by Nanobot on each request via headers.

  1. Start the MCP server (no env vars or .env required):

    docker compose up -d
    

    It listens at http://<host>:3011/mcp.

  2. Configure Nanobot (~/.nanobot/config.json): add the server with url and headers (credentials live only in your config):

    {
      "tools": {
        "mcpServers": {
          "mcp-rocketchat": {
            "url": "http://rocketchat-mcp:3011/mcp",
            "headers": {
              "X-RocketChat-Server-URL": "https://chat.example.com",
              "X-RocketChat-User-Id": "your-user-id",
              "X-RocketChat-Auth-Token": "your-auth-token"
            }
          }
        }
      }
    }
    

    Alternative — username/password (server will log in on first use):

    "headers": {
      "X-RocketChat-Server-URL": "https://chat.example.com",
      "X-RocketChat-Username": "your-bot-user",
      "X-RocketChat-Password": "your-password"
    }
    

    Use the hostname that reaches the MCP server from Nanobot (e.g. rocketchat-mcp if both are on the same Docker network, or host.docker.internal:3011 if the server runs on the host).

  3. Restart Nanobot. Credentials are sent with every MCP request; nothing is stored in the container.


Run as MCP inside Nanobot (stdio)

Nanobot starts the server as a subprocess and talks over stdio. Credentials must be available as env vars where Nanobot runs.

  1. Set environment variables (e.g. in your shell profile or where you start Nanobot). Use either username/password or user ID + auth token:

    export ROCKETCHAT_SERVER_URL="https://your-server.com"
    # Option A: username/password
    export ROCKETCHAT_USERNAME="your-bot-user"
    export ROCKETCHAT_PASSWORD="your-password"
    # Option B: user ID + auth token (instead of A)
    # export ROCKETCHAT_USER_ID="your-user-id"
    # export ROCKETCHAT_AUTH_TOKEN="your-auth-token"
    
  2. Add the MCP server to Nanobot config (~/.nanobot/config.json):

    {
      "tools": {
        "mcpServers": {
          "rocketchat": {
            "command": "python",
            "args": ["/absolute/path/to/rocketchat.py"]
          }
        }
      }
    }
    

    Or with uv from the project directory:

    {
      "tools": {
        "mcpServers": {
          "rocketchat": {
            "command": "uv",
            "args": ["run", "--project", "/path/to/rocketchat-mcp", "rocketchat.py"]
          }
        }
      }
    }
    
  3. Restart Nanobot (e.g. nanobot gateway). The RocketChat tools will be available to the agent.

No --transport or --server-url is needed: the server uses stdio by default and reads credentials from the environment.


Run with Cursor / Claude Desktop (stdio)

Same as Nanobot: use env vars for credentials and start the server with no --transport (stdio is default).

Example (credentials in args; avoid in shared environments):

{
  "mcpServers": {
    "rocketchat": {
      "command": "python",
      "args": [
        "C:/path/to/rocketchat.py",
        "--server-url", "https://your-server.com",
        "--username", "user",
        "--password", "pass"
      ]
    }
  }
}

Prefer setting credentials in the environment (ROCKETCHAT_SERVER_URL plus either username/password or ROCKETCHAT_USER_ID/ROCKETCHAT_AUTH_TOKEN) and using only:

{
  "mcpServers": {
    "rocketchat": {
      "command": "python",
      "args": ["C:/path/to/rocketchat.py"]
    }
  }
}

Docker: no credentials in the container

The image is built and run without any RocketChat credentials. Start with:

docker compose up -d

The server listens on http://0.0.0.0:3011/mcp. Clients (e.g. Nanobot) must send credentials on each request via the headers listed in the credentials table. Optionally you can set ROCKETCHAT_* env vars in the container if you want a default for clients that don’t send headers.


Local Python setup (no Docker)

uv venv
.venv\Scripts\activate   # or: source .venv/bin/activate
uv sync
  • Stdio (for Nanobot/Cursor): set ROCKETCHAT_* env vars, then run:

    python rocketchat.py
    

    (Nanobot/Cursor will start this for you when configured as above.)

  • HTTP (local test):

    set MCP_TRANSPORT=streamable-http
    python rocketchat.py
    

    Or:

    python rocketchat.py --transport streamable-http --port 3011
    

Tools exposed to the agent

  • list_users – list users
  • find_channel – find room(s) by name (channels, DMs, private); returns room_id for messages/send
  • list_all_rooms – list all rooms (channels, DMs, private, etc.)
  • send_message_in_channel – send a message (channel name or room_id)
  • get_channel_messages – get recent messages in a room (requires room_id)
  • get_user_info – info for a user
  • create_channel – create a channel

To get the last message in channel XY: call find_channel("XY") first, then get_channel_messages(room_id=<from find_channel>, count=1).


For more details, see Rocket.Chat API and Nanobot README.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选