Gemini CLI browser testing with MCP

Add Monito to Gemini CLI's MCP settings so Gemini CLI can test a URL in a real browser and read the verdict, report and screenshot evidence.

Coding agents · Checked 2026-11-27

Connect Gemini CLI to Monito and describe the journey you changed. Use the browser verdict and evidence to decide what needs fixing.

How it works

  1. Gemini CLI calls check through the Monito MCP connection with a URL and expected behavior.
  2. Monito exercises that behavior in a browser and returns a verdict or an unfinished runId for wait_for_run.
  3. Gemini CLI reads get_run and get_screenshot to inspect the evidence, and returns the report link alongside its explanation.

Set it up

Browser checks use credits without a subscription requirement. OAuth and CLI browser sign-in do not require an API key. Creating API keys, CI bindings or deploy webhooks requires Pro or Team. Plan details

  1. Add an mcpServers entry to ~/.gemini/settings.json, or to .gemini/settings.json in a project. The settings page calls these user settings and workspace settings, and says workspace settings override user settings. The enterprise page says mcpServers entries are merged by server name, and a workspace server with the same name replaces the user server. gemini mcp add writes this object. Its default scope is project, which uses .gemini/settings.json. Pass --scope user to write ~/.gemini/settings.json. Put the API key in the user file so it stays out of the repository. The MCP docs say not to put an underscore in the server name, because the policy parser splits the tool name on the first underscore after mcp_. This entry is named monito.
  2. Set httpUrl to https://www.monito.dev/api/mcp. The MCP docs map httpUrl to streamable HTTP and url to SSE. Monito's hosted server reads an API key from the x-api-key header. The published header example and the gemini mcp add --header example use an Authorization bearer token, and that header is not the one Monito reads. The same docs describe automatic OAuth discovery for a remote server and /mcp auth to manage it. Our team has not confirmed that flow with Monito, so this page uses the API key. Replace YOUR_MONITO_API_KEY in the header and do not commit the key. Run /mcp in a session, or gemini mcp list from the shell, to see connected servers.
  3. Ask Gemini CLI to check a deployed URL and show the verdict and report. For HTTP localhost, configure the local command below instead. A local server in this file uses command and args rather than httpUrl. The MCP docs say a stdio server is shown as connected only when the current folder is trusted. Use gemini trust for that folder. Leave trust unset on the server entry. The docs default it to false, which keeps the tool confirmation. Setting it to true bypasses those confirmations, and each check spends credits. The hosted server rejects localhost and private-network URLs.
~/.gemini/settings.json · json
{
  "mcpServers": {
    "monito": {
      "httpUrl": "https://www.monito.dev/api/mcp",
      "headers": {
        "x-api-key": "YOUR_MONITO_API_KEY"
      }
    }
  }
}

Merge the monito entry into an existing mcpServers object. Remote streamable HTTP servers use httpUrl. The header name is x-api-key. Replace YOUR_MONITO_API_KEY and do not commit the key. Checked against the Gemini CLI MCP docs on 2026-11-27. The current source of gemini mcp add --transport http writes url and type http instead of httpUrl, and that source still connects httpUrl as streamable HTTP. Our team has not run this configuration in Gemini CLI.

Follow the verdict to the evidence

Call check with url and expectation, for example your deployed cart URL and "The total includes shipping". Keep projectId stable for previews whose hostname changes.

When done is false, call wait_for_run with the returned runId. Do not launch another check just to keep waiting. Reuse requestId after an uncertain launch response to avoid another charge.

Call get_run with runId to read the verdict, bug reports, failed requests, console messages and screenshot names. Then call get_screenshot with run.sessionId and a fileName from evidence.screenshots, not a screenshot URL.

After a fix, call check again. Use save_check with checkId and a name to keep a deployed check as a test; add its automation separately.

Default tools and the local server

The default tools are check, save_check, get_run, get_screenshot, wait_for_run, list_projects, list_scenarios, list_runs, run_scenario, and run_project.

In CLI 4.8.1, the local server's check,core-read default has seven tools and leaves out list_runs, run_project, and get_screenshot. Pass --toolsets check,core to include them; that also adds the rest of the core toolset, including tools that create and change scenarios. The hosted server includes all three by default.

Default tools and the local server · bash
npx -y @monitodev/cli auth login
npx -y @monitodev/cli mcp --toolsets check,core

Use this command as your client's local server to include screenshot access on CLI 4.8.1. Sign in once before starting it. Keep both the MCP server and your dev server running for localhost checks.

Using another coding agent?

Claude Code, Codex, and Cline each have a setup page. The MCP server page covers the hosted endpoint, toolsets, and credits for any client.

Gemini CLI sources

The mcpServers object, the ~/.gemini/settings.json and .gemini/settings.json paths, the httpUrl field, the headers object, gemini mcp add, and /mcp on this page were checked against the Gemini CLI MCP docs on 2026-11-27. Those docs map httpUrl to streamable HTTP and url to SSE. The settings page says workspace settings override user settings. The enterprise page says mcpServers entries merge by server name, with workspace replacing a user server of the same name. The current Gemini CLI source still connects httpUrl as streamable HTTP and comments that httpUrl is deprecated in favor of url with type set to http. gemini mcp add --transport http in that source writes url and type http. Monito reads the API key from the x-api-key header. The docs examples use an Authorization bearer token. The docs describe OAuth discovery for a remote server. Our team has not confirmed that flow with Monito. Header values in the current source are expanded with $NAME and ${NAME} after environment redaction is forced on. Names matching KEY, TOKEN, SECRET, AUTH, and similar patterns are removed first, so a reference to MONITO_API_KEY would expand empty. The settings reference defaults security.environmentVariableRedaction.enabled to false, and that default does not change this header path. The benchmark reports below do not validate this configuration. Our team has not run it in Gemini CLI.

Example result

Example result: field names from the CLI, values illustrative

These verdict fields come from CLI 4.8.1 check --json. This illustrative failure describes a cart total that omits shipping. Timing and billing values are left null in this example. Use the returned reportUrl for the actual evidence.

Illustrative result · JSON
{
  "checkId": "check_example",
  "projectId": "project_example",
  "runId": "run_example",
  "done": true,
  "status": "failed",
  "cause": "product_defect",
  "causeLabel": "App bug",
  "durationMs": null,
  "creditsCharged": null,
  "reportUrl": "https://www.monito.dev/session/session_example",
  "firstFailure": "The cart total does not include shipping."
}

Limits to account for

The hosted server at https://www.monito.dev/api/mcp tests deployed URLs. It rejects localhost and private-network URLs. The local server, npx -y @monitodev/cli mcp, reaches HTTP localhost through a tunnel; the browser still runs in the cloud.

Local checks have no saved logins or request headers. They cannot be scheduled or added to suites, automations or status pages, even after saving.

A failed run reports a bug. An error is not a verdict about your app. Read the evidence before asking your agent to change code.

Comparable benchmark runs

Our team published these runs in the reliability benchmark. They show comparable browser journeys, not executions of the configuration or illustrative result above. Run your own scenario before relying on this integration.

Benchmark method and limits

Read the full guide