Auto-discovered marketplace from krittin-khanueng/mcp-broker
npx claudepluginhub krittin-khanueng/mcp-brokerMulti-agent communication broker — message bus, presence, and coordination for Claude agents
ระบบ broker สำหรับสื่อสารระหว่าง agent หลายตัว ทำงานผ่าน MCP server ช่วยให้ AI agent หลายตัว (เช่น Claude หลาย instance) ค้นหากัน ส่งข้อความ และประสานงานผ่าน channel ร่วมกัน — ข้อมูลทั้งหมดเก็บใน SQLite
Claude Code มี Agent tool, subagents, และ teams อยู่แล้ว — แล้วทำไมต้องมี broker อีก?
ระบบ multi-agent ในตัวของ Claude Code มีข้อจำกัด:
| ความสามารถ | Agent/Subagent | Teams | mcp-broker |
|---|---|---|---|
| ค้นหา agent (ใครออนไลน์อยู่?) | - | - | ✓ |
| ส่งข้อความแบบ async (ฝากไว้ อีกฝั่งมาอ่านทีหลัง) | - | - | ✓ |
| Channel (สื่อสารแบบกลุ่ม) | - | - | ✓ |
| ประวัติข้อความและการเก็บข้อมูลถาวร | - | - | ✓ |
| ส่งตาม role (ส่งถึง worker ทั้งหมด) | - | - | ✓ |
| Broadcast (ประกาศทุกคน) | - | ✓ | ✓ |
| สื่อสารข้าม session | - | - | ✓ |
| ติดตามสถานะออนไลน์ (heartbeat) | - | - | ✓ |
Agent A ──stdio──▶ ┌─────────────┐ ◀──stdio── Agent B
│ mcp-broker │
Agent C ──stdio──▶ │ (SQLite) │ ◀──stdio── Agent D
└─────────────┘
แต่ละ agent เชื่อมต่อผ่าน stdio และใช้ MCP tools เพื่อ:
# ติดตั้ง Bun (macOS / Linux)
curl -fsSL https://bun.sh/install | bash
# ตรวจสอบเวอร์ชัน
bun --version
# เพิ่ม marketplace
/plugin marketplace add krittinkhaneung/mcp-broker
# ติดตั้ง plugin
/plugin install broker
ได้ MCP server (15 tools), คำสั่ง slash, coordinator agent, และ hooks ทั้งหมด — ตั้งค่าให้อัตโนมัติ
# โคลนและติดตั้ง
git clone https://github.com/krittinkhaneung/mcp-broker.git
bun install
# เพิ่มเข้า Claude Code
claude mcp add --transport stdio broker -- bun /path/to/mcp-broker/src/index.ts
# รันทดสอบ
bun test
เปิด 2 Claude Code sessions ในเครื่องเดียวกัน:
Session A:
> "ลงทะเบียนชื่อ 'alice' แล้วส่งข้อความถึง bob ว่า 'พร้อมเริ่มแล้ว'"
# Claude เรียก: register(name: "alice", role: "peer")
# Claude เรียก: send_message(to: "bob", content: "พร้อมเริ่มแล้ว")
Session B:
> "ลงทะเบียนชื่อ 'bob' แล้วเช็คข้อความ"
# Claude เรียก: register(name: "bob", role: "peer")
# Claude เรียก: poll_messages()
# → ได้รับ: {from: "alice", content: "พร้อมเริ่มแล้ว"}
> "สร้าง channel #code-review สำหรับทีม"
# Claude เรียก: create_channel(name: "#code-review", purpose: "รีวิว PR")
> "ส่งไปที่ #code-review: PR #42 ต้องการรีวิว"
# Claude เรียก: send_message(to: "channel:#code-review", content: "PR #42 ต้องการรีวิว")
ทุก agent ที่ join channel จะเห็นข้อความเมื่อ poll
> "ประกาศทุก agent: จะ deploy ใน 5 นาที"
# Claude เรียก: send_message(to: "all", content: "จะ deploy ใน 5 นาที")
ทุก agent ที่ออนไลน์จะได้รับข้อความ
> "ส่งถึง worker ทุกตัว: มีงานใหม่ใน #task-queue"
# Claude เรียก: send_message(to: "role:worker", content: "มีงานใหม่ใน #task-queue")
เฉพาะ agent ที่ลงทะเบียนด้วย role worker เท่านั้นที่จะได้รับ