AI Agent Verification · SiteLens Local + MCP
Give Cursor a real browser verification gate—not a guess.
AI Agent Verification is how coding agents prove a change works: SiteLens MCP runs bundled Chromium on your machine, executes structured flows from .sitelens/flows, and returns pass/fail evidence with screenshots. Agents plan with Page Intelligence; they prove outcomes with local flows—no API key required for verification loops on localhost.
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 artifacts locally: summary JSON, report markdown, and viewport screenshots your agent can reference in the PR or chat.
Completion gates
Prompt-library patterns (below) tell Cursor to re-run flows until pass—closing the gap between “code compiles” and “user journey works.”
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
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, 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, and waitForText steps. 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.