Implements Agent-to-Agent (A2A) communication protocols for cross-framework interoperability, covering MCP and A2A standards to enable agent discovery, task delegation, and collaboration across LangChain, AutoGen, CrewAI, and custom systems.
Ships in agent-architect. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Enable agents to discover, communicate, and collaborate across frameworks and systems.
Different agent frameworks:
Problem: They can't talk to each other natively.
Solution: Standard protocols for agent communication.
| Protocol | Purpose | Governance |
|---|---|---|
| MCP (Model Context Protocol) | Agent ↔ tools, resources, prompts | Created by Anthropic; donated in Dec 2025 to the Agentic AI Foundation (a Linux Foundation directed fund) |
| A2A (Agent2Agent) | Agent ↔ agent task delegation and discovery | Created by Google; hosted by the Linux Foundation since June 2025 |
| Custom REST/gRPC | Point-to-point | Your own contracts |
MCP and A2A are complementary: MCP connects an agent to tools and data; A2A connects agents to each other. Specs: https://modelcontextprotocol.io/specification and https://a2a-protocol.org.
MCP standardizes how agents access tools and resources:
┌─────────────────┐ ┌─────────────────┐
│ Agent │ │ MCP Server │
│ (MCP Client) │◀────────▶│ (Tools/Data) │
└─────────────────┘ └─────────────────┘
│
│ MCP Protocol
│ - List tools
│ - Call tools
│ - Access resources
▼
┌─────────────────┐
│ Another Agent │
│ (MCP Client) │
└─────────────────┘
from mcp.server import Server
from mcp.types import Tool, TextContent
# Create MCP server
server = Server("my-agent-tools")
@server.tool()
async def search_database(query: str) -> str:
"""Search the internal database."""
results = await db.search(query)
return json.dumps(results)
@server.tool()
async def send_notification(
recipient: str,
message: str
) -> str:
"""Send a notification to a user."""
await notifications.send(recipient, message)
return "Notification sent"
# Run server
if __name__ == "__main__":
server.run()
# pip install mcp langchain-mcp-adapters langchain
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
from langchain_mcp_adapters.tools import load_mcp_tools
from langchain.agents import create_agent
async def run_mcp_agent(question: str):
"""Run an agent whose tools come from an MCP server."""
server_params = StdioServerParameters(
command="python",
args=["mcp_server.py"]
)
# The MCP session must stay open while the agent uses its tools
async with stdio_client(server_params) as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await load_mcp_tools(session)
agent = create_agent(llm, tools)
return await agent.ainvoke({"messages": [{"role": "user", "content": question}]})
from dataclasses import dataclass
from enum import Enum
from typing import Any
import uuid
class MessageType(Enum):
REQUEST = "request"
RESPONSE = "response"
BROADCAST = "broadcast"
HANDOFF = "handoff"
@dataclass
class AgentMessage:
"""Standard message format for A2A communication."""
id: str
type: MessageType
sender: str
recipient: str | None # None for broadcasts
content: dict
reply_to: str | None = None
timestamp: str = None
def __post_init__(self):
if not self.id:
self.id = str(uuid.uuid4())
if not self.timestamp:
self.timestamp = datetime.now().isoformat()
def to_dict(self) -> dict:
return {
"id": self.id,
"type": self.type.value,
"sender": self.sender,
"recipient": self.recipient,
"content": self.content,
"reply_to": self.reply_to,
"timestamp": self.timestamp
}
@classmethod
def from_dict(cls, data: dict) -> "AgentMessage":
return cls(
id=data["id"],
type=MessageType(data["type"]),
sender=data["sender"],
recipient=data.get("recipient"),
content=data["content"],
reply_to=data.get("reply_to"),
timestamp=data.get("timestamp")
)
class AgentRegistry:
"""Central registry for agent discovery."""
def __init__(self, redis_client):
self.redis = redis_client
async def register(
self,
agent_id: str,
capabilities: list[str],
endpoint: str,
metadata: dict = None
):
"""Register an agent with its capabilities."""
agent_info = {
"agent_id": agent_id,
"capabilities": capabilities,
"endpoint": endpoint,
"metadata": metadata or {},
"registered_at": datetime.now().isoformat(),
"last_heartbeat": datetime.now().isoformat()
}
# Store agent info
await self.redis.hset(
"agents",
agent_id,
json.dumps(agent_info)
)
# Index by capability
for cap in capabilities:
await self.redis.sadd(f"capability:{cap}", agent_id)
async def find_by_capability(self, capability: str) -> list[dict]:
"""Find agents with a specific capability."""
agent_ids = await self.redis.smembers(f"capability:{capability}")
agents = []
for aid in agent_ids:
info = await self.redis.hget("agents", aid)
if info:
agents.append(json.loads(info))
return agents
async def heartbeat(self, agent_id: str):
"""Update agent heartbeat."""
info = await self.redis.hget("agents", agent_id)
if info:
data = json.loads(info)
data["last_heartbeat"] = datetime.now().isoformat()
await self.redis.hset("agents", agent_id, json.dumps(data))
class AgentCommunicator:
"""Handle agent-to-agent communication."""
def __init__(self, agent_id: str, registry: AgentRegistry):
self.agent_id = agent_id
self.registry = registry
self.message_handlers = {}
def on_message(self, message_type: MessageType):
"""Decorator to register message handlers."""
def decorator(func):
self.message_handlers[message_type] = func
return func
return decorator
async def send(
self,
recipient: str,
content: dict,
message_type: MessageType = MessageType.REQUEST
) -> AgentMessage:
"""Send message to another agent."""
# Get recipient endpoint
recipient_info = await self.registry.get(recipient)
if not recipient_info:
raise ValueError(f"Agent {recipient} not found")
message = AgentMessage(
id=str(uuid.uuid4()),
type=message_type,
sender=self.agent_id,
recipient=recipient,
content=content
)
# Send via HTTP
async with aiohttp.ClientSession() as session:
async with session.post(
f"{recipient_info['endpoint']}/messages",
json=message.to_dict()
) as response:
return await response.json()
async def request(
self,
capability: str,
content: dict,
timeout: float = 30.0
) -> dict:
"""Find agent by capability and send request."""
agents = await self.registry.find_by_capability(capability)
if not agents:
raise ValueError(f"No agent with capability: {capability}")
# Simple: pick first available
target = agents[0]
response = await self.send(
target["agent_id"],
content,
MessageType.REQUEST
)
return response
async def broadcast(self, content: dict, capability: str = None):
"""Broadcast message to multiple agents."""
if capability:
agents = await self.registry.find_by_capability(capability)
else:
agents = await self.registry.get_all()
tasks = [
self.send(a["agent_id"], content, MessageType.BROADCAST)
for a in agents
]
return await asyncio.gather(*tasks, return_exceptions=True)
@dataclass
class HandoffRequest:
"""Request to hand off a task to another agent."""
task_id: str
task_type: str
context: dict
state: dict
reason: str
required_capabilities: list[str]
@dataclass
class HandoffResponse:
"""Response to handoff request."""
accepted: bool
agent_id: str
reason: str = None
class HandoffProtocol:
"""Protocol for handing off tasks between agents."""
def __init__(self, communicator: AgentCommunicator):
self.comm = communicator
async def request_handoff(
self,
request: HandoffRequest
) -> HandoffResponse:
"""Request another agent to take over a task."""
# Find capable agents
candidates = []
for cap in request.required_capabilities:
agents = await self.comm.registry.find_by_capability(cap)
candidates.extend(agents)
# Deduplicate
candidates = {a["agent_id"]: a for a in candidates}.values()
# Request handoff from each until accepted
for candidate in candidates:
response = await self.comm.send(
candidate["agent_id"],
{
"type": "handoff_request",
"request": asdict(request)
},
MessageType.HANDOFF
)
if response.get("accepted"):
return HandoffResponse(
accepted=True,
agent_id=candidate["agent_id"]
)
return HandoffResponse(
accepted=False,
agent_id=None,
reason="No agent accepted the handoff"
)
async def accept_handoff(
self,
request: HandoffRequest
) -> bool:
"""Accept a handoff and begin processing."""
# Validate we can handle it
# ... capability check
# Restore state
# ... state restoration
return True
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
app = FastAPI()
class MessageRequest(BaseModel):
sender: str
content: dict
message_type: str = "request"
@app.post("/agents/{agent_id}/messages")
async def receive_message(agent_id: str, message: MessageRequest):
"""Receive message from another agent."""
if agent_id != MY_AGENT_ID:
raise HTTPException(404, "Agent not found")
# Process message
result = await agent.process_message(
AgentMessage(
id=str(uuid.uuid4()),
type=MessageType(message.message_type),
sender=message.sender,
recipient=agent_id,
content=message.content
)
)
return {"status": "processed", "result": result}
@app.get("/agents/{agent_id}/capabilities")
async def get_capabilities(agent_id: str):
"""Get agent capabilities."""
return {
"agent_id": agent_id,
"capabilities": ["research", "summarization", "coding"],
"status": "active"
}
@app.post("/agents/{agent_id}/handoff")
async def handle_handoff(agent_id: str, request: dict):
"""Handle handoff request."""
handoff = HandoffRequest(**request)
# Check if we can accept
can_accept = await agent.can_handle(handoff)
if can_accept:
await agent.accept_handoff(handoff)
return {"accepted": True}
else:
return {"accepted": False, "reason": "Capacity exceeded"}
# Sign messages
import hmac
import hashlib
def sign_message(message: AgentMessage, secret: str) -> str:
"""Sign message for authenticity."""
payload = json.dumps(message.to_dict(), sort_keys=True)
return hmac.new(
secret.encode(),
payload.encode(),
hashlib.sha256
).hexdigest()
def verify_signature(message: AgentMessage, signature: str, secret: str) -> bool:
"""Verify message signature."""
expected = sign_message(message, secret)
return hmac.compare_digest(signature, expected)
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
a2a, agent-communication, mcp, interoperability, multi-agent
/agent-architect:a2a-protocolsfrom agent-architect
npx claudepluginhub latestaiagents/agent-skills --plugin agent-architect13 skills in this plugin
/agent-checkpointingImplement checkpointing for agent recovery, debugging, and replay.
Use this skill when building recoverable agents, implementing replay,
debugging agent failures, or creating resumable workflows.
Activate when: agent checkpoint, agent recovery, resume agent, agent restart,
workflow replay, agent debugging, failure recovery, state snapshot.
/agent-cost-budgetingUse this skill when managing AI agent costs. Activate when the user needs to control token usage,
implement cost limits for agents, optimize LLM spending, track agent costs, or prevent runaway
API bills in agent systems.
/Other plugins' skills for the same job
4 plugins in one repository ship this exact skill · first indexed Nov 5, 2026