AI Agent Verification · Browser Intelligence + MCP
Give Cursor a real browser verification gate—not a guess.
SiteLens combines browser automation, observability, diagnostics, visual regression, and evidence into one coherent workflow.
AI Agent Verification is how coding agents prove a change works: SiteLens MCP runs Playwright browsers,
executes flows from .sitelens/flows, then inspects console/network/diagnostics, compares runs, navigates the timeline, and reads
SiteLens Reports.
Agents aren’t limited to running prewritten tests — they can help create automation from recorded browser behavior, run it, inspect evidence, and iterate.
What AI Agent Verification is
ShippedA verification loop for AI coding agents: define repeatable browser flows as JSON, invoke them through SiteLens MCP from Cursor, and require a green run before marking work complete. Unlike ad-hoc “open the browser” instructions, flows produce structured step results, named screenshots, and plain-language failures agents can act on.
Structured flows
JSON documents under .sitelens/flows/{flowId}.json with clicks, fills, assertions, and network checks—up to 200 steps per local run.
Evidence, not vibes
Each run writes a coherent evidence model locally: summary, report, screenshots, console/network events, diagnostics, and timeline—artifacts agents can cite, not vibes.
Completion gates
Prompt-library patterns (below) tell Cursor to re-run flows until pass—closing the gap between “code compiles” and “user journey works.”
Create automation from recorded browser behavior
CodegenAgents can help author SiteLens flows — not only execute them. Through MCP they start a headed Playwright Codegen session, watch status, finalize or cancel, convert the recording into a SiteLens flow, then run it and inspect Browser Intelligence evidence.
MCP tools
sitelens_flow_codegen_startsitelens_flow_codegen_statussitelens_flow_codegen_finalizesitelens_flow_codegen_cancelsitelens_flow_codegen_convert
Be precise about headed recording
An MCP client cannot magically perform the human browser interaction by itself.
Codegen opens a headed browser; a person (or local operator) interacts with the site while the agent orchestrates the session and conversion.
After conversion, the result is a normal SiteLens flow under .sitelens/flows with an explicit complete/partial contract.
How SiteLens works with Cursor
MCP
Install @sitelensapi/mcp, add the server block to ~/.cursor/mcp.json, restart Cursor, then ask the agent to call SiteLens tools by name. Local tools (sitelens_setup, sitelens_run_local_qa, sitelens_run_local_flow, compare/list helpers) run on your machine with no API key. Cloud tools activate when you set SITELENS_API_KEY for hosted runs and persisted history.
MCP overview
Local-firstCore tools for agent verification—each maps to a concrete Cursor prompt.
Setup & ad-hoc QA
sitelens_setup— verify Chromium and artifact dirssitelens_run_local_qa— quick desktop/mobile pass on a URLsitelens_qa_run— lower-level local runner when needed
Flows & regression
sitelens_run_local_flow— run.sitelens/flows/{flowId}.jsonsitelens_list_local_runs/sitelens_compare_local_runs— history + diffssitelens_compare_screenshots— pixel-diff two PNGs on disk- Codegen lifecycle — author flows from recorded browser behavior
Optional Cloud/API: sitelens_run_qa, sitelens_run_flow, sitelens_list_runs when SITELENS_API_KEY is configured.
Local flow execution
Project flows live beside your code. Cursor invokes sitelens_run_local_flow with a flowId (filename without .json) and optional URL override—Chromium runs on your machine and writes artifacts under your local SiteLens artifact directory.
Create .sitelens/flows/my-feature-smoke.json with version, url, viewports, and steps (assertText, click, fill, expectEither, …).
Use the SiteLens MCP tool sitelens_run_local_flow with flowId my-feature-smoke and url http://127.0.0.1:3000/ — report pass/fail and screenshot paths.
Use the Verification Completion Gate prompt (below) so the agent re-runs until the flow passes or reports blockers with evidence.
Flow examples
Real repo flowsThese flows ship in the SiteLens monorepo—copy patterns into your project or run them locally when developing SiteLens itself.
page-intelligence-marketing-smoke
Marketing homepage CTA & workflow smoke — asserts hero copy, nav labels, flagship templates, and primary CTA navigation to Desktop.
- 17 steps · desktop viewport
- Exercises in-page anchors and primary link navigation
- Default url: local marketing preview (
:4173)
sitelens_run_local_flow
flowId: page-intelligence-marketing-smoke
url: http://127.0.0.1:4173/
tldledger-name-to-bulk
Multi-step app journey: Name Ideas tab → generate names → select all → Bulk Check tab → run bulk check with flexible outcome assertions.
- Tab navigation, fill, network wait, expected HTTP status, expectEither
- Auth profile:
tldledger - Default url: local app dev server (
:5173)
sitelens_run_local_flow
flowId: tldledger-name-to-bulk
url: http://127.0.0.1:5173/
proof-homepage-smoke
Minimal proof flow—confirms the marketing homepage loads and exposes “SiteLens Platform” copy. Ideal starter template for agent verification.
- 2 steps · fast sanity check
- Catalog template id:
proof-homepage-smoke
sitelens_run_local_flow
flowId: proof-homepage-smoke
url: http://127.0.0.1:4173/
Cursor Prompt Library
PublicPaste into Cursor chat as-is—each prompt names SiteLens MCP tools explicitly so agents do not substitute raw Playwright or terminal scripts.
Teach Cursor SiteLens
You are working in a project with SiteLens MCP configured. Before browser QA, call the SiteLens MCP tool sitelens_setup once per session. For quick URL checks use sitelens_run_local_qa; for repo flows use sitelens_run_local_flow with flowId from .sitelens/flows/. Do not run raw Playwright or curl unless I ask. Always summarize pass/fail, failed steps, and screenshot paths from the tool response.
Generate a SiteLens Flow
Read existing .sitelens/flows/*.json in this repo. Generate a new SiteLens flow JSON (version 1) that verifies [describe user journey]. Use assertText, assertSelector, click, fill, waitForText, and when verifying API failure paths use request/expectNetwork with expect.status (e.g. 403 or 500). Target url http://127.0.0.1:3000/ and keep under 40 steps. Save to .sitelens/flows/[flow-id].json and tell me the flowId to pass to sitelens_run_local_flow.
Verification Completion Gate
Before you mark this task complete, run the SiteLens MCP tool sitelens_run_local_flow with flowId [flow-id] and url [local-dev-url]. If any step fails, fix the issue and re-run until pass or report blockers with screenshot paths. Do not claim verification is done until the flow passes.
Coverage Gap Discovery
List .sitelens/flows/*.json and compare against recent feature changes in [area]. Propose 2–3 new flowIds or step additions to close coverage gaps. For each gap, draft a sitelens_run_local_flow prompt I can paste into Cursor and note which Page Intelligence fields (primaryActions, workflowStages) would help plan the flow.
Related
Contact & onboarding
Agent verification rollout, MCP help, or flow authoring — same short form everywhere.