agents-chat-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agents-chat-mcp 接入聊天 room:chat-test name:leader"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agents-chat-mcp
概述
agents-chat-mcp 是一个基于 MCP(Model Context Protocol)的聊天桥接服务器,将多个 Agent 接入同一个 ChatRoom,实现对话式协作。
之前我一直认为有 SubAgent 模式就足够了,直到某一天我需要跨设备联调,所以花了两天写了一个最小化聊天MCP。
Related MCP server: AIChat MCP Server
安装
以 claude 为例:
# 当前项目安装
claude mcp add agents-chat-mcp -- npx -y @eos./agents-chat-mcp
# 全局安装
claude mcp add agents-chat-mcp -s user -- npx -y @eos./agents-chat-mcp
# 查看
claude mcp list
# 移除
claude mcp remove "agents-chat-mcp" 使用方式
启动claude直接输入,如模型不主动监听则需要提示
接入聊天 room:chat-test name:leader配置化(编辑
~/.claude/settings.json):
{
"mcpServers": {
"agents-chat-mcp": {
"command": "npx",
"args": ["-y", "@eos./agents-chat-mcp"],
"env": {
"AGENTS_CHAT_ROOM_NAME": "project-name",
"AGENTS_CHAT_NAME": "leader"
}
}
}
}架构
Claude Code (alice) ──MCP──▶ server.mjs ──┐
Claude Code (bob) ──MCP──▶ server.mjs ──┼──▶ ChatRoomServer (127.0.0.1:11666)
Claude Code (carol) ──MCP──▶ server.mjs ──┘ HTTP REST + SSE
└─ rooms / messages / events多个 MCP 实例共享同一个 ChatRoom 服务器:首个实例启动内置服务器,后续实例自动检测并连接。
文件结构
├── server.mjs # MCP 入口,注册 4 个工具 + 内置服务器启动
└── lib/
├── chat-room-server.mjs # 内置 ChatRoom HTTP/SSE 服务器
├── chat-room-client.mjs # ChatRoom HTTP/SSE 客户端
└── protocol.mjs # 状态常量、唤醒 Prompt 构建、消息过滤部署模式
模式 A:内置服务器(默认)
不设置 AGENTS_CHAT_SERVER_URL,自动在 127.0.0.1:11666 启动内置服务器。
如需让局域网或其他机器访问内置服务器,设置 AGENTS_CHAT_PUBLIC_SERVER=1 后会监听 0.0.0.0:11666。只在可信网络中开启,避免把未鉴权的 ChatRoom 服务暴露到公网。
模式 B:外部服务器
设置 AGENTS_CHAT_SERVER_URL,连接已运行的服务器。
启动外部服务器:
AGENTS_CHAT_PUBLIC_SERVER=1 node server.mjs客户端配置:
{
"mcpServers": {
"agents-chat-mcp": {
"env": {
"AGENTS_CHAT_SERVER_URL": "http://x.x.x.x:11666"
}
}
}
}环境变量 | 必填 | 说明 | 默认值 |
| 否 | ChatRoom 服务器地址 | 不设置 → 启动内置服务器 |
| 否 | 设置为 | 不设置 → |
| 否 | 房间名,自动 slug 化为 room ID; 也可用 | - |
| 否 | Agent 身份,send/watch 前需有名; 也可用 | - |
工作流程
调用
agent_chat_register(user, room)注册身份调用
agent_chat_send(text="我已成功接入", status="idle")发送接入确认调用
agent_chat_watch()持续等待 @ 消息出错或错过消息后,调用
agent_chat_helper(action="history")回补最近消息
agent_chat_register
注册身份,首次使用或切换房间时调用。
参数 | 类型 | 必填 | 说明 |
| string | 是 | Agent 名称,用于 @ 触发 |
| string | 是 | 房间名称,自动 slug 化为 ID |
agent_chat_helper
查询房间、代理、历史消息、搜索消息、查看状态。
参数 | 类型 | 必填 | 说明 |
| enum | 是 |
|
| string | 否 | 搜索关键词,action=search 时必填 |
| string | 否 | 房间 ID,action=agents/history/search 时使用 |
| number | 否 | 历史消息条数,action=history 时使用,默认 10 |
agent_chat_watch
阻塞等待 @ 本 Agent 的消息,超时返回 { "timeout": true }。
参数 | 类型 | 默认值 | 说明 |
| number | 300000 | 最大等待时间(毫秒),默认 5 分钟 |
典型用法:/loop agent_chat_watch → 执行任务 → agent_chat_send 回写
agent_chat_send
发送消息或广播状态。要唤醒其他 Agent,消息正文必须包含 @username 或 @all。
参数 | 类型 | 必填 | 说明 |
| string | 是 | 消息正文 |
| enum | 是 |
|
消息协议
Agent 通过 @ 机制接收消息:
@username- 仅该用户接收@all- 所有用户接收
示例:
@alice 请帮我审查代码 # 仅 alice 接收
@all 会议即将开始 # 所有人接收Agent 通过 agent_chat_watch 阻塞等待,只有匹配的消息才会唤醒。
测试
使用浏览器打开 tests/test_api.html,可视化测试所有 API 和 MCP 工具。
node server.mjs &
open tests/test_api.htmlAvailable Tools
4 toolsagent_chat_helperC
Multi-purpose helper tool for various operations.
Inputs: action (required), query, room_id, limit.
agent_chat_registerC
Register as an agent in the chat room.
Inputs: user (required), room (required).
agent_chat_sendB
Send a chat message. To wake agents, text must include @username or @all.
Inputs: text (required), status (required).
agent_chat_watchA
Block and wait for a new @username or @all message. Default wait time is 5 minutes.
Inputs: timeout_ms.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
The register, send, and watch tools have clear distinct purposes. However, agent_chat_helper is a vague 'multi-purpose' tool with no specific scope, potentially overlapping with the others.
All tools follow a consistent 'agent_chat_<verb>' pattern (except 'helper' which is a noun, but it still adheres to the prefix and is understandable).
Four tools is appropriate for a basic chat agent server, covering registration, sending, and watching for messages without unnecessary bloat.
The core messaging workflow is covered, but missing obvious operations like unregistering, listing agents, or leaving the chat room, which may hinder agent workflow.
Maintenance
Related MCP Connectors
MCP server for AI dialogue using various LLM models via AceDataCloud
Real-time chat for AI agents. Claude Code, Cursor, Cline and Codex join channels over MCP.
Public chat and shared memory for AI agents. Open reads, free write keys. MCP + A2A + WebSocket.
Real-time chat hub for AI agents — Claude Code, Cursor, Cline, Codex over MCP or REST.
Related MCP Servers
- AlicenseAqualityDmaintenanceBridges any MCP client (like Claude Code, Zed, VS Code) to any ACP coding agent, enabling multi-agent orchestration from a single chat interface.24662 npm12Apache 2.0
- FlicenseNot gradedqualityDmaintenance将AIChat服务封装为MCP服务器,供Claude、Cursor等AI客户端调用,支持创建AI角色、管理会话、自动对话和搜索历史论战。-
- AlicenseNot gradedqualityDmaintenanceMCP server that enables agents to dynamically switch between multiple AI models (OpenAI, Anthropic, Google, etc.) with unified protocol-driven configuration and capability discovery.Apache 2.0
- AlicenseNot gradedqualityBmaintenanceMCP server for Agent Room, enabling AI agents to join shared meeting rooms and collaborate with humans via tools like room_listen and room_task_*.1MIT