Docs

Happo MCP server

Let your AI assistant read Happo's visual and accessibility diffs, fix what it didn't mean to change, and accept or reject the rest. It works with Claude, ChatGPT, Cursor and any other MCP-aware client.

Your assistant already has your code and knows what each change was meant to do, so it brings the context and Happo brings the diffs. Happo never needs access to your repository.

Server URL

Paste it where your client asks for one. It opens your browser to sign in to Happo and pick the account the assistant may use: no API token to copy.

Set up your client

Claude

Web, desktop and mobile
  1. Open Happo in Claude's connector directory.
  2. Click Connect and sign in to Happo.

On Team and Enterprise plans, an owner may need to allow the connector first. You can also add Happo under Settings → Connectors → Add custom connector with the server URL above.

Claude Code

Terminal
  1. Add the server:
  2. The first time the assistant uses a Happo tool, Claude Code prints a link: open it and approve the consent screen.

Cursor

Editor
  1. Add Happo to ~/.cursor/mcp.json, for every project, or to .cursor/mcp.json at a repository's root, to share it with your team (Cursor's docs):
  2. Reload Cursor, or turn the Happo server on under Settings → Features → Model Context Protocol.
  3. The first time the assistant uses a Happo tool, Cursor opens your browser to sign in to Happo and choose the account.

Add a remote MCP server with the server URL above. Happo speaks the Streamable HTTP transport and signs clients in with OAuth 2.1: a client finds the sign-in endpoints at /.well-known/oauth-protected-resource and opens your browser, so there is no token to configure.

Example prompts

Once you're connected, ask in your own words. A few to start with (click one to copy it):

What the assistant can do

The assistant picks these tools itself as it works through your request. This list comes from the server, so it is always the tools it offers today.

Look

Read-only

