Bezels shows a web page the way it looks inside the browser of a real phone, foldable, tablet, laptop or desktop, and lets Claude Code drive it over MCP.
A resized desktop window is not a phone. It has no notch, no browser bars, no home indicator and no fold, and it runs the wrong engine. Bezels runs real browser engines with device emulation (Chromium for Android and desktop devices, WebKit for iPhone and iPad) and draws the device frame around the page. The viewport you get is the screen minus the status bar and browser bars, per orientation, bar state, fold state and Telegram mode.
There is one engine with three ways in: an MCP server for Claude Code, a web UI, and a CLI. The UI and Claude Code see the same sessions, so you can watch Claude open devices, tap through your app and run audits while it works.
- 66 devices: phones, foldables, tablets, laptops and desktops, each with a source for its numbers. You can also save custom devices.
- Real engines: Chromium for Android and desktop, WebKit for iPhone and iPad. Android uses Chrome's reduced user agent, so same-size phones share one page, as they would in real Chrome.
- Device realism: frames, notches, safe areas, browser bars (expanded, collapsed or PWA), folds (folded, unfolded, tabletop, book) and four orientations.
- Layout and accessibility audits: a layout audit with per-site rules, plus axe-core.
- Flows: describe a path through your app once, then replay it on every device with screenshots and audits at each checkpoint.
- Telegram Mini App mode: a mock
Telegram.WebApp with buttons, popups, storage, safe areas and optional signed initData.
- DevTools data and emulation: console, network, Web Vitals, storage, element inspection, geolocation, timezone, locale and permissions.
Works on Linux and macOS. On Windows, use WSL2. You need git and Node.js 20 or newer.
curl -fsSL https://raw.githubusercontent.com/n1th1n-19/bezels/main/install.sh | bash
Before it changes anything, the installer shows what is already there and what it will install, then asks you to continue:
| What |
Size |
Notes |
Bezels source in ~/.bezels |
about 2 MB |
Re-running the installer updates it |
| npm packages |
about 150 MB |
Playwright, MCP SDK, React, Vite |
| Chromium |
about 180 MB |
Android and desktop devices, shared Playwright cache |
| WebKit |
about 100 MB |
iPhone and iPad devices |
| WebKit system libraries |
small |
Linux only, apt and sudo, only the packages actually missing |
~/.local/bin/bezels |
tiny |
Launcher script |
| Claude Code MCP server |
none |
Asks first |
wl-clipboard or xclip |
small |
Optional, only for bezels shot --copy |
Options go after bash -s -- when you pipe the script:
| Option |
What it does |
--yes |
Accept the plan without asking |
--dir PATH |
Install somewhere other than ~/.bezels |
--no-webkit |
Skip WebKit (no iPhone or iPad devices) |
--no-mcp |
Do not offer to register the Claude Code MCP server |
--source URL |
Git URL or local path to install from |
If you run ./install.sh from inside a clone, it installs in place.
If the claude command is on your PATH, the installer offers to register Bezels for all your projects. To do it yourself:
claude mcp add bezels -s user -- node ~/.bezels/dist/mcp.js
From a source checkout, point at your own build:
claude mcp add bezels -- node /abs/path/to/bezels/dist/mcp.js
git clone https://github.com/n1th1n-19/bezels && cd bezels
npm ci
npx playwright install --with-deps chromium webkit
npm run build
--with-deps installs WebKit's system libraries on Linux and needs sudo.
bezels update # show new commits, then pull, reinstall what changed, rebuild
bezels update --check # only show what is new
bezels cleanup # temp files, orphaned thumbnails, unused browser revisions; asks about old screenshots
bezels cleanup --older-than 7
bezels uninstall # lists everything with sizes and asks per item
bezels stop # stop a running Bezels
Each command shows its plan first. --dry-run shows only the plan, and --yes accepts the defaults (screenshots are only deleted with --all). Browser revisions that other Playwright projects use are never removed.
Once registered, Claude Code gets these tools:
| Group |
Tools |
| Sessions |
list_devices, list_sessions, open, navigate, reload, set_state, close |
| Input |
interact (tap, longpress, swipe, scroll, type, press, pinch, hover, back, forward, goto) |
| Capture |
screenshot, screenshot_matrix |
| Audits |
audit_layout, audit_all, audit_rules, a11y_audit |
| Flows |
run_flow, save_flow, list_flows, set_helpers |
| Debugging |
console_logs, network_errors, network_log, request_detail, eval, inspect, perf_metrics, storage, network_block |
| Emulation |
set_location, set_emulation |
| Telegram |
telegram_events, telegram_trigger |
| Memory |
stats |
The intended loop is: open your dev server on phones,folds, run audit_all, fix the CSS, run audit_layout again, then screenshot_matrix to confirm.
If the Bezels UI is already running, the MCP server sends every call to it, so you see Claude's sessions live. If it is not running, the MCP process runs the engine itself and serves the UI on the same port.
Screenshot tools return a downscaled preview and the path to the full-resolution PNG. screenshot with fast: true skips the frame and thumbnail for bulk runs.
To stop Claude from changing anything while you look around, press Shift+K in the UI. Read-only tools still work while control is paused.
bezels serve
Open http://localhost:4477. To reload every device when your source files change, add --watch:
bezels serve --watch ../myapp/src
--open http://localhost:3000 --devices phones opens a URL on start, and --port changes the port.
Every action has a key or is in the command palette (Ctrl/Cmd+K). Press ? for the cheat sheet. Some keys you will use often:
- Click a device or press Enter to send keystrokes to the page. Esc takes them back.
- A and Shift+A run the layout audit on one device or the set.
- C copies a screenshot, S saves it, Shift+S copies a contact sheet of the whole set.
- Shift+T turns on Telegram mode.
- Z hides every panel so the device fills the window. Esc or Z brings them back.
Keys are remappable in Settings (Ctrl/Cmd+,). Chromium-only features show a Chromium only badge on WebKit devices.
The CLI uses a running Bezels if there is one (its sessions show in the UI), otherwise it runs in-process. That makes it handy in CI.
bezels shot http://localhost:3000 --devices phones,folds --framed --out ./shots
bezels shot http://localhost:3000 --device iphone-16-pro --framed --copy
bezels audit http://localhost:3000 --devices all --json
bezels devices
bezels flow suit-roll
bezels stats
shot takes one device or a set. A set produces a framed contact sheet. Other flags: --full for the full page, --plain, --transparent, --dark and --landscape. --copy copies the image to the clipboard.
audit prints issues per device and exits 1 if any error-level issue is found. Without --devices it uses phones.
flow replays a saved flow or a flow.json file and exits 1 if any device fails.
Anywhere a tool or command takes devices, you can pass device ids, sets, or both, separated by commas.
| Set |
Devices |
phones |
All phones |
iphones |
All iOS devices |
android |
Android phones |
folds |
Foldables |
tablets |
Tablets |
laptops |
Laptops |
desktop |
Laptops and desktops |
breakpoints |
iphone-se, android-412, ipad-mini, ipad-pro-13, laptop-1280, desktop-1080 |
telegram |
iphone-16-pro, pixel-9, galaxy-s25, iphone-se |
all |
Every device |
Run bezels devices to see the ids.
audit_layout checks one device, audit_all checks many, and bezels audit does the same from a terminal. They look for:
- text overlapping text, text cut off with an ellipsis, controls or headings partly hidden by an
overflow:hidden box, and containers collapsed to a sliver;
- horizontal overflow, tap targets below the minimum (measured by what a tap actually hits), and small text;
- content under the notch, browser bars, home indicator or Telegram UI, overlapping fixed bars, unscaled images, and plain
100vh on mobile (dvh and svh are fine);
- in Telegram mode, API calls above the selected version, vertical swipes left on, and
ready() never called.
Rules are saved per site with audit_rules:
audit_rules({ target: "http://localhost:3000", rules: {
minTextPx: 11,
minTapPx: 44,
ignore: ["header.site-nav", ".bottom-bar", ".bg-art"],
clippedIsIntended: true,
disable: ["image-oversized"]
}})
The defaults are minTextPx: 12, minTapPx: 44 and clippedIsIntended: true. Pass rules: null to reset, or leave rules out to read the current ones. audit_layout and audit_all also take rules for a one-off override.
For accessibility, a11y_audit runs axe-core on a session, including colour contrast.
Most apps change screens without changing the URL, so a check of one URL stops at the first screen. A flow describes the path once and replays it on every device:
run_flow({
name: "suit-roll",
url: "http://localhost:3000",
devices: "phones,folds,tablets",
steps: [
"checkpoint lobby",
"tap PLAY DEMO", "wait PLACE BET", "checkpoint bet",
"tap PLACE BET", { wait: { text: "You won", timeout: 20000 } }, "checkpoint result",
],
})
Each device runs in a fresh page, one at a time. Every checkpoint takes a screenshot and runs the layout audit. You get pass or fail per device with the failing step, issues per checkpoint, one framed contact sheet per checkpoint, and a report.html grid of devices by checkpoints.
Steps are tap, wait (text, {selector}, {gone} or milliseconds), type (optionally into), press, scroll, hover, goto, eval, state and checkpoint. Text matches visible text, exact matches first. The default per-step timeout is 15000 ms; change it with timeoutMs. A hot reload in the middle of a step is waited out and the step is retried once.
save_flow stores a flow by name. Re-run it with run_flow({ name }), from the command palette ("Run flow: ..."), or with bezels flow <name>.
- Inside
eval, window.bezels has tap, waitFor, find, text, visible, inView, rect, overlap, sleep and checkpoint(name).
set_helpers saves a script per site that runs on every page load, in every session and flow. Pass js: null to remove it.
Turn on Telegram mode with Shift+T in the UI, "Open in Telegram", or set_state with telegram: { enabled: true }. You can pick the mode (compact, expanded, fullscreen), platform, theme, Bot API version, start parameter and language.
A mock Telegram.WebApp is injected before page scripts, and the request for the real telegram-web-app.js is intercepted. The mock covers the --tg-* CSS variables, viewport and safe areas per device and mode, the Main, Secondary, Back and Settings buttons (drawn by Bezels and clickable), popups, QR, in-memory CloudStorage, DeviceStorage and SecureStorage, and per-version method gating.
telegram_events lists every Telegram.WebApp method the app called, with arguments and unsupported flags.
telegram_trigger simulates mainButton, secondaryButton, backButton, settingsButton, themeChanged, dragSheet, popup, qr, activate, deactivate, close and reopen.
initData is unsigned by default, so server-side validation fails on purpose. To sign it the way Telegram does, set BEZELS_TG_BOT_TOKEN to a test bot token.
Settings live in ~/.config/bezels/config.json and can be changed from Settings in the UI. A few can be overridden with environment variables.
| Setting |
Default |
What it does |
port |
4477 |
Port of the UI and RPC server. Env: BEZELS_PORT, or --port |
maxMemoryMB |
1000 |
Memory budget. Env: BEZELS_MAX_MEMORY_MB |
maxLive |
2 |
Devices streaming live at once |
idleCloseMs |
300000 (5 min) |
Close a background page after this long unused |
engineIdleMs |
180000 (3 min) |
Shut an engine down after this long with no contexts |
screencastFps |
15 |
Chromium live view frame rate cap |
shotsDir |
~/.cache/bezels/shots |
Where screenshots go. Env: BEZELS_SHOTS_DIR |
favourites |
iphone-16-pro, pixel-9, galaxy-z-fold-6, ipad-mini, laptop-1366 |
Favourite devices |
sets |
mixed (the five favourites) |
Your own device sets |
On macOS the default screenshot folder is ~/Library/Caches/bezels/shots. On Linux it respects XDG_CACHE_HOME.
Other environment variables:
| Variable |
What it does |
BEZELS_CONFIG_DIR |
Config folder. Default: $XDG_CONFIG_HOME/bezels or ~/.config/bezels |
BEZELS_TG_BOT_TOKEN |
Test bot token used to sign Telegram initData. Read from the environment or a .env file in the current folder, never saved |
BEZELS_DIR |
Installer: install location (default ~/.bezels) |
BEZELS_SOURCE |
Installer: git URL or path to install from |
PLAYWRIGHT_BROWSERS_PATH |
Playwright's browser cache location |
The same folder holds your keymap, custom devices, audit rules, helpers and saved flows.
Bezels is one Node and TypeScript process. It uses Playwright to run one Chromium process and one WebKit process, with a browser context per page. WebKit only launches when you open an Apple device, and each engine shuts down after 3 minutes with no contexts.
The MCP server (stdio), the web UI (static files served by the core over HTTP and WebSocket) and the CLI all call the same method table. Every action is a named method in that table, so anything an MCP tool can do, the UI can do too. When Claude Code control is paused, only read-only methods are accepted from MCP.
Sessions are deduplicated: devices that would get the same browser context, viewport, state and URL share one page. To keep memory low:
- Only the focused device (plus its Compare partner) is live, up to
maxLive. Other pages are frozen.
- Background pages close when idle or when total memory goes over
maxMemoryMB, least recently used first. A closed page reopens at the same URL and scroll position.
screenshot_matrix, audit_all and flows run one device at a time.
- Captures are streamed to disk. The tray loads 120 px thumbnails.
- DevTools data is collected only for the focused device, in capped buffers (1,000 console lines, 500 requests). Response bodies are fetched on demand.
- On Linux, memory is measured as PSS from
/proc, so Chromium's shared pages are not counted twice. stats and Shift+M in the UI show it.
Chromium streams its live view through CDP screencast, capped at 15 fps. WebKit has no screencast, so it is polled with JPEG screenshots: about 6 fps right after input and 1 fps when idle. The UI labels this "live view polled". WebKit also has no CDP, so safe areas there are approximated by rewriting env(safe-area-inset-*) rules.
- Linux or macOS. Windows through WSL2.
- Node.js 20 or newer, with npm.
- git, for the installer.
- About 430 MB of disk for npm packages and both browsers.
- On Linux, WebKit's system libraries (the installer uses apt and sudo for only the missing ones). Without apt, install them with
npx playwright install-deps webkit.
- Optional:
wl-clipboard (Wayland) or xclip (X11) for bezels shot --copy. The UI copies through the browser and needs neither.
Problem: "Unsupported OS". The installer runs on Linux and macOS only. On Windows, install WSL2 (Ubuntu) and run it there.
Problem: bezels is not found after install. ~/.local/bin is not on your PATH. The installer prints the line to add to your shell profile.
Problem: iPhone and iPad devices fail to open on Linux. WebKit's system libraries are missing. Run npx playwright install-deps webkit, or re-run the installer and approve the apt step. If you installed with --no-webkit, there are no Apple devices.
Problem: "Claude Code control is paused by the user". You paused agent control in the UI. Press Shift+K to resume.
Problem: "Unknown device or set". Check the id with bezels devices, or use one of the sets listed above.
Problem: Telegram initData fails validation on your server. That is the default, because it is unsigned. Set BEZELS_TG_BOT_TOKEN to a test bot token.
Problem: bezels shot --copy does not copy on Linux. Install wl-clipboard on Wayland or xclip on X11.
Problem: the page looks slightly different from a real iPhone. WebKit in Playwright is close to iOS Safari but not identical: there are no iOS-only quirks, no real address-bar animation and no keyboard resize. Do a final check on one real Android phone and one real iPhone, and check Telegram Mini Apps in real Telegram with a test bot.
Bezels is released under the MIT License. It drives Playwright (Apache-2.0) and loads axe-core (MPL-2.0) unmodified for accessibility audits. It is built with Node.js, TypeScript, the MCP SDK, ws and zod, and the UI uses React, Vite and Tailwind CSS. Device names belong to their makers; the frames are generic drawings, not their artwork. Source: https://github.com/n1th1n-19/Bezels