An agentic communication framework for multi-agent collaboration using MCP.
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.
This framework provides a standardized way for multiple Claude agents (or other MCP-compatible agents) to:
The framework uses file-based storage for simplicity and portability, making it easy to run without external dependencies.
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 |
Use Claude Code Sub-agents when:
Use MCP Agentic Framework when:
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.
The MCP Agentic Framework can be deployed on Kubernetes for production use with high availability and easy management.
just
command runner installed (cargo install just
)cd /home/decoder/dev/mcp-agentic-framework
# 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
just status
# Or manually:
kubectl get svc mcp-agentic-framework-lb
~/.claude.json
):"agentic-framework": {
"type": "http",
"url": "http://YOUR_LOADBALANCER_IP:3113/mcp"
}
# 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
The Kubernetes deployment includes:
Located in k8s/
directory:
deployment.yaml
- Main application deploymentloadbalancer-service.yaml
- External access via MetalLB┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Developer Agent │ │ Tester Agent │ │ Architect Agent │
└────────┬────────┘ └────────┬────────┘ └────────┬────────┘
│ │ │
└───────────────────────┴───────────────────────┘
│
┌──────────┴──────────┐
│ MCP Server │
│ ┌──────────────┐ │
│ │Agent Registry│ │
│ └──────────────┘ │
│ ┌──────────────┐ │
│ │ Message Store│ │
│ └──────────────┘ │
└─────────────────────┘
│
┌──────────┴──────────┐
│ File Storage │
│/tmp/mcp-agentic- │
│ framework/ │
└─────────────────────┘
git clone https://github.com/Piotr1215/mcp-agentic-framework.git
cd mcp-agentic-framework
npm install
npm test
{
"mcpServers": {
"agentic-framework": {
"type": "http",
"url": "http://127.0.0.1:3113/mcp"
}
}
}
To use the HTTP transport:
npm run start:http
~/.claude.json
Note: The HTTP transport supports Server-Sent Events (SSE)
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"
}
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 deregistrationExample:
{
"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 identifierdiscover-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 contentcheck-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 forResponse 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:
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 ID1. 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"
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..."
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:coverage
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)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
}
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
}
Orchestrator → assigns tasks → Worker agents
Worker agents → process in parallel → report back
Orchestrator → broadcasts completion → all agents notified
Developer → sends code → multiple Reviewers
Reviewers → work independently → send feedback
Developer → broadcasts updates → all reviewers see changes
Monitor agent → detects issue → broadcasts alert
All agents → receive alert → adjust behavior
Coordinator → broadcasts all-clear → normal operations resume
Broadcasts not received
"Agent not found" errors
discover-agents
to list all agentsMessages not received
MIT License
A universal control plane for managing MCP servers and providing intelligent tool discovery for AI agents.
Monitors shadow-cljs builds and provides real-time build status updates.
Automatically builds and serves context files from codebases for AI assistants like Claude.
An AI-powered server providing access to multiple models for code analysis, problem-solving, and collaborative development with guided workflows.
Control CAD software with natural language instructions to perform drawing operations.
Interact with the Bitcoin and Lightning Network to generate keys, validate addresses, decode transactions, and query the blockchain.
An experimental MCP server that uses the ast-grep CLI for code structural search, linting, and rewriting.
Interact with your MLOps and LLMOps pipelines through your ZenML MCP server
An MCP server for the Criage package manager, providing full client functionality via the MCP protocol.
A server providing tools for Xcode project management, simulator management, and app utilities.