Find comparisons and read what changed in them. These change nothing.

  • Get Accounts

    get_accounts

    List the Happo accounts this connection is authorized to act on.

    Details

    When more than one account is returned, every other tool requires the account argument set to one of these account ids.

  • List Comparisons for SHA

    list_comparisons_for_sha

    List all Happo comparisons that include the given commit SHA as either the "before" or "after" report.

    Details and 2 arguments

    Spans all projects on the account by default; pass project to filter. Returns comparison metadata you can feed into get_comparison_details, accept_comparison, etc.

    sha stringrequired
    The commit SHA. Either the head SHA of a PR or any other report identifier.
    project string
    Project name. Omit to list comparisons across all projects on the account.
  • Get Comparison Details

    get_comparison_details

    Get the diffs, added and deleted snapshots of a comparison between two reports, with the signed image URLs to look at and the ids the review tools take.

    Details and 6 arguments

    Use this to understand what visual changes are in a PR. reviewOrder lists them the way the comparison page does: most important first, with targets and variants that made the same change folded together so one inspection stands for many. Where Happo measured a diff, it also says how much changed and whether it is anti-aliasing noise. A large comparison comes in pages of whole reviewOrder rows: when nextOffset is not null, call again with offset set to it for the next. Ignored diffs are only counted (counts.ignored, ignoredBy) unless includeIgnoredDiffs is set, apart from the first flakes people reported (reportedFlakes). Read every page before accept_comparison, which accepts every diff. The first page of a comparison that takes more than one has an overview of all of it, which often answers what it holds without the rest. Heavy deep-comparison work is skipped — this returns the previously-computed comparison result.

    sha1 stringrequired
    The "before" report SHA.
    sha2 stringrequired
    The "after" report SHA.
    project string
    Project name. Omit to infer the project from the sha1..sha2 pair; only needed when that pair exists in more than one project on the account.
    offset integer
    Where to continue: pass an earlier call's nextOffset, a place in the comparison rather than a count, so verdicts cast between pages skip nothing. Omit for the first page.
    limit integer
    About how many diffs and snapshots to list in this call, 30 unless given. Rows are never split, so a row that folds many in can take more.
    includeIgnoredDiffs boolean
    List the ignored diffs too (ignoredDiffs), after the rows to review and paged with them, each with who ignored it and why. Leave it out to review a comparison: an ignored diff needs no verdict. Set it when the user asks about ignored diffs or flakes.
  • Get Diff Measurements

    get_diff_measurements

    Where the given diffs of a comparison changed, as Happo measured them.

    Details and 5 arguments

    regions and contentShifts place each change in the before and after images, in their own pixels, ready to crop to; beside them are how much changed and the size each image decoded to. With raw, everything stored follows instead: every changed rectangle with its pixel hashes and structural difference, the histogram of color distances, the row alignment between the two images and the settings it measured under. get_comparison_details summarizes these; ask for them when the summary is not enough to decide.

    sha1 stringrequired
    The "before" report SHA.
    sha2 stringrequired
    The "after" report SHA.
    pairs array of objectrequired
    Diffs of the comparison, by a diff's before.id and after.id (ignored diffs too).
    raw boolean
    Return every column Happo stored for each diff, a few kilobytes each, rather than where it changed and how much. Rarely needed to review a diff.
    project string
    Project name. Omit to infer the project from the sha1..sha2 pair; only needed when that pair exists in more than one project on the account.
  • Get Render Logs

    get_render_logs

    Read the render logs: what Happo logged while rendering the snapshots of one report (one commit SHA's run): pages loading, console messages, failed requests, images and fonts that timed out or were still loading right before the screenshot, retries and errors.

    Details and 9 arguments

    Use it to find out why a snapshot rendered wrong or differently between runs. A report is rendered by several snap requests (one per target and chunk), each with its own log, and a whole report can be hundreds of thousands of lines, so narrow it: snapshotId returns only the lines for that snapshot, query only matching lines, minLevel only warnings or errors. Snapshots are rendered one after another, and with Storybook many share one page, so a snapshot's lines run from where the one before it finished to its own Processed <component>, <variant> in <browser> (<timings>) line: the name is at the end, with how many milliseconds the render (r), the wait for the page to settle (w) and the screenshot (s) took. What loading the page logged (scripts, stylesheets, fonts) comes before the first snapshot and is in no snapshot's lines: read a snap request's log from its start with snapRequestIds for that. With snapshotId, query or minLevel, snap requests that matched nothing are only named, in unmatchedSnapRequestIds. Read-only. Logs are kept for a limited time, so an old report's may be gone.

    sha stringrequired
    The SHA of the report whose run to read. For a diff from get_comparison_details, sha2 rendered the "after" snapshot and sha1 the "before".
    snapshotId string
    A snapshot id from get_comparison_details. Returns only the lines logged while rendering that component and variant, from the logs of that snapshot's target. The run is searched by those names, so the snapshot of another report shows how this one rendered the same component and variant.
    query string
    Only lines containing this text (case-insensitive), with contextLines around each.
    minLevel "info" | "warn" | "error"
    Only lines at this level or above, with contextLines around each. Most lines are info; a warning is something the render had to work around.
    contextLines integer
    Lines to include before and after each line query or minLevel matched. Defaults to 2.
    snapRequestIds array of integer
    Only these snap requests, by the id an earlier call listed.
    offset integer
    Lines to skip: pass an earlier call's nextOffset to continue.
    maxLines integer
    Lines to return at most. Defaults to 200.
    project string
    Project name. Omit to infer it from the SHA; only needed when the SHA ran in more than one project on the account.

Review

Changes review status

Accept, reject or report a flake. Each is recorded against you, the same as clicking the button on the compare page.

  • Accept Diff

    accept_diff

    Accept one diff, added snapshot or deleted snapshot in a Happo comparison, or several with pairs: the change is intended.

    Details and 6 arguments

    Recorded against the snapshot pair, so it also counts in later comparisons with the same change. Once every diff, added and deleted snapshot is accepted (or reported as a flake), the comparison is accepted too, unless render errors, new accessibility violations or pages that start to scroll sideways block it, which the response lists in acceptBlockedBy. When render errors block it, a diff or added snapshot that failed to render cannot be accepted. Returns the comparison's resulting status. Only on accounts where you have per-diff review: the new compare page, by the account or your own opt-in.

    sha1 stringrequired
    The "before" report SHA.
    sha2 stringrequired
    The "after" report SHA.
    beforeSnapshotId string
    The diff's before.id, or a deleted snapshot's id. Omit for an added snapshot.
    afterSnapshotId string
    The diff's after.id, or an added snapshot's id. Omit for a deleted snapshot.
    pairs array of object
    More to decide the same way in this call, each given like beforeSnapshotId and afterSnapshotId above: a row of get_comparison_details' reviewOrder with its sameAs targets and sameChange rows, which the comparison page decides with one verdict. All or none are recorded.
    project string
    Project name. Omit to infer the project from the sha1..sha2 pair; only needed when that pair exists in more than one project on the account.
  • Reject Diff

    reject_diff

    Reject one diff, added snapshot or deleted snapshot in a Happo comparison, or several with pairs: the change is unintended.

    Details and 7 arguments

    Rejecting any one of them rejects the whole comparison. Returns the comparison's resulting status. Pass note to say why, which reviewers see beside the diff. Only on accounts where you have per-diff review: the new compare page, by the account or your own opt-in.

    sha1 stringrequired
    The "before" report SHA.
    sha2 stringrequired
    The "after" report SHA.
    beforeSnapshotId string
    The diff's before.id, or a deleted snapshot's id. Omit for an added snapshot.
    afterSnapshotId string
    The diff's after.id, or an added snapshot's id. Omit for a deleted snapshot.
    pairs array of object
    More to decide the same way in this call, each given like beforeSnapshotId and afterSnapshotId above: a row of get_comparison_details' reviewOrder with its sameAs targets and sameChange rows, which the comparison page decides with one verdict. All or none are recorded.
    project string
    Project name. Omit to infer the project from the sha1..sha2 pair; only needed when that pair exists in more than one project on the account.
    note string
    Why it is rejected, in a sentence or two: what is wrong, for the people reviewing the comparison. Goes on every diff this call rejects.
  • Report Flake

    report_flake

    Mark a specific diff as a flake/spurious.

    Details and 5 arguments

    Pass the snapshot IDs from get_comparison_details (the before.id and after.id of a diff). This both ignores the diff and records a Flake row attributed to the connected user. On an account that only lets selected users review, the connected user has to be one of them.

    sha1 stringrequired
    The "before" report SHA.
    sha2 stringrequired
    The "after" report SHA.
    snapshot1Id stringrequired
    ID of the "before" snapshot (the diff's before.id).
    snapshot2Id stringrequired
    ID of the "after" snapshot (the diff's after.id).
    project string
    Project name. Omit to infer the project from the sha1..sha2 pair; only needed when that pair exists in more than one project on the account.
  • Accept Comparison

    accept_comparison

    Accept (mark as success) the Happo comparison between two reports.

    Its earlier name, approve_comparison, still works.

    Details and 3 arguments

    Use this to resolve a "needs review" comparison after you have inspected the diffs and decided the changes are intended. It accepts every diff, so when get_comparison_details came in pages, read them all first.

    sha1 stringrequired
    The "before" report SHA.
    sha2 stringrequired
    The "after" report SHA.
    project string
    Project name. Omit to infer the project from the sha1..sha2 pair; only needed when that pair exists in more than one project on the account.
  • Reject Comparison

    reject_comparison

    Reject (mark as failure) the Happo comparison between two reports.

    Details and 3 arguments

    Use this when the changes are unintended.

    sha1 stringrequired
    The "before" report SHA.
    sha2 stringrequired
    The "after" report SHA.
    project string
    Project name. Omit to infer the project from the sha1..sha2 pair; only needed when that pair exists in more than one project on the account.

Shared arguments

Every tool that takes arguments also takes these, so they're listed here once.

account integer
Numeric Happo account id. Optional when only one account is authorized for this connection. Required when multiple accounts are authorized — call get_accounts first to list them.

Permissions and revocation

When you authorize a client, you pick the Happo account the connection applies to. The assistant has your permissions on that account: it can read everything you can, and what it accepts or rejects is recorded against you.

Revoke a connection under Connected applications on your account's API tokens page.

Need help?