Skip to main content
Glama

visual-audit-mcp

MCP server que enumera condições visuais suspeitas em páginas HTML/CSS/JS/TS/React e entrega tudo ao modelo. Ele nunca decide o que é bug.

Invariante do projeto: o servidor faz redução mecânica (deduplicar, agrupar, ordenar, descartar o que não reproduz). O modelo faz julgamento semântico (isso é intencional?). Nenhum dos dois invade o terreno do outro.

Por que existe

Bugs visuais que aparecem só depois de algumas sessões têm sempre a mesma causa: ninguém olhou. Texto que sumiu porque ficou igual ao fundo, container que corta o próprio conteúdo, controle que outro elemento cobre, layout que só quebra em 767px. Um humano encontra isso abrindo o DevTools em cinco larguras diferentes; o modelo nunca faria isso sozinho.

Este servidor faz esse trabalho e devolve tudo — inclusive coisas que provavelmente estão certas — com evidência numérica e uma pergunta. A pergunta é o produto: é o que força a revisão imediata.

Related MCP server: visual-qa-mcp

O que ele não é

  • Não é um browser MCP. Não expõe navigate, click ou screenshot genérico.

  • Não é um runner de teste visual com baseline (Percy/Chromatic/BackstopJS). Não precisa de "aprovado".

  • Não é um linter de acessibilidade. axe-core já existe e é melhor nisso.

Instalação

npm i -g visual-audit-mcp
npx visual-audit-mcp --doctor        # browser, config, rede
npx visual-audit-mcp --init          # configura OpenCode, Claude Code, Cursor, Codex, VS Code

Detalhes — browsers, escopo, config, código-fonte — em docs/install.md.

Primeiro uso

npx visual-audit-mcp --audit http://localhost:5173/

Devolve um índice ranqueado, sem imagens. Cada item é uma medição com uma pergunta:

{{
  "page": {{ "elements": 459, "textLength": 2417, "rendered": true }},
  "stats": {{ "unstable": 0, "truncated": 0 }},
  "findings": [
    {{
      "id": "f_1c354349",
      "rule": "low-contrast",
      "severity": "major",
      "reproduced": "2/2",
      "element": {{ "selector": "#hero .badge", "component": "StatusBadge" }},
      "evidence": {{ "color": "rgb(255,255,255)", "background": "rgba(219,157,0,1)", "ratio": 2.38 }},
      "question": "Contraste 2.38:1 (WCAG pede 4.5:1). É uma escolha de marca ou uma regressão de estilo?"
    }}
  ]
}}

Uma coisa a ter em mente desde o começo: lista vazia não significa UI limpa. Se a página não renderizou, page.rendered vem false e há um sinal page-not-rendered dizendo isso.

Tools

Tool

Para quê

visual_audit

Renderiza a URL na matriz de viewports e devolve o índice ranqueado de findings. Sem imagens.

visual_describe

Expande findings: evidência completa + crop PNG justo do elemento. É onde se gasta token.

visual_inspect

O "porquê": computed styles, box, cadeia de ancestrais e toda regra CSS que casa, com origem arquivo:linha. Não decide qual regra vence.

visual_compare

Renderiza em dois engines (default chromium vs webkit) e reporta divergência de layout por elemento + findings que só existem em um deles. A mais cara: roda a auditoria duas vezes.

visual_crawl

Descobre as rotas do próprio site (links, same-site, profundidade limitada), audita todas e agrega defeitos entre rotas. dryRun:true lista as rotas sem auditar.

visual_apply

Testa uma hipótese de fix no browser (declarações CSS) e re-mede: o finding sumiu? criou outro? Não escreve em disco.

visual_recheck

Depois de corrigir: re-audita só aquelas viewports/regras e diz resolved / present / moved.

visual_suppress

Devolve o data-visual-ok exato para colar (com why= e until=). write:true também grava no sidecar.

visual_suppressions

list / lint / prune. O contrapeso: supressão apodrece e podridão esconde regressão.

visual_doctor

Verifica browser, config, URL, sidecar e — com artifactsDir — se sobrou atributo no build.

Escopo da 1.x

Prometido

  • 10 tools, 16 regras, 3 condições de renderização, 3 engines.

  • Determinismo: unstable: 0 nas fixtures, e duas execuções iguais devolvem ids idênticos.

  • Findings são observações; nenhuma regra declara sozinha que algo é bug.

  • Supressão nunca chega em produção: plugin Babel remove, guard de build falha, e há teste para os dois.

  • Crawl agrega defeitos entre rotas; compare separa divergência de layout do ruído de engine.

  • Página que não renderizou nunca é reportada como limpa (page-not-rendered).

