使用说明
火箭公司
MCP服务器 火箭。聊天.28用于通道、消息、线程、DM、文件、用户、反应等的工具。
为AI代理(Claude Code、Cursor等)与Rocket交互而构建。聊天工作区。
快速开始
docker run -d -p 9886:8000 \
-e ROCKETCHAT_URL=https://chat.example.com \
-e ROCKETCHAT_AUTH_TOKEN=your-token \
-e ROCKETCHAT_USER_ID=your-user-id \
ghcr.io/enyonee/rocketchat-mcp:latest
获取您的令牌和用户名: 火箭。聊天->个人资料->个人访问令牌.
连接到克劳德代码
添加到MCP设置中:
{
"mcpServers": {
"rocketchat": {
"url": "http://localhost:9886/mcp"
}
}
}
环境变量
| 变量 | 必填 | 描述 |
|---|---|---|
ROCKETCHAT_URL |
是的 | 火箭。聊天服务器URL |
ROCKETCHAT_AUTH_TOKEN |
是 | 个人访问令牌 |
ROCKETCHAT_USER_ID |
是 | 用户ID |
READ_ONLY |
否 | 设置 true 阻止所有写入操作 |
MCP_PORT |
无 | 服务器端口(默认值:8000) |
工具
频道
| 工具 | 说明 |
|---|---|
list_channels |
列出公共频道,可选择按名称筛选 |
list_joined_channels |
列出经过身份验证的用户已加入的频道 |
get_channel_info |
按名称或ID获取频道详细信息 |
list_groups |
列出私人组 |
get_channel_members |
列出频道成员 |
消息
| 工具 | 说明 |
|---|---|
get_channel_messages |
通过分组、线程扩展和压缩模式获取消息 |
search_messages |
按频道中的文本搜索邮件 |
get_message_context |
获取围绕特定邮件ID的邮件 |
send_message |
向频道发送消息 |
edit_message |
编辑现有邮件 |
delete_message |
删除消息 |
线程
| 工具 | 说明 |
|---|---|
get_thread_messages |
在一个帖子中获取所有回复 |
reply_to_thread |
回复现有帖子 |
私信
| 工具 | 说明 |
|---|---|
list_dms |
列出DM对话 |
send_dm |
向用户发送直接消息 |
文件
| 工具 | 说明 |
|---|---|
list_room_files |
列出频道中共享的文件 |
download_file |
下载文件(图像作为视觉内容返回) |
send_file |
将文件上传到通道(base64输入) |
用户
| 工具 | 说明 |
|---|---|
list_users |
列出用户,可选择按名称筛选 |
get_user_info |
按用户名获取用户详细信息 |
反应和别针
| 工具 | 说明 |
|---|---|
add_reaction |
在消息中添加表情符号反应 |
pin_message |
固定消息 |
unpin_message |
不愉快的消息 |
get_pinned_messages |
在频道中获取固定消息 |
分析
| 工具 | 说明 |
|---|---|
get_channel_digest |
频道摘要:过去N小时的活动用户、线程、文件 |
get_mentions |
提及已验证用户的消息 |
get_unread_channels |
按计数排序的有未读消息的频道 |
mark_as_read |
将频道中的所有消息标记为已读 |
主要特点
消息分组
60秒内来自同一用户的连续消息会自动合并。一条文本消息和一条图像上传成为一条分组消息:
{
"grouped": true,
"ids": ["msg1", "msg2"],
"texts": ["Check this out", ""],
"files": [{"name": "screenshot.png", "url": "...", "type": "image/png"}],
"user": "alice"
}
禁用 group=false.
线程扩展
集 expand_threads=true 上 get_channel_messages 内联线程回复:
{
"id": "parent_msg_id",
"text": "Let's discuss this",
"thread_replies": 5,
"thread": [
{"id": "reply1", "user": "bob", "text": "I agree"},
{"id": "reply2", "user": "alice", "text": "Done"}
]
}
紧凑模式
集 compact=true 在任何消息返回工具上获得最小输出(节省令牌):
{"id": "abc", "user": "alice", "text": "Message text truncated to 200 chars...", "ts": "..."}
只读模式
集 READ_ONLY=true 要阻止:send_message、send_dm、reply_to_thread、add_reaction、send_file、edit_message、delete_message、pin_message、unpin_message。
发展
# Run locally
ROCKETCHAT_URL=https://chat.example.com \
ROCKETCHAT_AUTH_TOKEN=token \
ROCKETCHAT_USER_ID=uid \
go run .
# Run tests (requires a live Rocket.Chat server)
ROCKETCHAT_URL=https://chat.example.com \
ROCKETCHAT_AUTH_TOKEN=token \
ROCKETCHAT_USER_ID=uid \
go test -v ./...
# Build Docker image
docker build -t rocketchat-mcp .
许可证
麻省理工学院