Skip to content

A2A Agent

Scaffolds an Agent-to-Agent (A2A) protocol peer in TypeScript. A2A is the open protocol for multi-agent interoperability — the agent-level equivalent of MCP (which operates at the tool level). The generated project can expose skills to other agents via an A2A server, discover and invoke capabilities on remote agents via an A2A client, and use an LLM provider for reasoning about which skill to execute. Supports HTTP and WebSocket transports, optional agent discovery with an Agent Card served at /.well-known/agent.json, and a pluggable provider registry for LLM backends.

Namea2a-agent
Version0.1.0
Categoryai-systems
LicenseApache-2.0
Personaengineering
Tagstypescript, agent, a2a, multi-agent, protocol, ai
Sourcetemplates/a2a-agent

Render it

Three front doors, one catalog. Pick whichever suits the caller.

# CLI
npx @nanohype/sdk render a2a-agent --out ./my-app

# SDK
import { LocalSource, renderTemplate } from "@nanohype/sdk";
const result = await renderTemplate(source, "a2a-agent", variables);

# MCP — from an agent
get_template({ name: "a2a-agent" })

Prerequisites

ToolVersionWhy
node>=22Node.js runtime for TypeScript execution

Variables

Required

ProjectName string
Kebab-case project name, used in package.json and directory Must be lowercase kebab-case starting with a letter.

Optional

Description string — defaults to An A2A protocol agent
Short project description for package.json and README
LlmProvider string — defaults to anthropic
LLM provider for agent reasoning
Transport string — defaults to http
A2A transport protocol (http or websocket)
IncludeDiscovery bool — defaults to true
Include agent discovery registry and Agent Card at /.well-known/agent.json
IncludeTests bool — defaults to true
Include test suite with Vitest

What it produces

33 files. Placeholder names such as __APP_NAME__ are what the renderer substitutes into.

.env.example
.gitignore
biome.json
package.json
README.md
src/__tests__/protocol.test.ts
src/__tests__/skills.test.ts
src/agent.ts
src/bootstrap.ts
src/discovery/card.ts
src/discovery/registry.ts
src/logger.ts
src/protocol/client.ts
src/protocol/server.ts
src/protocol/transport/http.ts
src/protocol/transport/index.ts
src/protocol/transport/registry.ts
src/protocol/transport/types.ts
src/protocol/transport/websocket.ts
src/protocol/types.ts
src/providers/anthropic.ts
src/providers/index.ts
src/providers/openai.ts
src/providers/registry.ts
src/providers/types.ts
src/resilience/__tests__/circuit-breaker.test.ts
src/resilience/circuit-breaker.ts
src/skills/example.ts
src/skills/index.ts
src/skills/registry.ts
src/skills/types.ts
tsconfig.json
vitest.config.ts

Composes with

Composites that use it

  • Enterprise AI Infrastructure — Full enterprise AI stack with agents, tool servers, safety guardrails, evaluation, prompt management, observability, and Kubernetes deployment..
  • Multi-Agent System — Multi-agent architecture with A2A protocol peers, MCP tool servers, and an orchestrating agent.