Fora de escopo (fica para 1.1+)

  • Oclusão por overlay fixo verificada com scroll (hoje é info, não critical).

  • Firefox sem CDP: funciona, mas sem arquivo:linha e sem leitura de stylesheet cross-origin.

  • Crawl de SPA por pushState sem <a href> — use routes.

  • Baseline temporal (diff da mesma engine ao longo do tempo).

  • visual_apply que vence !important (hoje avisa que a declaração não teve efeito).

Limitações conhecidas

  • Cross-engine suporta dois engines por vez (Chromium, WebKit, Firefox).

  • O crawl segue links, não um router. SPAs que só trocam estado por history.pushState sem <a href> não são descobertas — passe routes explicitamente nesse caso.

  • No WebKit/Firefox a atribuição de cascata não tem arquivo:linha (sem CDP).

  • Uma rota por chamada. Sem crawl, sem interação automática.

  • Contraste sobre gradiente/imagem é estimado — o finding fica com confidence baixa e um aviso.

  • _debugSource do React só existe em build de desenvolvimento.

  • Modo attach (CDP) não garante determinismo: o preset é best-effort.

  • Sem scroll virtual, iframes ou shadow DOM fechado.

Mais detalhe e roadmap em docs/architecture.md.

Documentação

Documento

Conteúdo

docs/install.md

browsers, harness, config, CLI, skill do agente

docs/rules.md

as 16 regras, as condições, como ler a evidência

docs/workflows.md

ciclo audit → describe → inspect → apply → recheck, e o crawl

docs/cross-engine.md

Chromium vs WebKit e classificação de divergência

docs/suppression.md

supressões, lint, e por que nunca chegam em produção

docs/publishing.md

os dois registries, Trusted Publishing, secrets

docs/architecture.md

pipeline, determinismo, módulos, limites

docs/FIELD-TEST.md

protocolo para testar num projeto real

docs/FIELD-NOTES.md

o que o uso real ensinou sobre a ferramenta

skills/visual-audit/SKILL.md

o que o agente carrega antes de usar

CONTRIBUTING.md

como adicionar ou corrigir uma regra

CHANGELOG.md

histórico

Licença

MIT — ver LICENSE.

Available Tools

10 tools
visual_applyTry a CSS fix on the live page before editing filesA

Takes a hypothesis as CSS declarations, applies them to the element(s) in a throwaway page, and re-measures at the same viewports and condition where the finding was observed. Reports whether the target observation disappeared AND whether new observations appeared elsewhere (collateral). It also captures the computed value before and after each declaration: an inline style can lose to an !important rule, and a patch that applies but changes nothing would otherwise look like a fix. Nothing is written to disk — this validates the hypothesis, then you edit the real file.

Inputs: patches (required), mode, sessionId, findingIds.

visual_auditAudit a page for suspicious visual conditionsA

Renders a URL at a matrix of viewports derived from the project's own CSS breakpoints and returns a ranked index of EVERYTHING that looked suspicious: invisible text, clipping, overlaps, occlusion, overflow, off-screen elements, contrast, zero-size content. It does not decide what is a bug — each finding carries a question for you to answer. Returns no images (use visual_describe for those). Reserved health: fast=1 pass and no info-level rules; deep=multiple passes, info-level rules, more viewports.

Inputs: url (required), mode, rules, engine, +3 more.

visual_compareCompare rendering between two enginesA

Renders the same page in two engines (default chromium vs webkit) and reports where they differ. Two kinds of evidence: layout divergence per element (size, line count, position) and findings that exist in only one engine. Native controls and monospace metrics are counted but not listed unless you pass includeNoise:true — they differ in every engine and are not actionable. Divergences are classified so you are not buried in consequences: "root" = the element whose size or wrapping changed with no changed descendant (the likely cause), "propagated" = changed because a descendant changed, "shifted" = position only, mostly the vertical cascade (summarised, not listed), "missing" = present in one engine only. This is the most expensive tool: it runs a full audit twice.

Inputs: url (required), mode, rules, target, +5 more.

visual_crawlDiscover the app's routes and audit all of themA

Same-site crawl: follows links from the start URL (bounded depth and count), audits every route, and aggregates defects ACROSS routes — one root cause with a route count instead of N duplicates. Use dryRun:true first to see which routes it would visit without paying for any audit. For a single page use visual_audit; this is the whole-app sweep. Each route gets its own sessionId, so visual_describe still works per page. Cost is roughly routes x a single audit, so it is capped harder (3 viewports, 15 findings per route).

