We use cookies to improve your experience.

Mobile Reality logoMobile Reality logo

MDMA vs Google A2UI: Markdown Components vs JSON Protocol for Agent-Driven UIs

Google A2UI JSON versus MDMA Markdown comparison showing AI UI token cost reduction and audit trail features

Introduction

Google A2UI (Agent to User Interface) and MDMA (Markdown Document with Mounted Applications) both solve the same core problem: how do you turn AI agent output into interactive UI that people can act on? But they approach it from opposite directions. A2UI is a JSON-based declarative protocol backed by Google, designed for cross-platform agent interfaces. MDMA is an open-source Markdown-based framework built for enterprise AI workflows with audit trails and compliance features built in. This article compares both — architecture, LLM generation cost, enterprise readiness, and developer experience — so you can decide which fits your stack.

What Google A2UI Is and How It Works

A2UI is an open-source protocol from Google that lets AI agents describe UI as structured JSON, which clients then render using native widgets. The agent never sends executable code — only declarative data referencing a catalog of trusted components like Card, Button, or TextField.

The architecture separates three concerns:

  • UI Structure — component definitions via surfaceUpdate
  • Application State — a data model via dataModelUpdate
  • Client Rendering — native widget mapping in Angular, Flutter, Lit, React, or SwiftUI

A2UI uses a flat list of components connected by ID references instead of a nested tree. This adjacency list model makes it easier for LLMs to generate incrementally and supports JSONL streaming — the UI can start rendering before the agent finishes generating the full response.

The protocol is moving toward a stable v1.0 in 2026, with renderers for Lit, Angular, and Flutter shipping from Google, and community renderers for React and SwiftUI.

What MDMA Is and How It Works

MDMA extends standard Markdown with interactive components defined in YAML-based fenced code blocks. Instead of JSON, the model writes natural Markdown — the format it was trained on — with embedded forms, tables, approval gates, and other components.

Here's what a simple MDMA document looks like:

markdown
Based on the submitted documents, this application qualifies for review.

` ``mdma
id: loan-assessment
type: form
fields:
  - name: risk_score
    type: select
    label: Risk Classification
    options:
      - { label: "Low Risk", value: low }
      - { label: "Medium Risk", value: medium }
      - { label: "High Risk", value: high }
onSubmit: submit-assessment
` ``

The MDMA monorepo includes 8 packages: a remark-based parser that transforms Markdown into a typed AST, a headless runtime for state management, 10 validation rules, a React renderer, and a prompt-pack that teaches LLMs the exact MDMA syntax. Every component is validated against Zod schemas before rendering.

Format: JSON vs Markdown — What It Costs You

This is the fundamental difference between the two approaches, and it has measurable consequences.

A2UI requires LLMs to generate structured JSON with component IDs, surface updates, literal type strings, and nested property objects. Even a simple dashboard can consume 2,000+ output tokens in A2UI format. The protocol itself acknowledges this — the flat list design was chosen specifically because nested JSON trees are "difficult and error-prone" for LLMs to generate correctly.

MDMA uses Markdown with embedded YAML. According to analysis of LLM output formats, JSON uses roughly twice as many tokens as simpler formats for identical data, and Markdown uses approximately 16% fewer tokens than JSON. Since output tokens cost 3-10x more than input tokens across major providers, format choice directly affects your bill.

But token cost isn't the only issue. GPT-4 scored 81.2% on reasoning tasks with Markdown prompts versus 73.9% with JSON — a 7.3-point accuracy gap. When you force a model to simultaneously reason about a problem and conform to a rigid JSON schema, both suffer. MDMA lets the model stay in its natural output format. A2UI requires the model to shift into a specialized JSON dialect.

Component Model: Catalog vs Spec

A2UI operates on a component catalog model. The client application maintains a list of trusted component types (Card, Button, TextField, etc.), and the agent can only reference types in that catalog. This is a security feature — the agent cannot inject arbitrary UI. But it also means every new component type requires updating the catalog on the client side.

MDMA operates on a spec-validated model. The framework ships with 9 built-in component types (form, button, tasklist, table, callout, approval-gate, webhook, chart, thinking), each defined by a Zod schema. Custom components can be registered through an attachable handler system. The validator catches invalid components at parse time — before anything renders.

Both approaches prevent arbitrary UI injection. The difference is where new components get defined: in A2UI, on the client. In MDMA, in the spec + renderer.

Enterprise Features: Where the Gap Is Widest

This is where A2UI and MDMA diverge most sharply. A2UI is a UI protocol. MDMA is a UI protocol with an enterprise runtime.

Audit trail. MDMA records every user interaction — field changes, approvals, button clicks, webhook calls — in an append-only event log. The ChainedEventLog adds hash chaining: each entry includes a sequence number, a hash of the current entry, and the hash of the previous entry. Integrity verification is a single method call. A2UI has no audit trail mechanism.

