Prefire — Claude Code MCP server: render SwiftUI #Preview to PNG
Prefire — an MCP server that renders SwiftUI #Preview to PNG without Xcode Previews. AI agents see the UI they just changed.
Apache-2.0 ★ 535 updated 2026-10-27
Open on GitHubWhat Prefire does
Prefire runs #Preview on any iPhone, iPad, light or dark theme and saves the result as PNG. The agent calls the render command, gets an image and checks the UI without Xcode Previews.
Inside: a CLI command prefire render builds the preview on the chosen device and returns the file path. Supports iOS, tvOS, macOS (the latter snapshot tests only). Requires Swift 6.0 and Xcode 16.0: the build fails without them.
Install with brew install barredewe/prefire/prefire, then claude mcp add prefire -- prefire mcp at the project root. The agent gets a render tool and uses it when changing SwiftUI code.
What it helps with
- check SwiftUI changes visually without running Xcode Previews
- render a preview on a specific device and theme for the agent
- get a PNG of the UI from
#Previewvia MCP - show the agent the result of edits in SwiftUI components
Example prompts for the agent
- render
ContentViewon iPhone 15 Pro in dark mode - show preview of
LoginButtonon iPad mini - save image of
ProfileCardfor light theme
How to install Prefire
Install
The MCP registry has no launch command for it: see the repository README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Prefire
How to install Prefire in Claude Code?
Run brew install barredewe/prefire/prefire, then claude mcp add prefire -- prefire mcp at the project root. The server is added to the MCP config.
What does Prefire do?
Renders SwiftUI #Preview to PNG on a chosen device and theme. The agent gets the image and sees UI changes without running Xcode Previews.
What does Prefire require?
Swift 6.0, Xcode 16.0 and iOS 14 or higher (or macOS 13 for snapshot tests, or tvOS). Without these versions the render command will not start.