Deploy a React app with your agent.
a2a-pack scaffolds a Vite/React frontend that reads the agent's generated contract, lists inferred tools, shows input schemas, and invokes the hosted runtime. Deploy once; get /app, A2A, MCP, auth, files, receipts together.
a2a init chart-agent --frontend react
cd chart-agent
a2a dev
# in another terminal
cd frontend
npm install
npm run devContract-aware
UI reads tool names, scopes, input/output schemas, endpoint URLs from the runtime.
Auth inherits
Private agent → private app. Browser calls use the user session, not platform secrets.
One deploy
Control plane builds the frontend bundle, copies it into the agent image, serves from the A2A runtime.
The manifest is tiny
Frontend block tells deploy where the app lives, how to build, where dist lands, where to mount. Runtime generates config and tool metadata automatically.
frontend:
path: frontend
build: npm run build
dist: dist
mount: /app
auth: inheritfrom typing import Literal
import a2a_pack as a2a
from a2a_pack import A2AAgent, NoAuth, RunContext
class ChartAgent(A2AAgent):
name = "chart-agent"
auth_model = NoAuth
@a2a.tool(description="Render a chart from a CSV file.")
async def render_chart(
self,
ctx: RunContext[NoAuth],
dataset: str,
chart_type: Literal["bar", "line"] = "bar",
) -> dict:
return {"dataset": dataset, "chart_type": chart_type}Tools become UI contract
Python type hints or TypeScript/JS tool schemas become JSON Schema. The generated React starter uses those schemas to build a working tool runner. Replace the runner with a focused production workflow.
- Tool names and descriptions come from the agent contract.
- Input and output schemas come from Python types or TypeScript/JS declarations.
- Scopes and runtime policy travel with the contract.
What the deployed service exposes
The packed React app
Identity, endpoints, auth mode, inferred tool schemas
Browser helper for calling the agent
Skill contract for custom frontends
Skill invocation API
Local or platform user session metadata
Best use cases
Internal ops tools
Upload, run workflow, review output, approve, export artifacts.
Data and chart agents
Give business users controls instead of raw JSON calls.
Research workspaces
Sources, drafts, run history, generated reports in one place.
Marketplace agents
Let buyers open a real app experience before wiring API or MCP calls.