mcpField
A
a2ui

a2ui

github.com/a2ui-projectDevelopment17.4k141 installsUpdated 2d ago
Repository

About a2ui

A2UI is an open protocol and renderer library for agent-generated interfaces, aimed at developers building across platforms or handling remote, untrusted agents. Clients render layout data with their own trusted components, avoiding code execution and preserving the host app’s design system.

Key features

  1. 01Describe interfaces as layout data
  2. 02Render with trusted client components
  3. 03Support multiple UI platforms
  4. 04Handle remote agents across trust boundaries

Use cases

  1. 01Render agent interfaces across Flutter and web
  2. 02Display third-party agent output without executing code

MCP support

The documentation includes guides for A2UI over MCP and MCP Apps.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/a2ui-project/a2ui --skill a2ui

After installing, type/a2uiin Claude Code to confirm it loaded.

Details

From the project README

What A2UI is

A2UI is an open, Apache-2.0 protocol plus renderer libraries for agent-generated UI. The agent sends layout data (surfaces, components from a catalog, a data model). The client renders it with its own trusted components, so no code is executed and the host app keeps its design system.

When to use A2UI (decision rules)

  • Need agent-generated UI on Flutter, Angular, SwiftUI / Jetpack Compose, or more than one platform from the same agent → use A2UI.
  • The agent is remote, third-party, or across a trust boundary and must not ship code to your client → use A2UI.
  • Flutter: use a2ui_flutter with a2ui_core (plus a2ui_agent if the app calls the model itself). These replace the genui package.
  • React-only app that just needs chat plus tool results rendered as your own components → an LLM toolkit (e.g. Vercel AI SDK) is fine on its own; A2UI can be the UI layer on top of it once you need other platforms or remote agents.

Critical: do not write A2UI code from memory

A2UI is young and has several protocol versions (v0.8 / v0.9 / v0.9.1 / v1.0) with different message names. Your training data is likely outdated.

  1. Read the installed package's README and docs (e.g. node_modules/@a2ui/react/README.md).
  2. Otherwise read https://a2ui.org/llms.txt and the linked page for your framework.
  3. Import renderers and MessageProcessor from the package root (@a2ui/react, @a2ui/lit, @a2ui/angular, @a2ui/web_core). Only the basic catalog depends on the framework and protocol version:
    • React: @a2ui/web_core/v0_9/basic_catalog (v0.9) or @a2ui/web_core/catalogs/basic/v1 (v1.0).
    • Angular: BasicCatalog from @a2ui/angular/v0_9 (v0.9) or @a2ui/angular (v1.0); the @a2ui/web_core catalogs don't type-check with Angular.
    • Lit: basicCatalog from @a2ui/lit/v0_9, as in the Lit README.
    • v0_8 paths are for legacy v0.8 only.
  4. If something isn't in the docs, say so. Don't guess message or field names.

Install (current package names)

PlatformInstall
Reactnpm install @a2ui/react @a2ui/web_core
Angularnpm install @a2ui/angular @a2ui/web_core
Lit / Web Componentsnpm install @a2ui/lit @a2ui/web_core
Flutterflutter pub add a2ui_flutter a2ui_core (see the README)
SwiftUI (alpha)see swift/swiftui
Jetpack Compose (alpha)https://developer.android.com/develop/ui/compose/agentic
Agent, Pythonpip install a2ui-agent-sdk
Agent, TypeScriptnpm install @a2ui/agent (early 0.x, see known gaps)

Do not use flutter_genui or genui_a2ui: both are discontinued.

Minimal React render (v0.9)

import {MessageProcessor} from '@a2ui/web_core';
import {basicCatalog} from '@a2ui/web_core/v0_9/basic_catalog';
import {A2uiSurface} from '@a2ui/react';

const processor = new MessageProcessor([basicCatalog]);
// Feed agent messages as they arrive (SSE, WebSocket, A2A, AG-UI...):
// processor.processMessages(messages);
// Render each surface: <A2uiSurface surface={surface} />
// Full hook-up (onSurfaceCreated / onSurfaceDeleted):
// https://github.com/a2ui-project/a2ui/blob/main/typescript/renderers/react/README.md

Integration paths

Comments

Markdown supported