PII redaction. Fields marked sensitive: true in MDMA are automatically redacted before logging. The runtime detects five PII categories (email, phone, SSN, credit card, name patterns) and applies hash, mask, or omit strategies. The event log never contains plain PII for sensitive fields. A2UI has no PII handling.

Policy engine. MDMA's policy engine enforces environment-based rules — block webhooks in preview, block emails in staging, allow everything in production. This prevents a developer from accidentally firing a live API call during testing. A2UI delegates all such concerns to the application layer.

Approval gates. MDMA includes approval-gate as a first-class component type: a workflow blocker that requires N approvers with specific roles, supports deny-with-reason, and logs every decision. In A2UI, you would build this as a custom component on the client side.

For regulated industries — fintech, healthcare, insurance — these are not nice-to-have features. They are compliance requirements. Building them on top of A2UI means months of additional development. In MDMA, they ship in the box.

Cross-Platform Support

A2UI wins on cross-platform breadth. A single A2UI JSON payload can render on web (Lit, Angular, React), mobile (Flutter, SwiftUI), and desktop. Google provides official renderers for Lit, Angular, and Flutter, with community renderers for the rest. If you need the same agent UI on an Android app, an Angular web dashboard, and a SwiftUI Mac app — A2UI gives you that from one payload.

MDMA currently ships a React renderer with hooks for fine-grained reactivity (useComponentState, useBinding, useDocumentStore). The architecture is designed for pluggable renderers — the parser, runtime, and attachable handlers are all headless and UI-agnostic — but today, React is the only production-ready renderer. If your stack is React or Next.js, this is not a limitation. If you need Flutter or Angular rendering, A2UI has a head start.

AI Authoring: Teaching the Model Your Format

A2UI relies on the model's ability to generate structured JSON. The protocol uses a flat list with ID references specifically to make this easier, and supports JSONL streaming for progressive rendering. But A2UI itself doesn't ship tooling for prompt engineering or generation quality testing.

MDMA ships a prompt-pack package — a 327-line system prompt that teaches any LLM the exact MDMA syntax, all nine component types with YAML examples, binding rules, and a self-check checklist. Usage is one function call:

typescript
import { buildSystemPrompt } from '@mobile-reality/mdma-prompt-pack';

const systemPrompt = buildSystemPrompt({
  customPrompt: 'You are an HR assistant. Generate onboarding forms.'
});

The prompt-pack always includes the full MDMA spec, regardless of custom instructions. This prevents the model from "forgetting" the format in long conversations.

MDMA also includes an evaluation suite built on promptfoo — 25+ test cases covering structural correctness, semantic appropriateness, and multi-turn consistency. You can measure generation quality across models before shipping to production.

When to Use Which

Feature / Google A2UI / MDMA /
FeatureGoogle A2UIMDMA
FormatJSON (flat list, ID references)Markdown + YAML
Token cost~2,000+ tokens for a simple dashboard~16% fewer tokens than JSON
RenderersLit, Angular, Flutter, React, SwiftUIReact (pluggable architecture)
Component modelClient-side catalogSpec-validated (Zod schemas)
Audit trailNot includedAppend-only, hash-chained event log
PII redactionNot includedAutomatic (5 categories, 3 strategies)
Policy engineNot includedEnvironment-based allow/deny rules
Approval workflowsBuild as custom componentFirst-class approval-gate type
AI authoring toolsNone shippedPrompt-pack + promptfoo eval suite
Backed byGoogle (approaching v1.0)Mobile Reality, open-source (v0.1.x)
LicenseApache 2.0MIT

Choose A2UI when:

  • You need cross-platform rendering (web + mobile + desktop) from one payload
  • Your stack includes Angular, Flutter, or SwiftUI
  • You're building within the Google ecosystem (ADK, Gemini, Vertex AI)
  • You need a protocol standard that multiple agents can target

Choose MDMA when:

  • You need enterprise compliance features (audit trails, PII redaction, approval gates)
  • You're in a regulated industry (fintech, healthcare, insurance)
  • Your stack is React or Next.js
  • You want lower token costs and better reasoning quality from LLM generation
  • You need built-in prompt engineering and generation quality testing

They can coexist. A transport layer like AG-UI (CopilotKit) can stream either format to a frontend. You could use A2UI for general-purpose agent UI and MDMA specifically for workflows that need forms, approvals, and audit trails.

Conclusion

Google A2UI and MDMA solve the same category of problem — turning AI agent output into interactive UI — but they optimize for different things. A2UI optimizes for cross-platform reach and protocol standardization. MDMA optimizes for enterprise compliance, token efficiency, and production-ready AI authoring.

  • Format: A2UI uses JSON (verbose, 2,000+ tokens for a dashboard). MDMA uses Markdown + YAML (16% fewer tokens, better model reasoning)
  • Enterprise: MDMA includes tamper-evident audit logs, PII redaction, policy engine, and approval gates out of the box. A2UI has none — you build them yourself
  • Cross-platform: A2UI supports Lit, Angular, Flutter, React, SwiftUI. MDMA has a React renderer today with pluggable architecture for more
  • AI tooling: MDMA ships prompt-pack + eval suite. A2UI relies on native LLM JSON generation
  • Maturity: A2UI is approaching v1.0 as a Google-backed protocol. MDMA is v0.1.x, open-source, actively developed

If your primary concern is cross-platform portability and protocol-level standardization, A2UI is the right choice. If your primary concern is shipping AI workflows in regulated industries with compliance built in from day one, MDMA is what we built to solve that exact problem.

I'm Marcin Sadowski, CTO at Mobile Reality. We build AI agents and automation systems for fintech and proptech companies. MDMA came out of the compliance requirements we kept hitting on every project — audit trails, PII handling, approval workflows. If you're evaluating generative UI frameworks for enterprise use, happy to share what we've learned.

Frequently Asked Questions

What are Google A2UI and MDMA, and what problem do they solve?

Both turn AI agent output into interactive UI without the agent sending executable code. A2UI is Google's JSON-based protocol targeting cross-platform agents. MDMA is an open-source Markdown-plus-YAML framework tuned for enterprise workflows with built-in audit and compliance features.

Why does MDMA use fewer tokens than A2UI?

MDMA uses Markdown plus YAML, tokens which are roughly 16% cheaper than the JSON structure A2UI requires; JSON itself carries about twice the payload of simpler formats for identical data. The format gap also affects model accuracy: GPT-4 scores 81.2% on reasoning tasks with Markdown prompts versus 73.9% with JSON, because the model is no longer forced to juggle both problem solving and strict JSON syntax correctness.

When should I pick A2UI over MDMA for my project?

Choose A2UI if you need the same agent UI to render natively on web, Flutter mobile, SwiftUI desktop, or Angular/Lit apps from a single JSON payload. Opt for MDMA when your primary need is enterprise-grade compliance features (audit trails, PII redaction, approval gates) or you're deploying within React/Next.js stacks and regulated industries like fintech or healthcare.

Which enterprise features does MDMA provide that A2UI leaves to the application layer?

MDMA adds an append-only, hash-chained event log for tamper-evident auditing. Sensitive fields marked in the YAML are automatically masked (employing three strategies across five PII categories). A policy engine blocks webhooks or e-mail triggers in non-production environments, and an approval-gate component lets workflows stall until up-to-date role-based approvals are logged — all built-in rather than custom-developed.

AI-Powered Interactive Documents & Generative UI Insights

Are you exploring how large language models can move beyond plain text to deliver structured, interactive experiences? At MDMA, we're pioneering the intersection of Markdown and generative UI — enabling LLMs to return forms, approval workflows, and dynamic components instead of static responses. Our growing library of articles covers the technical foundations, business applications, and architectural patterns behind this shift:

Dive into these resources to understand why generative UI is replacing plain-text chat interfaces across healthcare, fintech, and enterprise workflows. If you'd like to integrate MDMA into your product or explore a partnership, reach out to our team. And if you're passionate about shaping the future of LLM-powered interfaces, check our open positions — we're hiring.

Did you like the article?Find out how we can help you.

Matt Sadowski

CEO of Mobile Reality

CEO of Mobile Reality

Related articles

Agentic AI drives autonomous business decisions, while generative AI powers content. Understand their roles to boost efficiency and strategic impact in 2026.

27.03.2026

Generative vs Agentic AI: Key Differences for Business 2026

Agentic AI drives autonomous business decisions, while generative AI powers content. Understand their roles to boost efficiency and strategic impact in 2026.

Read full article

Discover what an LLM interface is and why most AI products fail at the last mile. Learn how to turn raw model output into interactive forms, approvals, and workflows with an open-source solution.

24.03.2026

LLM Interface: The Missing Layer Between Your AI Model and Your Users

Discover what an LLM interface is and why most AI products fail at the last mile. Learn how to turn raw model output into interactive forms, approvals, and workflows with an open-source solution.

Read full article

LLMs lose 34% tokens and 10-15% reasoning accuracy in JSON mode. MDMA generates interactive forms, tables, and approval gates from extended Markdown.

20.03.2026

Structured LLM Output Without JSON Schemas | MDMA

LLMs lose 34% tokens and 10-15% reasoning accuracy in JSON mode. MDMA generates interactive forms, tables, and approval gates from extended Markdown.

Read full article