Fanta docs
Reference

Architecture

How Fanta’s app shell, design engine, source files, and MCP connect.

Fanta’s desktop executable is built by the fanta Cargo package and named fanta. fig_viewer connects the design UI, canvas, project persistence, and local MCP server to the vendored design engine.

AreaSource
App shell and executablecrates/fanta
Design UI, source reload, export, MCPcrates/fig_viewer
Agent operation types and guidelinescrates/design_surface
Scene graph and edit operationscrates/fanta-doc
.fnx parser and printercrates/fanta-fnx
Project layout and .fant formatcrates/fanta-format
Figma importcrates/fanta-fig-interop
Canvas, rendering, text, human toolsfanta-canvas, fanta-render, fanta-text, fanta-tools
Presentation enginecrates/fanta-present

A project contains fanta.json, .fnx source under pages/ and components/, managed JSON metadata, assets, an AGENTS.md seed, and a fanta.md design specification. Layout v5 stores a variant set in components/<set>/set.json with each member in a child folder; standalone components keep their own component folder. The reader accepts v4 sets and migrates them on the next save. Canvas operations autosave to source; valid source changes reload the canvas; Git tracks the folder. The Code workspace validates the active page or component's FNX and paired JSON against the project before writing them. Structural canvas saves retain supported authored FNX fields and comments on surviving nodes; a lossy destructive change reports a preservation error instead of silently rewriting the source.

The external MCP server runs in the app over a private Unix socket. fanta --mcp-stdio discovers the socket and bridges a client to the focused design. The 13 registered tools use the shared design_surface provider; batch_design streams 43 typed DesignOp values. Content edits form one undoable transaction and roll back if an operation fails; selection and viewport changes are not transactional. batch_get projects requested nodes as a summary, editable style, or raw data; raw requires exact node IDs. The bridge can receive --user-data-dir to target the running instance. The older fanta-app / fanta-ai crate map and fixed HTTP port do not describe this checkout.