Connect
Give it to your agent
Three ways in — same protocol underneath. Copy a block, paste it where your agent lives.
Prompts point your agent at docs/agent-setup.md — MCP server install, CLI path, verify steps.
# 1. build the server once:
git clone https://github.com/mosesman831/agent-page-protocol && cd agent-page-protocol
npm ci && npm run build
# 2. add to your MCP client config:
{
"mcpServers": {
"agent-page": {
"command": "node",
"args": ["/path/to/agent-page-protocol/packages/mcp/dist/bin.js"]
}
}
}POST /app/ba/home
Content-Type: application/vnd.agent-page-action+json
{"app":"1.1","action":"search_flights",
"params":{"from":"lhr","to":"jfk","depart":"2026-10-05"}}MCP server
Drop-in stdio server: app_read, app_act, app_events, discovery — works with any MCP client.
Agent CLI
State-driven command line: open pages, run actions, watch diffs — scripts and humans welcome.
packages/cli →TypeScript client
Hydration, navigation, version negotiation, auth duty cycle — build your own agent on it.
packages/client →Adopt
Migrate your site with an agent
Copy the prompt, paste it into your coding agent (Cursor, Copilot, Claude Code, Devin). It asks one question — full migration or canonical + auto-negotiation — pulls the live schema, then walks the matching guide.
Why
What a manifest buys you
Over a DOM.
~100× smaller pages
328 KB of HTML + JS/CSS vs a 3.3 KB manifest for identical content.
Typed values
price = {type:'number', scale:2, unit:'GBP'} — no scraping, no inference.
Declared actions
Every action ships an input schema — zero guessing what a button does.
Diff updates
RFC 6902 JSON Patch deltas — ~89% fewer bytes than re-fetching.
Safe by default
Idempotency keys, version pinning, confirmation challenges, delegated OAuth scopes.
Humans included
The same manifest renders as a real site via the Chrome MV3 extension.
Features
Protocol surface
Everything below is implemented and conformance-tested in this repo.
Document
Typed state nodes (20 kinds) · present hints · navigation · conditional GET · watch + ETag
Actions
Idempotency keys · version pinning · confirmation challenges · RFC 6902 diffs · async 202 jobs · bulk ops
Agent safety
Delegated OAuth scopes · consent gate · rate limits · structured error envelopes
Events
Server-sent events + long-poll channel — pages push state changes to watching agents
Human layer
MV3 extension renderer · theme system · component hints (charts, calendars, steppers)
Tooling
Conformance suite · manifest generator + mutants · schema-validated corpus · benchmarks
Benchmarks
Measured, not claimed
Same flight-booking content in both representations — reproduce with node benchmarks/run.mjs. Measured run: 2026-09-26, localhost, Node 24.
| Metric | HTML / DOM | APP | Note |
|---|---|---|---|
| Page transfer | ~328 KB | 3.3 KB | ~100× smaller, same content |
| Full booking flow | 40+ DOM interactions | 7 round trips | search → filter → select → book → confirm |
| Tokens per page | ~891 (doc only) | ~833 | doc parity — transfer is the win |
| Sequential updates | full re-fetch each step | 88.9% bytes saved | 10 diffs (3.7 KB) vs 10 re-fetches (33.3 KB) |
| Cache revalidation | — | 0-byte body | ETag → 304, measured |
| Flow latency (p50) | — | ~6.6 ms | sum of step p50s, localhost |
Methodology + runner: benchmarks/. Production sites skew further in APP's favor (100 KB–2 MB pages, heavier JS).
Schemas
Manifest schemas
JSON Schema (draft 2020-12) for every wire document — enforced by the test suite.
manifest.json the pagestate-node.json 20 node kindsaction-def.json action definitionaction-request.json the POST bodydiff-document.json RFC 6902error-envelope.jsonSPEC.md the protocol (private repo){"app":"1.1",
"page":{"id":"app_home","url":"...","title":"Agent Page Protocol","version":"app-landing-1"},
"state":{"headline":{"type":"string","value":"Web pages as JSON manifests…"}, …},
"actions":{"ingest_manifest":{"kind":"navigate","side_effect":"safe",…}},
"present":{"layout":"detail","sections":[…]}}Demos
Live on real domains
Real middleware, real protocol. Open with the extension — or fetch the manifest directly.
Multiversal Airways
A real airline site: fares, seats, extras, pay, manage, check-in, status, loyalty. Negotiated: humans get the generated DOM site, agents get the manifest.
demo-flight-app.vercel.app/site/mva/homeBritish Airways booking
Full flow: search → fares → seat map → passengers → payment → PNR.
demo-flight-app.vercel.app/app/ba/homeHotel booking
Search → results → hotel → rooms & rates → checkout → confirmation.
demo-hotel-app-eta.vercel.app/app/hotel/searchClassroom
Dashboard → stream → classwork → assignment → grades → people.
demo-classroom-app.vercel.app/app/gc/homeProtocol feature lab
Every wire feature end-to-end: diffs, watch, async, consent, delegate, auth.
demo-lab-app.vercel.app/app/lab/homeMechanics
How it works
Serve a manifest
Express middleware turns your routes into typed JSON pages with declared actions.
Two readers
Agents read the JSON; the extension renders the same document as a human site.
Actions, not clicks
Agents POST typed action requests; servers answer with manifests or diffs.