Rocket.Chat消息控制协议服务

为Rocket.Chat提供自动化消息管理和群组控制功能的API服务,适用于团队协作场景中的聊天机器人开发。

  • by Cyber-Sea-Labs
  • Python
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 Cyber-Sea-Labs/rocketchat-mcp

使用说明

火箭公司

Rocket的MCP服务器。聊天。用途 火箭聊天_API 引擎盖下。

设置

pip install -e .

用法

密码验证:

rocketchat-mcp --server-url https://chat.example.com --username bot --password secret

令牌身份验证:

rocketchat-mcp --server-url https://chat.example.com --user-id XXX --auth-token YYY

自签名证书:添加 --no-ssl-verify.

Claude代码配置

{
  "mcpServers": {
    "rocketchat": {
      "command": "rocketchat-mcp",
      "args": [
        "--server-url", "https://chat.example.com",
        "--user-id", "XXX",
        "--auth-token", "YYY"
      ]
    }
  }
}

工具(58)

消息 — send_message, send_message_to_room, get_room_messages, update_message, delete_message, react_to_message, get_message_reactions, pin_message, unpin_message, star_message, search_messages, get_pinned_messages, get_starred_messages

线程 — get_thread_messages, get_threads_list (send_message、send_message_to_um和send_dm接受 thread_id 用于回复)

频道 — list_channels, get_channel_info, get_channel_messages, create_channel, delete_channel, archive_channel, unarchive_channel, set_channel_topic, set_channel_description, set_channel_announcement, get_channel_members, invite_to_channel, kick_from_channel, rename_channel, set_channel_read_only

群组 — list_groups, create_group, delete_group, get_group_messages, get_group_members, invite_to_group, kick_from_group

私信 — list_dms, open_dm, send_dm, get_dm_messages

用户 — list_users, get_user_info, get_my_info, set_user_status

团队 — list_teams, create_team, get_team_members

房间 — list_rooms, get_room_info, mark_room_read

提及 — get_mentions_in_room, get_unread_mentions

轮询 — ask_in_channel, ask_user_dm, check_for_replies

杂项 — search_spotlight, get_server_statistics

get_room_messages 和 check_for_replies 自动检测房间类型(通道、组或DM),并使用正确的API端点。列表工具接受 count 参数来限制结果。

提问并等待回复

ask_in_channel 和 ask_user_dm 发布消息并立即返回 thread_id. check_for_replies 检查该线程是否有新的文本回复 和 表情符号反应-它也会立即返回,从不屏蔽。 get_message_reactions 读取对任何消息的反应。

没有推送/回调机制(REST-only API,stdio传输)。呼叫者必须进行投票。

建议的提示语言

如果你正在构建一个通过Rocket向人类提问的代理。聊天,在您的系统提示符或CLAUDE.md中添加类似的内容。用您的实际频道/用户替换占位符:

## Rocket.Chat

When you need human input, use the rocketchat MCP server.

- Ask questions in #your-channel using ask_in_channel, or DM a specific
  user with ask_user_dm. If you don't know which channel or user to
  contact, ask the operator before sending anything.
- These tools return immediately. Do NOT wait idle for a response.
  Continue working on any tasks that are not blocked by the answer.
- If the question involves choosing between approaches, explore each
  option independently while you wait. In a git repo, prototype on
  separate branches; otherwise, sketch alternatives in parallel however
  is appropriate. Re-evaluate when the answer arrives — you may already
  have a working solution.
- Check back with check_for_replies periodically between other tasks.
- When a reply arrives, incorporate it and discard any exploratory work
  that is no longer needed.
- When presenting a choice, offer emoji reactions as selectable options
  so the user can respond with a single click. For example:

    React to choose:
    :one: — Refactor the existing module
    :two: — Write a new implementation
    :three: — Skip this for now

  Then poll with check_for_replies, which returns both text replies and
  emoji reactions. If a user reacts with :two:, that is their answer.
  You may also invite the user to reply in the thread with additional
  context if they want to elaborate.

你 必须 告诉代理在哪里发送消息。如果提示中没有频道或用户名,代理就无法知道,应该询问操作员而不是猜测。例子:

Ask questions in #eng-team or DM @tyler when you need human input.

权限

Claude Code控制代理可以使用哪些工具调用 mcp__<server>__<tool> 规则在 .claude/settings.json (或 settings.local.json 用于个人覆盖)。拒绝规则优先于允许规则。任何与交互式提示不匹配的内容。

只读机器人:

{
  "permissions": {
    "allow": [
      "mcp__rocketchat__list_*",
      "mcp__rocketchat__get_*",
      "mcp__rocketchat__search_*",
      "mcp__rocketchat__check_for_replies"
    ],
    "deny": [
      "mcp__rocketchat__delete_*",
      "mcp__rocketchat__kick_*",
      "mcp__rocketchat__archive_*"
    ]
  }
}

允许一切:

{
  "permissions": {
    "allow": ["mcp__rocketchat__*"]
  }
}

仅聊天(可以阅读和发送消息,其他内容不会自动批准):

{
  "permissions": {
    "allow": [
      "mcp__rocketchat__send_message",
      "mcp__rocketchat__send_dm",
      "mcp__rocketchat__ask_in_channel",
      "mcp__rocketchat__ask_user_dm",
      "mcp__rocketchat__check_for_replies",
      "mcp__rocketchat__get_*",
      "mcp__rocketchat__list_*"
    ],
    "deny": [
      "mcp__rocketchat__delete_*",
      "mcp__rocketchat__kick_*",
      "mcp__rocketchat__create_*",
      "mcp__rocketchat__set_*",
      "mcp__rocketchat__archive_*",
      "mcp__rocketchat__invite_*",
      "mcp__rocketchat__rename_*"
    ]
  }
}

这些是Claude Code权限——它们控制着是否允许代理调用该工具。火箭。聊天服务器单独执行其基于角色的权限;如果机器人程序帐户缺少所需的RC角色,则无论Claude Code允许什么,API都会返回一个错误。

许可证

MIT许可证。看 许可证 了解详情。