A complete NATS-based messaging system for AI agents with MCP (Model Context Protocol) integration for Claude Code.
- 12 AI Agents with distinct personalities and roles
- NATS Message Broker for reliable message routing
- MCP Server for Claude Code integration
- Web UI for real-time message viewing
- Namespace Support for multi-repo deployments
- Async Python with modern asyncio patterns
pip install -r requirements.txtSet your NATS server URL:
export NATS_URL="nats://localhost:4222"
export NATS_NAMESPACE="my-project" # Optional, defaults to 'themultiverse'python start_agents.pypython agent_messaging_web.pyThe MCP server is pre-configured. Just use the tools:
# Send a DM to an agent
dm_agent(
agent_name="sylvia",
content="Explain prompt engineering",
from_user="you@example.com"
)
# List all agents
get_agents()
# View messages
view_messages(agent_name="sylvia")| Agent | Role |
|---|---|
| Sylvia | Teaching Assistant |
| Roy | Course Coordinator |
| Cynthia | Student Support |
| Moss | Technical Support |
| Tessa | Community Manager |
| Historian | Knowledge Keeper |
| Architect | System Designer |
| Ray | Learning Facilitator |
| Orchestrator | Workflow Coordinator |
| Monitor | System Observer |
| Aetherix | Matrix Manager |
| Morgan | Research Assistant |
┌─────────────┐
│ Claude │
│ Code │
└──────┬──────┘
│ MCP
▼
┌─────────────────┐
│ MCP Server │
└────────┬────────┘
│
▼
┌────────────┐
│ NATS │
└──────┬─────┘
│
┌──────┴──────┐
▼ ▼
┌─────────┐ ┌─────────┐
│ Agent 1 │ │ Agent 2 │
└─────────┘ └─────────┘
agent_messaging.py- Core messaging infrastructurestart_agents.py- Agent launcheragent_messaging_web.py- Web UI server
mcp_server/servers/agent_messaging_server.py- FastMCP servermcp_server/operations/agent_messaging_ops.py- Operations.mcp.json- MCP configuration
.claude/settings.local.json- Claude Code settings.cursor/rules/- Cursor AI agent rules.env.example- Environment variables template
examples/- Usage examplesdocs/- Additional documentation
Edit agent_messaging.py and add to AGENT_PERSONAS:
AGENT_PERSONAS = {
'custom_agent': {
'name': 'Custom Agent',
'role': 'Your Custom Role'
}
}async def custom_handler(message: Message):
# Your custom logic
await agent.send_message(message.from_user, "Custom response")
agent = AgentMessageQueue('agent_name', message_handler=custom_handler)Set NATS_NAMESPACE environment variable to use different namespaces for different projects:
export NATS_NAMESPACE="project-name"| Tool | Description |
|---|---|
dm_agent |
Send a DM to an agent |
get_agents |
List all available agents |
view_messages |
View message history |
view_conversation |
View conversation between users |
- Python 3.8+
- NATS Server (local or remote)
- FastMCP
- nats-py
- Flask (for web UI)
MIT
For issues and questions, please open an issue on GitHub.