# Onboard your agent to Snapvisor

> Give Claude Code, Codex, Cursor or OpenCode a setup guide for the Snapvisor MCP server, screenshot SDK and connection check, with clear sign-in steps.

Source: https://snapvisor.io/agent-setup

Agent setup

Connect your AI tool to Snapvisor: the MCP server, the SDK for your test runner, and a check that the connection works.

## Setup file for agents

An agent can also run the whole setup from [/agent-setup/prompt.md](https://snapvisor.io/agent-setup/prompt.md), a plain markdown file with the exact commands below. The agent handles setup and reports any sign-in, restart, or CI secret steps you need.

## Guides per agent

[**Claude Code**One command adds the remote MCP server; OAuth opens in the browser on first use.](https://snapvisor.io/agent-setup/claude-code) [**Codex**Register the streamable HTTP server, then `codex mcp login` runs the OAuth consent.](https://snapvisor.io/agent-setup/codex) [**Cursor**One entry in `mcp.json`, global or per project; sign in from Cursor's MCP settings.](https://snapvisor.io/agent-setup/cursor) [**OpenCode**A remote entry under `mcp` in `opencode.json`, then `opencode mcp auth` for OAuth.](https://snapvisor.io/agent-setup/opencode)

## How the credentials work

- **MCP server, OAuth 2.1 (default).** A request without a token gets a `401`; compatible clients offer browser sign-in to Snapvisor. The client handles token storage after you approve access. Revoke an agent's access any time with the `revokeAuthorizedApp` tool, or from Settings → Applications.
- **MCP server, personal access token (headless alternative).** Use it only when the user asks for a token-based setup or your client cannot open a browser. If `SNAPVISOR_ACCESS_TOKEN` is not already set, ask the user ONCE to create a token at [https://app.snapvisor.io](https://app.snapvisor.io) under Settings, Tokens, and to export it as `SNAPVISOR_ACCESS_TOKEN` in their shell profile. Never write the token into a file that is committed.
- **Project tokens are rejected by the MCP server.** A project's `ARGOS_TOKEN` only uploads screenshots from CI (step 3). It cannot read the API or drive the MCP server.
- **Permissions.** On the consent page every permission tier is checked by default: read, write, destructive (delete), billing, account, team, connections, support and API keys. The user can uncheck any. A refused call returns `SCOPE_MISSING` with `next.tool = "request_scopes"`, which gives the user a one-click link to add the missing tier. MCP works on every plan, Free included. `getMe` verifies the connection.

## Any other MCP client

1. Point the client at `https://mcp.snapvisor.io` over streamable HTTP. Clients that use an `mcpServers` file take this entry. A client that cannot run OAuth sends `Authorization: Bearer` followed by a personal access token.
  json
  ```
  {
    "mcpServers": {
      "snapvisor": {
        "url": "https://mcp.snapvisor.io"
      }
    }
  }
  ```

## Add the SDK

1. Only do this step inside a project that has a UI test suite; otherwise skip it and say so in the completion message. Without a test suite the project can still be tested over MCP, with no CI: for public pages, `captureScreenshotsForProject` has Snapvisor open and screenshot them itself; for anything else, screenshot the running app and push the images. Walkthrough: [https://snapvisor.io/docs/agents/visual-testing-without-ci](https://snapvisor.io/docs/agents/visual-testing-without-ci). Use the package manager the project already uses (the lockfile tells you): the commands below are written for npm.
2. Playwright (`@playwright/test` in `package.json`): install the SDK, register its reporter in `playwright.config.ts`, and capture screenshots with `argosScreenshot` in the tests that render UI.
  bash
  ```
  npm install --save-dev @snapvisor/playwright
  ```
3. The reporter uploads from CI only, so local runs stay offline:
  ts
  ```
  // playwright.config.ts
  import { defineConfig } from "@playwright/test";
  import { createArgosReporterOptions } from "@snapvisor/playwright/reporter";
  export default defineConfig({
    reporter: [
      process.env.CI ? ["dot"] : ["list"],
      [
        "@snapvisor/playwright/reporter",
        createArgosReporterOptions({ uploadToArgos: !!process.env.CI }),
      ],
    ],
  });
  ```
4. Storybook: install `@snapvisor/storybook`. Vitest browser mode: install `@snapvisor/vitest`. Then wire them as the SDK page describes.
  bash
  ```
  npm install --save-dev @snapvisor/storybook
  ```
5. Any other runner that writes screenshots to a folder: install the CLI and upload that folder after the tests run.
  bash
  ```
  npm install --save-dev @snapvisor/cli
  npx @snapvisor/cli upload ./screenshots
  ```
6. Python projects: follow the Python SDK section of [https://snapvisor.io/docs/sdks](https://snapvisor.io/docs/sdks).
7. Uploads authenticate with the project's `ARGOS_TOKEN`, found in the project's settings at [https://app.snapvisor.io](https://app.snapvisor.io). It belongs in CI secrets, never in the repository. On GitHub Actions no token is needed: [https://snapvisor.io/docs/learn/integrations/github-tokenless-authentication](https://snapvisor.io/docs/learn/integrations/github-tokenless-authentication).
8. Optional: the CLI can also inspect builds, submit reviews and post comments from the terminal. `login` opens the browser for the user to approve; `whoami` confirms it.
  bash
  ```
  npx @snapvisor/cli login
  npx @snapvisor/cli whoami
  ```

## Verify the connection

1. The `snapvisor` MCP server normally shows only two tools, `search_tools` and `execute_typescript`, and every operation is reached through them. Call `search_tools` with the query `getMe`; it answers with the declaration of `external_getMe`. Then call `execute_typescript` with this program:
  ts
  ```
  return await external_getMe({});
  ```
2. If the server instead lists `getMe` as a tool of its own, call that tool directly. Either way, success is a response naming the signed-in user and the accounts the connection can reach; each account `slug` is the `owner` argument of every other operation.
3. Most agents load MCP servers when a session starts. If no `snapvisor` tool is available to you yet, do not report failure: the completion message tells the user to restart the session and ask you to verify the connection.
4. A `401` means the browser sign-in has not been completed yet. Inside `execute_typescript` a refused call throws an error carrying the same message; wrap the call in `try`/`catch` to read it. A `QUOTA_EXCEEDED` answer means the connection works and a plan limit was reached; its `next` points at `upgrade_plan`.

Something off? The [MCP server guide](https://snapvisor.io/docs/agents/mcp-server) and the [FAQ](https://snapvisor.io/docs/faq) cover the common cases, and [support](https://snapvisor.io/support) reads every message and a human replies within 1 business day. For what the server can do and its discovery documents, see the [MCP server overview](https://snapvisor.io/mcp).

## Related pages

Guides [How visual regression testing works](https://snapvisor.io/visual-regression-testing) [Self-hosted visual regression testing](https://snapvisor.io/self-hosted-visual-regression-testing) [Visual regression testing in GitHub pull requests](https://snapvisor.io/visual-regression-testing-github) [Snapvisor MCP server](https://snapvisor.io/mcp)

Test runner and CI setup [Playwright visual testing setup](https://snapvisor.io/playwright) [Storybook visual testing setup](https://snapvisor.io/storybook) [Cypress visual testing setup](https://snapvisor.io/cypress) [Puppeteer visual testing setup](https://snapvisor.io/puppeteer) [Visual regression testing in GitLab CI](https://snapvisor.io/gitlab-ci)

Compare Snapvisor [Snapvisor vs Percy](https://snapvisor.io/compare/percy) [Snapvisor vs Chromatic](https://snapvisor.io/compare/chromatic) [Snapvisor vs Applitools](https://snapvisor.io/compare/applitools) [Snapvisor vs Argos](https://snapvisor.io/compare/argos) [Snapvisor vs Lost Pixel](https://snapvisor.io/compare/lost-pixel) [Snapvisor vs Happo](https://snapvisor.io/compare/happo) [Snapvisor vs Playwright snapshots](https://snapvisor.io/compare/playwright) [Visual regression testing pricing compared](https://snapvisor.io/visual-regression-testing-pricing) [Alternatives to other visual testing tools](https://snapvisor.io/alternatives)

Free tools [Image diff checker](https://snapvisor.io/tools/image-diff) [Screenshot calculator](https://snapvisor.io/tools/screenshot-calculator)

Agent setup [Set up Snapvisor in Claude Code](https://snapvisor.io/agent-setup/claude-code) [Set up Snapvisor in Codex](https://snapvisor.io/agent-setup/codex) [Set up Snapvisor in Cursor](https://snapvisor.io/agent-setup/cursor) [Set up Snapvisor in OpenCode](https://snapvisor.io/agent-setup/opencode)
