Self-hosted gallery of your SwiftUI #Preview and Jetpack Compose @Preview screens.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
A self-hosted, open-source alternative to Emerge Tools Snapshots: harvest your existing Compose @Previews and SwiftUI #Previews into a browsable, static HTML gallery β no SaaS account required.
Phonebook turns screenshots your team already has into a Storybook-style component gallery. No new test code, no design tokens to maintain by hand β it renders what's already in your codebase into a static site designers can open without installing anything. Each repo runs Phonebook independently; v1 is single-platform, so one Android repo (or one iOS repo) produces one bundle and one site.
@Preview / #Preview you've already writtencomponent / state cards inferred from preview names, no required annotationinit/doctor resolve library versions against your project's Kotlin version and catch Kotlin/Roborazzi metadata mismatches before they cause opaque compiler crashes
A gallery generated from samples/ios β component / state cards grouped from the app's own #Previews, no extra annotation.
phonebook generate runs your platform's preview-rendering engine and harvests the output into a bundle (manifest.json + images/).
xcodebuild test on a simulator. Requires macOS.phonebook build turns that bundle into a static site β by default it writes index.html directly into the bundle directory (reusing the images already there, no copying), so the site lands at <bundle>/index.html. Pass -o <dir> to instead copy everything into a standalone site directory (for publishing elsewhere, or later merging multiple bundles). Plain HTML/CSS/JS, works from file:// or any static host.Most people won't run the CLI directly β Phonebook is built to be driven by a coding agent (Claude Code, Codex, etc.) through its MCP server. The agent adds previews, runs setup checks, and generates the gallery for you; the CLI underneath is the engine it calls.
The server runs via npx @stag-build/phonebook mcp β no install step needed. Pick your client below.
Add to ~/.codex/config.toml:
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global):
Add to .codex/config.toml at your project's workspace root. Xcode's agent runs with a minimal PATH, so the command wraps npx in a shell that adds the usual Homebrew/nvm locations first:
Add the mcpServers block to ~/Library/Developer/Xcode/CodingAssistant/ClaudeAgentConfig/.claude.json:
Android Studio (Gemini Agent Mode): not supported yet β its MCP integration only connects to remote httpUrl servers, not local stdio processes like Phonebook's. Use one of the terminal-based clients above (Claude Code, Codex CLI) from the Android repo instead.
Then, from a chat in your Android or iOS repo, just ask:
"Use the phonebook MCP and create a catalog for my designer."
The agent figures out the rest β checking setup, filling in missing previews, generating, and building the site. For more targeted asks, it also exposes: check_setup (setup diagnosis, same as phonebook doctor), analyze_coverage (components missing previews or dark variants), get_preview_guidance, run_generate, and run_build.
Run phonebook init first β it detects your project's Kotlin version and prints these instructions with library versions resolved to be compatible with it (e.g. Kotlin 2.0 projects get Roborazzi 1.60.0; Kotlin 2.2+ gets the latest). The versions below are what a current-Kotlin project gets (see samples/android/app/build.gradle.kts for a full working example):
Add a phonebook.config.json next to settings.gradle.kts:
Then, from the repo containing Phonebook:
Open phonebook-out/index.html.
Add the SnapshotPreviews SPM package to your project and a small XCTest target that subclasses SnapshotTest (see samples/ios for a full working example):
Add phonebook.config.json next to your .xcodeproj:
Your scheme must build and test the snapshot test target (see PhonebookSample.xcscheme in the sample). Then:
Open phonebook-out/index.html.
Phonebook groups screenshots into component / state cards from your existing preview names β no required annotation. See docs/naming-convention.md for the full rules and examples.
phonebook.config.json:
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/phonebook)<a href="https://allmcps.com/mcp/phonebook"><img src="https://allmcps.com/api/badge/phonebook?style=directory" alt="Phonebook on AllMCPs" /></a>