Prefire
Lets your AI agent render SwiftUI previews as images, so it can see the screens it just changed.
532 stars on GitHubby BarredEweLicense Apache-2.0Updated 24 days ago
How to install
This MCP is local: it runs on your computer.
It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Codeβ¦). Choose your app:
Download the .mcpb file and open it with Claude Desktop.
Download the .mcpb file βReady! Now test it
Restart the app and paste one of these requests in the chat:
Render the Sign in preview on an iPhone 16 Pro in dark mode
List all previews in my project and render the ones I changed
What it is
Prefire turns the #Preview blocks in a SwiftUI project into snapshot tests, a component catalog and images. Its MCP server lets an agent render those previews on a chosen iPhone or iPad, in light or dark mode, without Xcode Previews. The agent can then check its own UI work.
What it can do
list_previews: list the previews in the projectrender_previews: render previews to PNG on the devices you pickbuild_board: build an HTML board of the last render, grouped by user storyprefire renderandprefire board: the same features from the command line- Snapshot tests generated from previews with
prefire tests
When to use
- βΊWhen you want your AI agent to check how a SwiftUI screen looks after it edits it
- βΊWhen you want to see a screen in dark mode or on a different device
- βΊWhen you want previews to double as snapshot tests that fail on UI changes
What you need
brew install barredewe/prefire/prefire and add a .prefire.yml file to your project.Skills that pair well
MCP or skill?
The MCP gives the agent the hands. The skill teaches the right way to use them. Together, the result is better and uses fewer tokens.
ios-application-devGuides your agent in building iPhone apps with UIKit or SwiftUI, covering layouts, navigation, dark mode, text sizing, and accessibility.ios-qaHelps your agent test a SwiftUI app on a live iPhone or iPad, checking how it behaves for a real user.ios-simulatorHelps your agent open an iPhone or iPad app in the Apple simulator, check its screen, and walk through steps to test a change.Frequently asked questions
Is it free?
The readme does not mention a price. It is distributed through Homebrew, Swift Package Manager and Mint.
What does it need?
Swift 6.0 or higher, Xcode 16.0 or higher, and iOS 14 or higher. macOS supports snapshot tests only.
Which agents does it work with?
The readme shows setup for Claude Code, Cursor, Codex and VS Code.
Why not use Xcode's own RenderPreview?
The readme says Prefire needs no running Xcode, renders many previews in one build, lets you choose devices and color scheme, and works in CI.
Where do I set which scheme to build?
In render_configuration of .prefire.yml.
Does it also do testing?
Yes. It generates snapshot tests from your previews, compared with swift-snapshot-testing, and a Playbook view of components.
If it does not work
- βΊRun the MCP command from the folder that has your
.prefire.yml - βΊIf plugins do not run on CI, set
IDESkipPackagePluginFingerprintValidatationwithdefaults writeas shown in the readme - βΊCheck that Xcode 16 or newer and Swift 6.0 are installed
5 new skills a week. 1 minute to read.