Daemon

The daemon is an optional speed-up. The Gradle composePreviewRender task is the canonical render path (and what CI uses); the daemon just makes interactive re-renders fast.

What it is

A persistent preview server that replaces the per-save Gradle invocation with a long-lived JVM holding a hot Robolectric (Android) or Compose-Desktop renderer. A cold Gradle render is 10s+; a warm daemon render is a fraction of that. It’s what the VS Code extension and the MCP server drive behind the scenes.

It’s configured with composePreview.daemon { ... } and defaults on for editor use. You don’t start or manage it by hand — the extension and MCP server bring it up as needed.

Where it ships from

The daemon modules (daemon-core, the Robolectric Android backend and the Compose-Desktop backend) live in compose-preview-daemon, and the local MCP server that multiplexes per-(workspace, module) daemons behind one MCP surface lives in compose-preview-mcp (see Agents & MCP). This repository consumes them at a pinned version.

Going deeper

The full design docs live in docs/daemon/:

  • DESIGN.md — architecture, lifecycle, leak defense, decisions log.
  • PROTOCOL.md — the v1 client ↔ daemon wire format.
  • CONFIG.md — the composePreview.daemon { … } DSL.
  • MCP.md — daemon ↔ MCP mapping and tool surface.

</content>


Apache 2.0 licensed. Source on GitHub.

This site uses Just the Docs, a documentation theme for Jekyll.