MCP guides

Login once and reuse local auth

SiteLens stores auth on your machine only — not in SiteLens cloud.

Paths

Profile name defaults to your Cursor workspace folder name; you can pass explicit names (default, my-app, …).

Auth modes

ModeBehavior
noneNo saved session
isolatedFresh context each run (default when no profile)
storage-stateLoad Playwright storage state JSON before navigation
persistent-profileReuse Chromium user data dir (best for “stay logged in”)

Global config (optional)

// ~/.sitelens/config.json
{
  "browser": "chromium",
  "auth": {
    "mode": "persistent-profile",
    "userDataDir": "~/.sitelens/profiles/default",
    "storageStatePath": "~/.sitelens/auth/default.json"
  }
}

Interactive login flow

  1. sitelens_auth_start with your login URL and optional profileName. Sign in in the headed browser.
  2. sitelens_auth_save with the same profile — writes storage state and keeps the profile directory.
  3. sitelens_qa_run with authProfile on protected routes.

Security

Never commit ~/.sitelens/, .sitelens/, or *auth-state*.json. Add .sitelens/ to .gitignore.

Authenticated localhost QA →