Inputs: url (required), mode, dryRun, engine, +7 more.

visual_describeGet detail and a screenshot crop for specific findingsA

Expands findings from a visual_audit session: full evidence, the question to answer, and a tight PNG crop around the element at the viewport it was measured in. This is where tokens are spent, so ask for the ids that matter. Omit ids to get the top-ranked ones.

Inputs: maxImages, sessionId, findingIds.

visual_doctorCheck the environment and the production guardA

Verifies the browser, the config, the target URL, the suppression store, and — when you pass artifactsDir — scans a build output for leftover data-visual-ok / data-visual-expect attributes. Use artifactsDir:'dist' before shipping to prove the strip plugin actually ran.

Inputs: url, artifactsDir.

visual_inspectExplain why an element renders the way it doesA

The companion to visual_audit: audit answers WHAT looked wrong, this answers WHY. Returns the computed styles, the box metrics, the ancestor colour chain, and every CSS rule that matches the selector with its origin (file:line in the project). It does not resolve which rule wins — specificity, order and !important are left for you to judge from the evidence.

Inputs: url (required), selector (required), engine, viewport, +1 more.

visual_recheckRe-verify specific findings after a fixA

Re-audits only the viewports and rules involved in the given findings and reports, per finding: resolved, still present with the same geometry, or still present but moved. Use this instead of a full audit after editing styles, so the rest of the report stays stable.

Inputs: findingIds (required), sessionId.

visual_suppressMark a finding as expected or ignoredA

Produces the exact code you can paste to stop this observation from coming back: a data-visual-ok attribute (ignored entirely) or data-visual-expect (still reported, downgraded to info). Both carry why= and until= so the suppression is reviewable and expires. Attributes are stripped in production builds by the shipped plugins. Set write=true to also append a sidecar entry for markup you cannot annotate.

Inputs: why (required), findingId (required), mode, until, +2 more.

visual_suppressionsInspect, lint or prune suppressionsA

The counterweight to suppression: suppressions rot and rot hides regressions. list shows the committed sidecar; lint flags expired entries, missing reasons, global entries, and findings that are suppressed on every run (a root cause being ignored forever); prune removes expired entries.

Inputs: action.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool occupies a distinct stage of the audit workflow (audit → describe/inspect → apply → recheck → compare/crawl), and the descriptions explicitly pre-empt the likely confusions, e.g. 'audit answers WHAT looked wrong, this answers WHY' for visual_inspect and 'use this instead of a full audit' for visual_recheck. The visual_suppress / visual_suppressions pair is the only near-overlap, and their descriptions sharply separate generating suppression code from managing the sidecar store.

    Naming Consistency4/5

    All ten tools share a predictable `visual_` prefix with snake_case names, which makes the set easy to scan and group. The only deviation from a strict verb pattern is the plural noun `visual_suppressions` (store management vs. `visual_suppress` code generation), which is semantically justified but breaks the otherwise uniform verb convention.

    Tool Count5/5

    Ten tools sit squarely in the ideal range, and each one covers a distinct, non-redundant capability rather than a variant of another. Nothing feels like padding — even the narrower tools (visual_doctor, visual_crawl) serve clear, documented roles.

    Completeness4/5

    The detect → diagnose → hypothesize → verify → suppress → lint lifecycle is unusually well covered, including environment validation and multi-route sweeps. Minor gaps remain: there is no tool to list or reopen prior audit sessions/reports (ids are required but sessions appear ephemeral), and no explicit baseline/historical regression diff beyond per-finding recheck.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables AI coding agents to see, measure, and verify web pages through a real Chrome browser, including screenshots, responsive layout and accessibility audits, pixel diffing against baselines, secure logins, and deployed-fix verification.
      27
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI coding agents to audit rendered web pages for design and UI defects by measuring geometry, styles, contrast and motion in a local browser and judging them against evidence-tiered rules. Findings come back as short, fixable items expressed in the project's own design tokens, while only sanitized numeric measurements leave the machine.
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Enables coding agents to examine a rendered web page by cross-checking what the browser reports about the DOM/CSS against what is actually painted in pixels, pinpointing which element is broken and the evidence why. Reports visual problems without requiring a baseline, and is designed to grow into design-token extraction and accessibility/UX audits built on Playwright.
      1
      1
      MIT