anh-chu

Pagefork

Community anh-chu
Updated

Let your AI coding agent edit any website live in Chrome. Change sets you toggle and share. Local, free, open source.

Pagefork

Let your AI coding agent edit any website live in your own Chrome. Save the changes as sets you switch on and off, share them as files, and keep everything on your machine.

Get Pagefork on the Chrome Web Store · Download the extension zip to load unpacked · npx pagefork

Pagefork: your AI agent edits any website, live

  • Edit any page — HTML, CSS and JavaScript, from Claude Code, Cursor, Codex or any MCP client.
  • Changes stick — saved edits come back on every reload, even when your agent isn't running.
  • Change sets — group edits, switch each set on or off from the toolbar, several at once. Your agent writes an overview for each set.
  • Share — export a set as a file; teammates preview the pages it touches before importing.
  • Screenshots — your agent can look at the page to check its work.
  • Free and local — no cloud, no account, no analytics. Open source (MIT).

Quick start

  1. Install the Pagefork extension from the Chrome Web Store. Or load it unpacked: download the zip from the latest release, unzip it, open chrome://extensions, turn on Developer mode, click Load unpacked and pick the folder.

  2. Run npx pagefork. It creates your token and prints what to paste into the extension's Settings and how to add Pagefork to your agent:

    claude mcp add pagefork -- npx -y pagefork mcp
    

    Cursor (~/.cursor/mcp.json):

    { "mcpServers": { "pagefork": { "command": "npx", "args": ["-y", "pagefork", "mcp"] } } }
    

    Codex (~/.codex/config.toml):

    [mcp_servers.pagefork]
    command = "npx"
    args = ["-y", "pagefork", "mcp"]
    
  3. Click the Pagefork icon on a page and allow access (all sites, or just that one).

  4. Ask your agent: "Make this page dark, and add a button that copies the title."

The bridge starts by itself when your agent first uses Pagefork. Needs Node 22 or newer.

How it works

your agent ──stdio──> pagefork mcp ──HTTP 127.0.0.1:8788──> pagefork bridge <──ws://localhost:8787── Chrome extension
  • The bridge holds the extension's WebSocket (:8787/ext) and a loopback-only RPC port (127.0.0.1:8788). pagefork mcp starts it if it isn't running.
  • Page work goes through chrome.debugger, so edits work under strict CSP and Trusted Types. While your agent works on a tab, Chrome shows its "started debugging this browser" bar.
  • Saved edits live in the extension's storage and are reapplied on each page load, with or without the bridge.

Chrome on another computer. The bridge listens on localhost only. To accept Chrome from your local network, set PAGEFORK_HOST=0.0.0.0 (in your agent's MCP config, e.g. claude mcp add pagefork -e PAGEFORK_HOST=0.0.0.0 -- npx -y pagefork mcp) and use ws://<this-computer-ip>:8787/ext in the extension. The connection is plain ws://: use it on networks you trust, and don't forward the port on your router.

Privacy and permissions

Pagefork sends page content (HTML, screenshots, script results) only to the bridge you run, and stores your sets in your browser. It has no server and collects nothing. See store/privacy-policy.md.

Permission Why
debugger Apply HTML/JS edits and take screenshots in the tab your agent works on
scripting Insert and remove saved CSS; tell the page which sets are on
storage Keep your sets and the bridge address on your device
tabs, webNavigation Let your agent pick a tab; reapply saved edits as pages load
alarms Keep the connection to your bridge alive
Site access (optional) Asked for at first use, for all sites or one site at a time

For agents: change sets

Persisted edits belong to named sets (set, default default), each with a one-line note. describe_set writes the overview the popup shows. list_sets and use_set read and switch sets; several can be on at once.

Set awareness: the page always carries <html data-pagefork-sets="compact toolkit"> with the sets that are on (written by the extension, so it works without the bridge), and window gets a pagefork:sets event (event.detail.on) whenever sets switch without a reload. A set's CSS can key on html[data-pagefork-sets~="compact"]; its JS can read document.documentElement.dataset.pageforkSets or listen for the event.

Sharing: sets export to a JSON file (pagefork/sets, version 1) from the popup, the settings page or export_sets, and import from the settings page or import_sets. Import previews the pages affected and the number of JS edits, adds the sets switched on, renames a taken name, and never changes existing edits.

Tools

list_tabs, get_html, set_html, add_css, run_js, screenshot, reload_tab, list_edits, remove_edit, clear_edits, describe_set, list_sets, use_set, delete_set, export_sets, import_sets.

  • tab is a tabId, a URL substring, or a glob with *. Zero or several matches return an error listing candidates.
  • set_html, add_css and run_js take persist (default false), an optional pattern (URL glob; default: the tab's origin + path), set and note. Saved edits replay in creation order: CSS saved before any HTML/JS edit goes in at commit, the rest at DOMContentLoaded, and HTML edits again after load (for pages that hydrate).
  • A pattern without ? also matches URLs with a query string. The hash is ignored.

Settings

Variable Default Meaning
PAGEFORK_HOST 127.0.0.1 Bridge address for the extension; 0.0.0.0 accepts Chrome from your network
PAGEFORK_PORT 8787 Extension WebSocket port
PAGEFORK_RPC_PORT 8788 Loopback RPC port between pagefork mcp and the bridge
PAGEFORK_DIR ~/.pagefork Token, bridge log, screenshots (shots/), exports (exports/)
PAGEFORK_TOKEN from PAGEFORK_DIR/token Override the token
PAGEFORK_TIMEOUT_MS 15000 Per-command timeout

The older LEB_* names still work.

Development

  • npm test: unit and integration tests (127.0.0.1 only, ephemeral ports, no browser).
  • npm run e2e: opt-in end-to-end run against a real Chrome with the extension. It refuses to start unless LEB_E2E_APPROVED=1 and LEB_E2E_CHROME=<path> are set; it needs a browser that can load extensions (Chrome for Testing with --headless=new; the headless shell cannot).
  • npx pagefork start runs the bridge in the foreground.
  • Store listing, images and launch plan: store/.

License

MIT

MCP Server · Populars

MCP Server · New

    auto-mobile-oss

    AutoMobile

    Mobile automation suite of tools including an MCP and libraries for test authoring & execution

    Community auto-mobile-oss
    clearframes

    MCP Observatory

    Free, MIT-licensed MCP security testing from ClearFrame. Scan, audit, compare, and review locally; continue in the ClearFrame CLI or Mac app.

    Community clearframes
    umutkeltek

    healthsave-observatory

    Self-hosted health-data observatory: sync Apple Health, early wearable plugins, and Garmin/Samsung imports into a canonical TimescaleDB record; view baseline-linked findings and query a private API. Docker-ready, local-first, default-deny egress.

    Community umutkeltek
    atilaahmettaner

    TradingMCP: Market Data & Technical Analysis for AI Assistants

    MCP server for market analysis in AI assistants: quotes, options, smart-money analysis, walk-forward backtests and news sentiment for stocks, crypto, FX and metals. 13 tools. Self-host free, or use the hosted version, TradingMCP.

    Community atilaahmettaner
    lifan-builds

    Faster Mac Use (fmu)

    Background-first, multi-cursor browser and native macOS computer-use engine for AI agents

    Community lifan-builds