Skip to content
Skillpedia
βœ“ Official Β· BarredEwe● Free and open sourceπŸ’» LocalπŸ”“ No API keyProgramming

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 project
  • render_previews: render previews to PNG on the devices you pick
  • build_board: build an HTML board of the last render, grouped by user story
  • prefire render and prefire 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

A Mac with Xcode 16 or newer and Swift 6.0 or newer. Install the CLI with brew install barredewe/prefire/prefire and add a .prefire.yml file to your project.

Skills that pair well

⭐ Skillpedia MCP Β· freeYour agent finds the right skill on its ownInstall our MCP and your agent searches 15,000+ skills whenever it needs one.Install for free β†’

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 IDESkipPackagePluginFingerprintValidatation with defaults write as 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.