ChatBlocks is agent-first: your coding agent (Claude Code, Codex, Cursor, Windsurf, or any MCP client) authors blocks by calling tools on the hosted MCP server. The agent writes the code, the platform builds and publishes it, and the result lands on your canvas. If you’d rather drive the same workflow keyboard-first, see In-app editor. Both paths produce the same artifact.Documentation Index
Fetch the complete documentation index at: https://docs.chatblocks.ai/llms.txt
Use this file to discover all available pages before exploring further.
The flow
Connect your agent
Pick your agent at
/onboarding/agent — a 4-tile picker (Claude / Codex / Cursor / Windsurf) plus an Other option for any MCP client. Each tile shows the exact config snippet to paste.Cross-reference: MCP → Setup has per-client paths and the API key minting flow.Tell the agent what to build
Plain English. For example:
Make me a block that shows my Stripe MRR with a sparkline of the last 30 days.The agent figures out the rest. Watch the live-sync badge in your canvas chrome — it flips from “empty” to “live” on the first MCP call.
The MCP tools the agent calls
Every block goes through the same loop. Agents don’t need to be told this — they read the tool descriptions ontools/list — but you’ll see these names in the audit log.
blocks.init
blocks.init
Scaffold a new block. Returns a
blockId. The block starts unpublished with a minimal chatblocks.json and a placeholder entry. Free.blocks.setFiles
blocks.setFiles
Write source files into the block’s virtual filesystem. Caps: 100 files, 250 KB per file, 1 MB total. The agent can call this repeatedly — each call replaces the file set.
blocks.getFiles
blocks.getFiles
Read the current file set. Agents use this to inspect what’s already there before editing.
blocks.build
blocks.build
Run the Vercel Sandbox build of the current files. Produces an HTML bundle and uploads it to Convex storage. Counts against your monthly build quota (100 for Free, much higher for Builder).
blocks.publish
blocks.publish
Cut a new
blockPublishedVersions row pointing at the latest build. The render route now serves the new bundle. Canvas placements pinned to “latest” pick it up immediately.AI-generated drafts
There’s a separate tool,blocks.create, for kicking off a brand-new block from a prompt. It runs the AI generator server-side and streams the partial source over Server-Sent Events. The output is saved as a draft (isPublished: false); the agent or human still has to call blocks.build and blocks.publish to ship it.
The Free path: have your agent write the source itself using its own LLM budget, then call blocks.setFiles → blocks.build → blocks.publish. No platform-side AI calls, no quota consumed.
Live-sync badge
The canvas toolbar shows a small badge with three states, derived from your workspace’s most-recentapiKeys.lastUsedAt:
- Empty — no MCP calls yet from any key on this workspace. Onboarding hasn’t connected.
- Live — your agent called within the last few minutes. Builds and edits will show up in real time.
- Idle — historically connected, but quiet right now.
Block-expanded overlay
Click any block on your canvas to open the expanded overlay. The right rail shows:- File list — every file in the current draft.
- Recent agent edits — last few
setFilescalls with timestamps and the calling key. - Monaco diff viewer — compare any two consecutive states.
- “Open full editor” escape hatch — drop into
/blocks/[blockId]/editfor keyboard editing.
publishedVersionId so you see the new bundle without a hard refresh.
Constraints
| Tool | Plan gate |
|---|---|
blocks.init, setFiles, getFiles, build, publish, update, delete | None — works on every plan. |
blocks.create (AI generator) | Builder. |
blocks.setWidgetData | None. |
What’s next
Manifest
Every field in
chatblocks.json, with examples for both code and embed formats.MCP tool reference
Auto-generated reference for every tool the agent can call.