VisualCI
O VisualCI compara os PDFs, as capturas de tela e os snapshots gerados pelos seus testes. As alterações não fazem o CI falhar: seu agente de programação analisa cada uma delas via MCP.
Servidor MCP hospedado
npx add-mcp 'https://mcp.visualci.com/mcp'Instala no Claude Code, Codex, Cursor e outros
Documentação
Coding agents
Connect a coding agent to VisualCI's MCP server, so it can read each change, check it against the code, and approve it or fix it.
Source: https://visualci.com/docs/agents/ All of VisualCI's documentation: https://visualci.com/llms.txt
Coding agents write most code now, and they fix most CI failures. VisualCI is built so the agent that wrote the code also reviews what it changed. It doesn't need a person to open a screenshot.
Connect
The MCP server is at https://mcp.visualci.com/mcp (Streamable HTTP). Add that URL to your MCP client. The client opens VisualCI's sign-in, and you approve it once. If you don't have an account yet, signing in with GitHub creates one, with your own organization and a project to start with.
Claude Code:
claude mcp add --transport http visualci https://mcp.visualci.com/mcp
Then run /mcp in Claude Code and choose VisualCI to sign in.
Claude, ChatGPT, Cursor, VS Code and other clients: add a custom MCP server (or connector) with the same URL. In Claude Code, Gemini CLI and Cursor, the plugin adds the server with VisualCI's skills.
A connected client can do everything you can, in every organization you belong to. Disconnect it from your account page.
Tokens, for CI and scripts
Where a sign-in isn't possible, send a token as Authorization: Bearer <token>:
- a personal access token (
vcu_...), created on your account page: everything you can do, in every organization you belong to; - or a project token (
vci_...), from a project's Tokens tab: that one project, as a member (builds, reviews, comments; not settings, tokens or members). With a project token, tools take noprojectargument.
claude mcp add --transport http visualci https://mcp.visualci.com/mcp \
--header "Authorization: Bearer $VISUALCI_TOKEN"
The review loop
- CI sends a build and finishes. When something changed, the CI job still passes, and the pull request's VisualCI check stays pending.
- The agent calls
list_buildsorget_buildto see what needs attention: changed, added, removed and failed snapshots. - For each change, it calls
get_snapshot. For PDFs and images that returns the base, head and diff images of the changed pages, the changed regions, the page's text diff, and lines that moved to another page. For text, JSON and HTML snapshots it returns the changes by JSON path (items[3].price: 10 → 12) and a unified diff. A contact sheet is for finding the changes, not for judging them: its thumbnails are too small to show a button covering a tab or a missing style. Open every sizeable UI change withget_snapshotandcrop: "changed", which shows the changed regions at full size. - The agent checks each change against the code and the task:
- Intended: it calls
reviewwithapprove. The approved snapshots become the baseline, and the check turns green. No new commit or CI run is needed. - A bug: it fixes the code and pushes again. The next build is compared with the same baseline.
- Intended: it calls
snapshot_historyshows one snapshot across recent builds, which helps find when a page started changing.get_buildmarks a changeflaky: truewhen its content flipped back and forth over the branch's recent builds: often a test that isn't deterministic rather than a real change (see Deterministic screenshots).- Before asking for a merge,
get_pr_changeset(the project and the pull request's number, or a branch) lists everything the pull request adds, changes or removes across all of its builds, against the baseline it forked from, with where review stands for each. A change approved in an earlier build still shows there, so nothing slips through; nothing should be pending or unexpected. The web app shows the same at/<org>/<project>/pulls/<number>.
On GitHub, VisualCI keeps one comment on each pull request up to date when something changed: each suite's newest build, its counts and review state, before and after images of the changed snapshots, and what was removed. A pull request where nothing changed gets only the passing check, unless the project's comment_when_unchanged setting is on; a comment that's already there keeps being updated. To show images in a comment of your own, use the embed_url links get_snapshot gives for each page: they work for a week.
Comment threads
Anyone reviewing can pin a comment to a spot on a snapshot (a point, a box or the whole image, on the old or new side), and agents can too, with post_comment. Points and boxes are in pixels of that side's image from its top left, the same units as the regions get_snapshot gives, so a changed region can be pinned as it is, and a pin stays on its content when a later screenshot grows at the bottom. A thread stays on the build it was drawn on, and newer builds of that snapshot on the branch list it with that build's number (get_snapshot and get_build show open threads). To check your fix against a comment, call get_snapshot with against: "previous": it compares the new image with the previous build's instead of the baseline. Review still uses the baseline. While a snapshot has an open thread, from any build of the branch, review won't approve it and names the thread and its build instead: answer it (post_comment with thread), and resolve it with resolve_comment once it's settled. Rejecting still works, and review with reject and a comment leaves the reason on each rejected snapshot. list_comments lists a build's threads, get_build and whoami show where threads are open, and update_comment and delete_comment edit or remove your own comments. Comments are Markdown: the web app shows paragraphs, emphasis, code, lists, quotes and web links, and anything else (headings, images, raw HTML) as plain text. The tools give and take the Markdown as it is.
Every review is recorded on the build, with the user and the app that made it. A review made with a project token is recorded without a user.
Pages that legitimately render two ways can be accepted as a variant with review_page and variant. A change that should never count again can be ignored with review_page and ignore.
Set up the repository for agents
An agent follows a review loop only if the repository tells it to, and a pending check holds up a merge only if the repository requires it. Do both once per repository.
Add a VisualCI section to AGENTS.md
Add this to the repository's root AGENTS.md (or CLAUDE.md, if that's what your agents read), so every agent that
works there reviews its own changes:
## VisualCI
CI sends this repository's screenshots and snapshots to VisualCI (https://visualci.com). A visual or snapshot change
never fails CI: the pull request's VisualCI check stays pending until the build is reviewed.
After CI finishes on your push:
1. Find the build over VisualCI's MCP server: `list_builds` for this branch, then `get_build`.
2. Open each change with `get_snapshot`. For a sizeable UI change, use `crop: "changed"`: a contact sheet's
thumbnails are too small to judge.
3. Approve the changes you meant to make with `review`. For anything you didn't mean, fix the code and push again.
4. Merge only when every check is green, VisualCI's included. If a merge is refused because the VisualCI check is
pending or expected, the build is waiting for review: review it. Never bypass the check.
If you don't have VisualCI's tools, ask the person to connect the MCP server (https://visualci.com/docs/agents/)
and to start a new session: MCP servers load when a session starts. Until then, the CLI does the same review:
`visualci build list --waiting`, `visualci build show <n>`, `visualci build snapshot <n> <name> --crop changed
--save-images <dir>` and `visualci build review <n> approve`.
Where agents push straight to the default branch, replace step 4 with "Review the build of every push to the default branch before starting the next task" (see Repositories without pull requests).
Make the check block merges
On GitHub, require the VisualCI check on the default branch. This needs the VisualCI GitHub App on the repository:
without it there's no check to require. A repository admin can add the ruleset with the
GitHub CLI:
gh api repos/OWNER/REPO/rulesets -X POST --input - <<'EOF'
{
"name": "VisualCI",
"target": "branch",
"enforcement": "active",
"conditions": { "ref_name": { "include": ["~DEFAULT_BRANCH"], "exclude": [] } },
"rules": [{
"type": "required_status_checks",
"parameters": {
"strict_required_status_checks_policy": false,
"required_status_checks": [{ "context": "VisualCI", "integration_id": 5984743 }]
}
}]
}
EOF
integration_id is the VisualCI app's, so only VisualCI can pass the check. With several suites, add one entry for
each (VisualCI: pdf). To do it in GitHub's settings instead, see
Make the check required. The rule also refuses pushes straight to
the default branch, so changes go through pull requests.
Two cases where a ruleset isn't the answer:
- A private repository on GitHub Free can't have rulesets or branch protection (
gh apianswers "Upgrade to GitHub Pro or make this repository public"). They need GitHub Pro, Team or Enterprise. Without them, setci_mode: waitorstrict, so CI itself waits for the review or fails, and a merge needs CI to pass. - A repository that pushes straight to the default branch shouldn't require the check: the rule would refuse every push, since a commit's check only exists after it's pushed. Its agents review the build of each push instead (see Repositories without pull requests).
On GitLab and other providers, set ci_mode: wait or strict (see
Repositories without pull requests): the pipeline then waits, or fails, until
the changes are reviewed, and a merge rule that needs the pipeline to pass holds up the merge.
When a merge is refused
gh pr merge and the pull request page refuse a merge while a required check hasn't passed. The message names the
check:
Required status check "VisualCI" is expected.
"Expected" means the check hasn't arrived: CI is still running, or the VisualCI app isn't installed on the repository. "Pending" or "in progress" means the build is waiting for review. Review it over MCP, then merge again.
Keeping approval with people
Some teams want agents to read builds and fix code, but leave approving changes to a person. For agents in CI,
which use the project's token, turn off Project tokens can approve in the project's settings (or update_project
with tokens_can_approve: false): a project token can then still reject changes and comment, but approving, accepting
a variant or ignoring a change takes a person. For agents on people's machines, which use their own token, take the
two review tools away in the agent's client:
-
Claude Code: deny them in
.claude/settings.json, which the whole team shares through the repository:{ "permissions": { "deny": ["mcp__visualci__review", "mcp__visualci__review_page"] } }If you installed VisualCI's plugin instead of adding the server yourself, the names are
mcp__plugin_visualci_visualci__reviewandmcp__plugin_visualci_visualci__review_page. -
Codex: list them in
disabled_toolsin~/.codex/config.toml:[mcp_servers.visualci] url = "https://mcp.visualci.com/mcp" disabled_tools = ["review", "review_page"]
These settings live on the agent's machine. To enforce it on VisualCI's side, give the agent its own VisualCI account with the Read role, which can see builds but can't approve them (see Access).
Repositories without pull requests
Where agents push straight to the default branch, there's no pull request for a pending check to hold up, so unreviewed changes can pile up on main without anyone noticing. Someone has to review main's builds: name who in the repository's AGENTS.md (usually "the agent that pushed reviews its push's build"). Three things keep them in view:
- The commit's VisualCI check stays pending until the build is reviewed, as on a pull request (with the VisualCI GitHub App installed on the repository; without it there's no check).
whoamilists the newest builds waiting for a review, andlist_buildswithwaiting_for_review: truelists a project's. Add a line to your agents' instructions: after a push, review its VisualCI build.- To hold the push's CI run until the review, set
ci_mode: waitin visualci.yml and finish withvisualci build finalize --wait: CI waits (up to--timeout) while the agent reviews, then passes or fails on the result.strictfails the run on any unreviewed change instead.
We recommend the default review mode with the agent that pushed reviewing its build: CI and deploys never wait, and
an approval later still makes the change the baseline. Choose wait when a deploy must not go out with an unreviewed
visual change, and only if an agent or a person is there to review within the timeout: otherwise every push times out.
A local run's build (from a laptop, visualci test or visualci check) waits only in its own person's lists, and
leaves them after a week with nothing happening to it (it's kept, closed, in the build list).
Snapshot tests work the same way. With VisualCI, the tests write their snapshots and pass (Jest's -u,
INSTA_UPDATE=always INSTA_FORCE_PASS=1, syrupy's --snapshot-update), and the review happens on VisualCI. If a
change on main must stop CI before anyone looks, use ci_mode: strict, or keep those snapshot files committed and
failing in the repository instead of sending them.
Tools
Builds
list_builds: a project's builds, newest first, optionally for one branch or only those waiting for a review.get_build: a build's status and the snapshots that need attention, each with its link, 30 at a time (offsetandlimit); a longer list also comes grouped by state and name prefix.get_snapshot: one snapshot's comparison, page by page, with images scaled to 1200 pixels wide (max_width), or cropped to what changed (crop: changed). The platform can be left out when the name is on one platform only.contact_sheet: many snapshots at a glance, as one grid of thumbnails with the list of what's in it, for checking a build with many new snapshots in a few calls.download_build: a build's images as one tar.zst, for a close look at a big build or for checks of your own (pixel counts, OCR, a script over every page). Filter bystate(changedby default),sides(base,head,diff,regions: the head cropped to the changes) and aglobon snapshot names. It returns a link that lasts an hour and a summary, never the images. The archive has<name>[@platform][/page-N]/{base,head,diff,regions}.pngand amanifest.jsonwith each snapshot's state, pages, changed fraction and regions. With a big build (thousands of pages), scan it withcontact_sheet, then download the changed images and look at them on disk. Free.snapshot_history: one snapshot across recent builds.list_comments,post_comment,update_comment,resolve_comment,delete_comment: comment threads pinned to snapshots.get_pr_changeset: a pull request's (or branch's) changes across all its builds, against its fork point.
Reviews
review: approve or reject a build's changes, some snapshots' changes (snapshots), or only its new or only its changed snapshots (only: "added"or"changed"). Add anotesaying why ("The new header, as the issue asked"): it shows in the build's reviews,get_buildand the pull request comment. Every review says who made it and how: "Claude Code for Ada Lovelace" for an agent signed in as its person, "Ada Lovelace" in the web app, or "a project token (CI)", so an agent's approval never reads as the person's own. When two pull requests change the same screen and merge separately, the screen after both is one neither showed, so it shows as changed until someone reviews it. If the change is exactly another pull request's approved change (the same regions, from the same old pixels to the same new ones),get_buildmarks itmatches("matches PR #8's approved change"), andonly: "matching"approves those in one call. On a pull request's build whose base is a default-branch build nobody has reviewed yet, the changes that are main's own unreviewed ones are markedon_main_unreviewed, andget_build'sinheritedsays how many and which build: review those on main's build, and the pull request's own changes here.review_page: accept one page as a variant, or ignore one exact change in later builds too.
Running a comparison
create_build,upload_snapshots(PDFs, PNG, JPEG and WebP images, or text, JSON and HTML, base64, up to 64 MB per call) andfinalize_build. An agent can compare files without a CI run.
Organizations and projects
whoami(who the token belongs to, and the newest builds waiting for a review),list_organizations,get_organization(projects, plan, credits used this month and pack credits).- Out of credits:
whoami(for each organization) andget_buildreturnblocked, with what fixes it and amessageto pass on to your person as it is. Buying credits stays with them. create_organization,create_project,get_project,update_project(settings and ignore rules),create_project_token,delete_project_token.
Without the MCP server
- The CLI has the review tools as commands, for CI jobs and agents without MCP:
visualci build list,build show,build snapshot(with--save-images) andbuild review. See Reviewing builds.
Support
support_send: send feedback about VisualCI itself. See Support.
Choosing a plan and paying stay with a person, in the web app.