Orchestrate Multi-Agent Communication
MCP server letting multiple AI agents register, discover each other, and exchange messages or broadcasts, using simple file-based storage.
Why it matters
Enable dynamic collaboration between multiple AI agents through asynchronous message exchange, facilitating complex task coordination and distributed processing.
Outcomes
What it gets done
Register and discover AI agents dynamically.
Facilitate bidirectional message passing between agents.
Support broadcast messaging with priority levels.
Manage agent status and provide file storage capabilities.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-agentic-framework | bash Capabilities
Tools your agent gets
Register a new agent with name, description, and optional instanceId
Remove an agent from the system by ID
List all registered agents with their status and activity
Send a message from one agent to another
Get unread messages for an agent (deleted after reading)
Update agent status (online, offline, busy, away)
Send a broadcast message to all agents except the sender with priority levels
Get pending notifications for an agent
Overview
Agentic Framework MCP Server
An MCP server implementing a lightweight multi-agent communication framework: agents register with a name and description, discover each other, exchange direct or broadcast messages, and track status, all backed by simple file-based storage rather than a database. Use it when multiple AI agents need to actually communicate and coordinate with each other in real time, such as delegating tasks, negotiating, or broadcasting alerts, rather than working in isolated, one-way sub-agent invocations.
What it does
An MCP server built as a communication framework for multiple AI agents, letting Claude, or any MCP-compatible agent, register with a unique identity, discover other registered agents, and exchange messages asynchronously, including one-to-one messages and broadcasts to everyone else. It uses file-based storage for simplicity and portability, so it runs without an external database, and was built with test-driven development and functional programming principles.
When to use - and when NOT to
This is a genuinely different pattern from Claude Code's sub-agents feature, and the two suit different situations. Use Claude Code sub-agents for well-defined, repetitive tasks with predictable behavior and isolated context, like code review or debugging. Use this framework instead when agents need real-time, bidirectional collaboration - discussion, negotiation, or coordinating a distributed workflow where agents genuinely need to talk to each other rather than one agent invoking another and waiting for a result. The two are complementary rather than exclusive: MCP agents can collaborate to design a sub-agent's configuration, while sub-agents handle the routine work that comes out of that discussion. Messages are deleted after being read once, so a check-for-messages call consumes them - there is no message history to replay later.
Capabilities
register-agent, taking a name, description, and optional instanceId, adds an agent to the registry. unregister-agent removes one by ID. discover-agents lists all currently registered agents with their status and last activity. send-message delivers a direct message from one agent ID to another. check-for-messages retrieves and clears an agent's unread messages. send-broadcast sends a priority-tagged message, low, normal, or high, to every registered agent except the sender, returning a delivered recipient count. update-agent-status sets an agent's status to online, offline, busy, or away. get-pending-notifications retrieves pending notifications for an agent.
How to install
git clone https://github.com/Piotr1215/mcp-agentic-framework.git
cd mcp-agentic-framework
npm install
npm test
For HTTP transport, run npm run start:http and configure Claude:
{
"mcpServers": {
"agentic-framework": {
"type": "http",
"url": "http://127.0.0.1:3113/mcp"
}
}
}
A Kubernetes deployment path is also documented, using a Justfile-based workflow with a LoadBalancer service for production use.
Who it's for
Developers building distributed multi-agent workflows, such as orchestrated task processing, distributed code review, or emergency coordination between monitoring agents, that need agents to actually talk to each other, not just be invoked one-way. Registered agent and message data is stored under /tmp/mcp-agentic-framework/, with file-based locking to prevent race conditions and no external network calls, which keeps the framework self-contained for local or cluster-internal use. The project is licensed under MIT.
Source README
MCP Agentic Framework
A Model Context Protocol (MCP) based communication framework that enables multiple AI agents to collaborate through asynchronous messaging. Built with Test-Driven Development (TDD) and functional programming principles.
Overview
This framework provides a standardized way for multiple Claude agents (or other MCP-compatible agents) to:
- Register themselves with unique identities
- Discover other registered agents
- Exchange messages asynchronously
- Send broadcasts to all agents
- Work together on complex tasks
The framework uses file-based storage for simplicity and portability, making it easy to run without external dependencies.
Comparison with Claude Code Sub-agents
This framework provides a different approach to multi-agent collaboration compared to Claude Code's sub-agents feature.
| Aspect | Claude Code Sub-agents | MCP Agentic Framework |
|---|---|---|
| Architecture | Static configuration files | Dynamic agent registration |
| Context | Isolated per task | Shared across agents with individual message queues |
| Communication | One-way (Claude invokes agent) | Bidirectional (agents communicate with each other) |
| Configuration | YAML frontmatter + system prompt | Runtime registration with name and description |
| Flexibility | Predefined behavior | Runtime-adaptable interaction patterns |
| Storage | .claude/agents/ directories |
File-based message queue system |
| Tool Access | Fixed at configuration time | Determined by MCP server configuration |
When to Use Each Approach
Use Claude Code Sub-agents when:
- Tasks are well-defined and repetitive (code review, debugging, testing)
- Consistent, predictable behavior is required
- Working independently on specific problems
- Need to preserve main conversation context
Use MCP Agentic Framework when:
- Real-time collaboration between multiple agents is needed
- Tasks require discussion, negotiation, or consensus
- Problem-solving benefits from diverse perspectives
- Building distributed workflows with agent coordination
Both systems can be complementary: MCP agents can collaborate to design and refine sub-agent configurations, while sub-agents can handle routine tasks identified by MCP agent discussions.
Kubernetes Deployment
The MCP Agentic Framework can be deployed on Kubernetes for production use with high availability and easy management.
Prerequisites
- Kubernetes cluster with MetalLB LoadBalancer (or similar)
- Docker Hub account (or other container registry)
justcommand runner installed (cargo install just)
Quick Start
- Clone and navigate to the framework:
cd /home/decoder/dev/mcp-agentic-framework
- Deploy with the Justfile:
# First time: Update the docker_user in Justfile
vim Justfile # Change docker_user to your Docker Hub username
# Deploy (builds, pushes, and deploys to Kubernetes)
just update
- Get the LoadBalancer IP:
just status
# Or manually:
kubectl get svc mcp-agentic-framework-lb
- Update Claude configuration (
~/.claude.json):
"agentic-framework": {
"type": "http",
"url": "http://YOUR_LOADBALANCER_IP:3113/mcp"
}
Managing the Deployment
# View all available commands
just
# Deploy updates (bumps version, builds, pushes, deploys)
just update # Patch version bump (1.0.0 -> 1.0.1)
just update-minor # Minor version bump (1.0.0 -> 1.1.0)
just update-major # Major version bump (1.0.0 -> 2.0.0)
# Monitor deployment
just status # Check deployment status
just logs # Stream logs
just test-health # Test health endpoint
# Operations
just restart # Restart the deployment
just rollback # Rollback to previous version
Features
- Zero-downtime deployments with rolling updates
- Automatic version management with semantic versioning
- Health checks with automatic restarts
- Persistent LoadBalancer IP via MetalLB
- Web UI for monitoring agent communications (auto-opens on first agent)
Architecture
The Kubernetes deployment includes:
- Deployment: Single replica with health/readiness probes
- LoadBalancer Service: Stable external IP for Claude access
- ClusterIP Service: Internal cluster communication
Kubernetes Manifests
Located in k8s/ directory:
deployment.yaml- Main application deploymentloadbalancer-service.yaml- External access via MetalLB
Architecture
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Developer Agent │ │ Tester Agent │ │ Architect Agent │
└────────┬────────┘ └────────┬────────┘ └────────┬────────┘
│ │ │
└───────────────────────┴───────────────────────┘
│
┌──────────┴──────────┐
│ MCP Server │
│ ┌──────────────┐ │
│ │Agent Registry│ │
│ └──────────────┘ │
│ ┌──────────────┐ │
│ │ Message Store│ │
│ └──────────────┘ │
└─────────────────────┘
│
┌──────────┴──────────┐
│ File Storage │
│/tmp/mcp-agentic- │
│ framework/ │
└─────────────────────┘
Installation
- Clone the repository:
git clone https://github.com/Piotr1215/mcp-agentic-framework.git
cd mcp-agentic-framework
- Install dependencies:
npm install
- Run tests to verify installation:
npm test
Usage with Claude Desktop or Claude Code
Using HTTP Transport
{
"mcpServers": {
"agentic-framework": {
"type": "http",
"url": "http://127.0.0.1:3113/mcp"
}
}
}
To use the HTTP transport:
- Start the HTTP server:
npm run start:http - Add the above configuration to your
~/.claude.json - Restart Claude Desktop
Note: The HTTP transport supports Server-Sent Events (SSE)
HTTP Endpoints
When running with npm run start:http, the following endpoints are available:
/mcp- Main MCP endpoint for agent communication/health- Health check endpoint that returns:{ "status": "ok", "name": "mcp-agentic-framework", "version": "1.0.0" }
Available Tools
register-agent
Register a new agent in the system.
Parameters:
name(string, required): Agent's display namedescription(string, required): Agent's role and capabilitiesinstanceId(string, optional): Instance identifier for automatic deregistration
Example:
{
"name": "DeveloperAgent",
"description": "Responsible for writing code and implementing features"
}
unregister-agent
Remove an agent from the system.
Parameters:
id(string, required): Agent's unique identifier
discover-agents
List all currently registered agents.
Parameters: None
Response Example:
[
{
"id": "agent_abc123",
"name": "DeveloperAgent",
"description": "Responsible for writing code",
"status": "online",
"lastActivityAt": "2024-01-20T10:30:00.000Z"
}
]
send-message
Send a message from one agent to another.
Parameters:
to(string, required): Recipient agent's IDfrom(string, required): Sender agent's IDmessage(string, required): Message content
check-for-messages
Retrieve unread messages for an agent. Messages are automatically deleted after reading.
Parameters:
agent_id(string, required): Agent's ID to check messages for
Response Example:
{
"messages": [
{
"from": "agent_abc123",
"fromName": "DeveloperAgent",
"message": "Task completed",
"timestamp": "2024-01-20T10:30:00.000Z"
}
]
}
update-agent-status
Update an agent's status (online, offline, busy, away).
Parameters:
agent_id(string, required): Agent's IDstatus(string, required): New status (one of: online, offline, busy, away)
send-broadcast
Send a broadcast message to all registered agents (except the sender).
Parameters:
from(string, required): Sender agent's IDmessage(string, required): Broadcast message contentpriority(string, optional): Priority level (low, normal, high). Defaults to 'normal'
Features:
- Messages are delivered to all agents except the sender
- Works without requiring agents to subscribe
- Returns the number of recipients
- Messages are prefixed with priority level (e.g., "[BROADCAST HIGH]")
Example:
{
"from": "orchestrator",
"message": "System maintenance in 10 minutes",
"priority": "high"
}
Response:
{
"success": true,
"recipientCount": 5,
"errors": [] // Any delivery failures
}
get-pending-notifications
Retrieve pending notifications for an agent.
Parameters:
agent_id(string, required): Agent's ID
Example Use Cases
Multi-Agent Collaboration
1. Register agents:
- "Register an orchestrator agent for coordinating tasks"
- "Register worker1 agent for processing"
- "Register worker2 agent for analysis"
2. Orchestrator delegates tasks:
- "Send message from orchestrator to worker1: Process customer data"
- "Send message from orchestrator to worker2: Analyze market trends"
3. Workers communicate:
- "Send message from worker1 to worker2: Data ready for analysis"
4. Broadcast updates:
- "Send broadcast from orchestrator: All tasks completed"
Using Broadcasts
The improved broadcast feature allows efficient communication with all agents:
// Orchestrator sends high-priority announcement
await sendBroadcast(
orchestratorId,
"Emergency: System overload detected, pause all operations",
"high"
);
// All other agents receive: "[BROADCAST HIGH] Emergency: System overload..."
// Regular status update
await sendBroadcast(
orchestratorId,
"Daily standup meeting in 5 minutes",
"normal"
);
// All agents receive: "[BROADCAST NORMAL] Daily standup meeting..."
Development
Running Tests
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:coverage
Storage
The framework stores data in /tmp/mcp-agentic-framework/:
agents.json: Registered agents with status and activity trackingmessages/*.json: Individual message files (one per message)
Security Considerations
- Input validation on all tool parameters
- File-based locking prevents race conditions
- No path traversal vulnerabilities
- Messages are stored locally only
- No external network calls
API Reference
Agent Object
interface Agent {
id: string; // Unique identifier
name: string; // Display name
description: string; // Role description
status: string; // online|offline|busy|away
registeredAt: string; // ISO timestamp
lastActivityAt: string; // ISO timestamp
}
Message Object
interface Message {
id: string; // Message ID
from: string; // Sender agent ID
to: string; // Recipient agent ID
message: string; // Content
timestamp: string; // ISO timestamp
read: boolean; // Read status
}
Practical Use Cases
1. Orchestrated Task Processing
Orchestrator → assigns tasks → Worker agents
Worker agents → process in parallel → report back
Orchestrator → broadcasts completion → all agents notified
2. Distributed Code Review
Developer → sends code → multiple Reviewers
Reviewers → work independently → send feedback
Developer → broadcasts updates → all reviewers see changes
3. Emergency Coordination
Monitor agent → detects issue → broadcasts alert
All agents → receive alert → adjust behavior
Coordinator → broadcasts all-clear → normal operations resume
Troubleshooting
Common Issues
Broadcasts not received
- Ensure sender agent is registered
- Check recipient agents are registered
- Remember sender doesn't receive own broadcasts
"Agent not found" errors
- Verify agent registration
- Use
discover-agentsto list all agents - Check agent IDs are correct
Messages not received
- Messages are deleted after reading
- Each message can only be read once
- Check correct agent ID
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.