Inspiration

Temporary clinics and other short-lived spaces are often planned under time pressure. A layout can look plausible while still hiding a blocked route, narrow pinch point, inaccessible destination, or obstruction. Rehearse turns that fragile planning moment into a controlled collaboration between a person and a browser agent.

What it does

Rehearse deliberately starts with an unsafe temporary-clinic layout. A WebMCP-capable browser discovers five typed tools that let an agent read the current layout, run five deterministic spatial checks, stage a visible repair as ghost geometry, apply only the exact proposal a person approved in the interface, and verify the committed result with a SHA-256 receipt.

The central demo is a failure-and-recovery sequence. After the agent stages a repair, the person locks reception. That increments the layout revision and makes the proposal stale. Rehearse rejects the old patch without moving anything. The agent must re-read state, produce a new lock-aware plan, and wait for approval again.

This is a planning rehearsal, not regulatory accessibility certification.

How we built it

The React and TypeScript interface and the WebMCP tools call one shared command layer. The deterministic route engine uses bounded-grid A* with stable tie-breaking. Repair search excludes locked objects and returns compact structured results suitable for an agent.

A proposal is bound to both its base revision and a SHA-256 hash. Human approval is UI-only: there is no tool that lets an autonomous agent approve its own patch. Apply succeeds only when the current visible proposal, approved hash, and base revision all still match. It commits atomically, reruns every check, and emits a verification receipt.

The app has no API key, model call, database, or server requirement. It is deployed as a public HTTPS site on Netlify and the complete source is MIT licensed.

WebMCP tools

get_layout_state reads revision, geometry, locks, findings, proposal, and receipt state. run_route_audit runs the deterministic route and spatial audit. stage_layout_patch stages a visible lock-aware repair without mutating committed geometry. apply_layout_patch applies only the exact current proposal already approved by a person. verify_layout reruns checks against the committed revision.

Challenges we ran into

The difficult part was preserving a trustworthy boundary between agent autonomy and human control. We had to make stale work impossible to replay, keep manual and WebMCP actions behaviorally identical, compact tool results without hiding important state, and show proposed geometry clearly enough for a person to judge it before approval.

The production flow passed in Chrome 151 through the native WebMCP surface, including discovery, invocation, stale rejection, lock-aware replanning, exact-hash approval, atomic apply, and verification.

Accomplishments

Five native typed WebMCP tools operating real shared application state. Visible ghost patches instead of invisible agent mutation. Revision-bound, hash-bound approval with replay and stale-work rejection. Deterministic lock-aware replanning and atomic apply. Eight automated tests, 93.71% statement coverage, 89% branch coverage, and Lighthouse accessibility 100. A public production deployment, reproducible testing guide, agent eval catalogue, and MIT-licensed source.

What we learned

WebMCP is most valuable when a site exposes domain operations that are difficult to reproduce safely through generic DOM actuation. Structured tools make spatial state, constraints, and failure reasons legible to an agent. But capability alone is not enough: consequential mutations still need an explicit human checkpoint, freshness guarantees, and a verification artifact.

What's next

The current build focuses deeply on one temporary-clinic scenario. Next steps would add floor-plan import, persistent projects, shared review sessions, richer constraint libraries, and organization-specific policy packs while keeping the same propose → inspect → approve → apply → verify control model.

Links

Live app: https://rehearse-webmcp.netlify.app Public source: https://github.com/LubuSeb/rehearse Public demo video: https://vimeo.com/1221536858

Built With

Share this project:

Updates