a2a-protocol
БесплатноБез исполняемых скриптовНе проверенBuilds Agent2Agent (A2A) servers and clients, the open protocol (originally from Google, now under the Linux Foundation) that lets AI agents from different…
Об этом скилле
A2A Protocol
Overview
The Agent2Agent (A2A) protocol lets agents built on different frameworks discover each other through an Agent Card, exchange messages, and run long-lived tasks without exposing their internals. The current spec is 1.0 (a2a-protocol.org/v1.0.0/specification) with three bindings: JSON-RPC 2.0 over HTTP, HTTP+JSON/REST and gRPC; streaming uses SSE and async work can use webhook push notifications. This skill was checked against a2a-sdk 1.2.1 (Python) and @a2a-js/sdk 1.3.0.
Most tutorials online still show the 0.2/0.3 API (A2AStarletteApplication, TextPart, /.well-known/agent.json, A2AClient). Those no longer exist in 1.x. If a project pins a2a-sdk<1, follow the SDK's v0.3 to v1.0 migration guide (docs/migrations/v1_0 in the a2a-python repo) rather than mixing styles.
Instructions
1. Core concepts (v1.0)
- Agent Card: JSON served at
/.well-known/agent-card.json. Lists name, version,supportedInterfaces(one entry per transport:protocolBindingJSONRPC,HTTP+JSONorGRPC, plusurl), capabilities, skills and security schemes. There is no top-levelurlany more. - Task: stateful unit of work. States:
TASK_STATE_SUBMITTED,WORKING,INPUT_REQUIRED,AUTH_REQUIRED,COMPLETED,FAILED,CANCELED,REJECTED. - Message: one turn with
role(ROLE_USER/ROLE_AGENT) andparts. APartis a single unified type withtext,raw(bytes),urlordata; the oldTextPart/FilePart/DataPartwrappers are gone. - Artifact: output of a task (documents, files, structured data).
- Enum names in the SDKs are SCREAMING_SNAKE_CASE (
TaskState.TASK_STATE_WORKING,Role.ROLE_USER).
2. Install
pip install "a2a-sdk[http-server]" # core + Starlette/SSE server pieces
pip install "a2a-sdk[grpc]" # gRPC; also: [fastapi] [postgresql] [mysql] [sqlite] [telemetry] [all]
npm install @a2a-js/sdk express # Node; express is a peer dependency of the server helpers
3. Server in Python
A server must follow one of two streaming patterns, or the SDK raises InvalidAgentResponseError: enqueue exactly one Message, or enqueue a Task first and then status/artifact updates until a terminal state. Never mix them.
import uvicorn
from starlette.applications import Starlette
from a2a.helpers import (new_task_from_user_message, new_text_artifact_update_event,
new_text_status_update_event)
from a2a.server.agent_execution import AgentExecutor, RequestContext
from a2a.server.events import EventQueue
from a2a.server.request_handlers import DefaultRequestHandler
from a2a.server.routes import create_agent_card_routes, create_jsonrpc_routes
from a2a.server.tasks import InMemoryTaskStore
from a2a.types import AgentCapabilities, AgentCard, AgentInterface, AgentSkill, TaskState
class BillingAgent(AgentExecutor):
async def execute(self, context: RequestContext, event_queue: EventQueue):
task = context.current_task or new_task_from_user_message(context.message)
await event_queue.enqueue_event(task) # Task first
await event_queue.enqueue_event(new_text_status_update_event(
task_id=task.id, context_id=task.context_id,
state=TaskState.TASK_STATE_WORKING, text="Looking up the invoice..."))
answer = f"Invoice INV-2041 is paid. You asked: {context.get_user_input()}"
await event_queue.enqueue_event(new_text_artifact_update_event(
task_id=task.id, context_id=task.context_id, name="answer", text=answer))
await event_queue.enqueue_event(new_text_status_update_event(
task_id=task.id, context_id=task.context_id,
state=TaskState.TASK_STATE_COMPLETED, text="Done"))
async def cancel(self, context: RequestContext, event_queue: EventQueue):
await event_queue.enqueue_event(new_text_status_update_event(
task_id=context.task_id, context_id=context.context_id,
state=TaskState.TASK_STATE_CANCELED, text="Canceled"))
card = AgentCard(
name="Billing Agent", description="Answers questions about invoices.", version="1.0.0",
supported_interfaces=[AgentInterface(protocol_binding="JSONRPC", url="http://127.0.0.1:9000/")],
capabilities=AgentCapabilities(streaming=True),
default_input_modes=["text/plain"], default_output_modes=["text/plain"],
skills=[AgentSkill(id="invoice-status", name="Invoice status",
description="Look up whether an invoice is paid", tags=["billing"],
examples=["Is invoice INV-2041 paid?"])],
)
handler = DefaultRequestHandler(agent_executor=BillingAgent(), task_store=InMemoryTaskStore(),
agent_card=card) # agent_card is required in 1.x
app = Starlette(routes=[*create_agent_card_routes(card),
*create_jsonrpc_routes(handler, rpc_url="/")])
uvicorn.run(app, host="127.0.0.1", port=9000)
`crea
Установить a2a-protocol в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл a2a-protocol?
Builds Agent2Agent (A2A) servers and clients, the open protocol (originally from Google, now under the Linux Foundation) that lets AI agents from different frameworks call each other. Use when the user wants to create an A2A-compliant agent, build an Agent Card, implement task management, connect agents across frameworks, set up agent discovery, handle streaming responses, implement push notifications, or orchestrate multi-agent workflows. Trigger words: a2a, agent to agent, agent2agent, a2a protocol, a2a server, a2a client, agent card, agent interoperability, agent collaboration, multi-agent, agent discovery, a2a sdk, a2a task.
Как установить скилл a2a-protocol?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл a2a-protocol запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic