AI drafts the template. The compiler ships production.
Generating customer documents one-by-one with an LLM fails on record #2. Pair OAuth 2.1 MCP authoring with deterministic 50,000-file JSON compilation.
Modern coding agents can now draft impressive visual layouts in minutes. Ask Claude or Cursor to design an 8-page annual wealth review, an itemized invoice, or a personalized student workbook, and the first result often looks remarkably sharp.
Then teams try to put that workflow into production for real customers, and the cracks appear on record #2.
Why 1-by-1 LLM document generation fails at scale
Language models are probabilistic by design. That is an advantage when exploring layout ideas and typography hierarchy, and a liability when shipping financial figures, legal notices, or personalized reports to thousands of customers.
- Data fidelity drifts: asking a model to format account balances, tax breakdowns, or student grades per record introduces silent rounding mistakes, swapped rows, or invented labels.
- Layout shifts between customers: record #1 fits cleanly on 8 pages; record #2 wraps differently, drops a footnote, or alters spacing between charts.
- Latency and unit cost explode: generating one document per API turn takes tens of seconds and burns tokens on repeated layout boilerplate rather than compiling data into a fixed structure.
- Zero governance: there is no pinned template version, no diffable draft, and no team approval gate before customer-facing output changes.
Split the job: creative drafting vs. deterministic compilation
The right architecture uses AI where probabilistic creativity shines and a native page compiler where deterministic accuracy is non-negotiable.
| Stage | Best tool | Guarantee |
|---|---|---|
| Draft layout, grids, and visual hierarchy | AI coding agent over OAuth 2.1 MCP or visual editor | Blank page to draft template in minutes |
| Bind JSON fields and conditional rules | Visual editor + MCP apply_ops | Live data preview without touching app deploys |
| Ship 1 to 50,000 customer files | Composa native compiler (POST /v1/run & /run/batches) | Identical JSON produces the exact same file every time |
How the OAuth 2.1 MCP loop works in practice
Connect Claude, Cursor, ChatGPT, Codex, Antigravity, Orca, or any Streamable HTTP OAuth 2.1 MCP client directly to https://mcp.composa.ai/mcp. Four verified tools cover the entire authoring lifecycle:
compose: draft a multi-page layout structure, typography scale, tables, and charts from a prompt and sample JSON.apply_ops: refine individual layers, margins, brand colors, or conditional sections without regenerating the whole document.render_preview: inspect real compiled pages immediately to verify pagination, charts, and alignment.publish: pin a live version once reviewed (with team approval gates available on Scale).
Once published, the AI agent steps out of the runtime path completely. Your backend calls POST /v1/run for single files (0.3s warm render on an 8-page report) or POST /v1/run/batches for up to 50,000 personalized files with signed HMAC-SHA256 webhooks.
Built for teams, not one-off prompts
Because the published artifact is a real version-pinned template rather than a transient prompt output, designers and product managers can open the same template in Composa's visual editor, inspect live sample records, adjust copy or styles in draft, and publish a new version without a single code deploy.
See how this compares to banner APIs and single-run AI design tools in Composa vs. Banner APIs & One-off AI Design, or inspect a real 8-page banking review compiled from this exact workflow in Banking & Wealth portfolio reports.
Try the native compiler
Ship deterministic PDFs from one JSON call.
100 pages / month free · No card required · Zero watermarks. Full API, 50,000-item batches, and OAuth 2.1 MCP included on every plan.