How aws300/a2a-scaffold works
A2A Scaffold is a standalone agent server with a built-in chat interface and a protocol endpoint for other agents. Its main workflow runs from chat input or an A2A request through the streaming service to an LLM-backed agent, then streams text and AG-UI events back. The README also documents agent configuration, skill discovery, MCP tools, document access, image/file uploads, and agent-card discovery. The source excerpts are partial, so links for unsampled routes and integrations follow README documentation and are omitted where their wiring is unclear.
Main entry points: a2a_service.py Strands agent · ChatPanel.tsx Chat panel · main.py HTTP server · a2a-scaffold.tsx Chat UI
Components 21
Chat experience
- Chat UI
frontend/src/a2a-scaffold.tsx - Chat panel
frontend/src/components/chat/ChatPanel.tsx - Markdown rendering
frontend/src/components/markdown/index.ts - RPC client
frontend/src/api/client.ts - Stream state hook
frontend/src/lib/useAgentStream.ts
A2A server
- HTTP server
src/agentx/server/main.py - A2A streaming service
src/agentx/services/a2a_service.py - Agent card
src/agentx/services/a2a_service.py - Workspace upload
src/agentx/server/main.py
Agent runtime
- AG-UI adapter
src/agentx/agui_adapter.py - Agent configuration
- Strands agent
src/agentx/services/a2a_service.py
Agent capabilities
- Skills
src/agentx/tools/skill_loader.py - MCP loader
src/agentx/tools/mcp_loader.py - Agent tools
src/agentx/tools - Document access
src/agentx/tools/doc_tool.py
Other components
- Chat user
- A2A client
- LLM provider
- MCP services
- Library service
Connections 22
- Chat user → Chat UI: uses
- Chat UI → Chat panel: renders
- Chat UI → RPC client: loads config
- Chat panel → HTTP server: streams chat
- Chat panel → Markdown rendering: renders replies
- Chat panel → Workspace upload: uploads files
- Workspace upload → Strands agent: provides workspace files
- A2A client → HTTP server: sends A2A requests
- A2A client → Agent card: discovers agent
- HTTP server → A2A streaming service: dispatches protocol
- HTTP server → Agent configuration: reads and saves
- A2A streaming service → Strands agent: runs inference
- Strands agent → LLM provider: requests completions
- A2A streaming service → AG-UI adapter: encodes stream events
- Chat panel → Stream state hook: processes stream
- Stream state hook → AG-UI adapter: parses AG-UI events
- Strands agent → Skills: loads skills
- Strands agent → MCP loader: loads MCP tools
- MCP loader → MCP services: connects tools
- Strands agent → Agent tools: invokes tools
- Agent tools → Document access: uses document access
- Document access → Library service: fetches documents