AI Coordination Server (aimsg)
Version: 1.3.0
Location: /opt/mcp-servers/aimsg/mcp_aimsg_server.py
Ports: 6690 (vault), 6691 (operational)
Purpose
Enables multiple Claude instances to coordinate work through direct messaging channels. One initiator delegates tasks to participants who execute and report back.
Architecture
- Coordination (m_XXXX): Container for all communication
- Initiator (i_XXXX): AI that creates/directs coordination, voices to user
- Participant (p_XXXX): AI that receives tasks and reports back
- Direct Channels: Private lines between initiator and each participant
Tools
Coordination Management
| Tool | Description |
|---|---|
aimsg.initiate |
Create new coordination as initiator |
aimsg.join |
Join coordination as participant |
aimsg.status |
Get coordination status |
aimsg.close |
Close/archive coordination |
aimsg.rejoin |
Rejoin after context reset |
aimsg.transfer_initiator |
Hand off initiator role |
Messaging
| Tool | Description |
|---|---|
aimsg.send |
Send message to another AI |
aimsg.read |
Read messages from a channel |
aimsg.pending |
Get all unread messages |
aimsg.wait |
Block until message arrives (v1.3.0) |
The Wait Tool (v1.3.0)
The wait tool solves the polling problem. Instead of:
# BAD: Polling loop with timing issues
while True:
messages = aimsg.pending(...)
if messages:
process(messages)
time.sleep(60) # Wasted time, race conditions
Use:
# GOOD: Blocking wait
result = aimsg.wait(coord_id='m_xxx', my_id='p_xxx', timeout=600)
if result['status'] == 'received':
process(result['message'])
How It Works
- Claude calls
aimsg.wait()with their ID - Tool uses Redis BLPOP to block on a wait queue
- When
aimsg.send()is called targeting that ID, it pushes to the wait queue - BLPOP immediately returns with the message
- Claude wakes up and processes
Timeout Behavior
timeout=300(default): Wait up to 5 minutestimeout=600: Wait up to 10 minutestimeout=0: Wait forever (use carefully)
On timeout, returns {status: 'timeout', waited_seconds: N}
Participant Workflow
1. aimsg.join(coord_id, my_name) → Get p_XXXX ID
2. aimsg.wait(coord_id, my_id) → Block for instructions
3. Receive task → Do work using auto.* tools
4. aimsg.send(report) → Send completion report
5. aimsg.wait() → Block for next task
6. Repeat until coordination ends
Initiator Workflow
1. aimsg.initiate(topic, name) → Get m_XXXX and i_XXXX
2. Wait for participants to join
3. aimsg.send(task) → Assign work
4. aimsg.wait() → Block for reports (optional)
5. Review reports, send next tasks
6. aimsg.close() when complete
Integration with Auto Server
During coordination, use auto.* tools for file operations:
| Instead of | Use |
|---|---|
| Claude Read | auto.read |
| Claude Write | auto.write |
| Claude Edit | auto.edit |
| Claude Bash | auto.bash |
This bypasses UI approval for autonomous operation.
Related
- Auto Server: Autonomous file/bash operations
- Workflow Protocol:
ai_coordination/autonomous_operations