Generative UI... in Python? — Jeremiah Lowin, Prefect
Sep 10, 2026 · 17:38
Jeremiah Lowin, founder and CEO of Prefect and author of FastMCP, explains how MCP apps — a protocol extension introduced in January that lets tool results bypass the agent and reach users as HTML, CSS, and JavaScript — led him to build Prefab, a Python DSL for shipping UIs from MCP servers. Because FastMCP's users are mostly Python engineers in enterprises sharing tables, forms, and charts, he refused to pretend to ship React from Python and instead scoped the problem to composing pre-built components via nested context managers and reactive variables. Lowin argues the JSON serialization in the middle is the real point, since a serializable UI can be generated, received, or edited by an agent. His team also found the Python representation is about 70% smaller than JSON, so they now stream Python over the wire and convert it in a sandbox, and the Prefab docs are rendered entirely in Prefab with live-editable examples.