Web Quality MCP
# Web Quality MCP
<img align="right" src="assets/logo.svg" alt="Terminal and monitor mark" width="80" height="80" />
**Engineering quality gate for frontend releases** — responsive layouts, bidirectional UI, and automated accessibility testing from one local MCP tool.
[Setup](#installation) · [Codex](#connect-to-codex) · [Tool reference](#tool-reference) · [Tests](#development-and-tests) · [Report an issue](https://github.com/ahmedsaeed1-eng/web-quality-mcp/issues)
[](https://github.com/ahmedsaeed1-eng/web-quality-mcp/actions/workflows/ci.yml?query=branch%3Amain+event%3Apush)

The report above visualizes a real disposable fixture audit: 8 completed viewport/direction cases, 12 layout findings and 8 accessibility violations from deliberately introduced defects. It is an illustration of JSON output, not a hosted dashboard or the result of auditing a production application. Findings repeat across cases.
## At a glance
| Check | Coverage |
| --- | --- |
| Responsive design | Four default widths: mobile, tablet, laptop and desktop |
| Direction | LTR and RTL, tested with isolated browser contexts |
| Layout | Horizontal overflow and likely text clipping |
| Accessibility | Automated axe-core rule results |
| Output | Structured JSON with per-case and aggregate results |
## What it checks
- Responsive viewport matrix: 360, 768, 1024, and 1440 CSS pixels by default.
- LTR and RTL directions, in fresh browser contexts for each combination.
- Document and element horizontal overflow.
- Likely clipped text in fixed-size or hidden-overflow containers.
- axe-core automated accessibility findings with rule ID, impact, affected
nodes, selectors, and upstream guidance.
- Machine-readable JSON and a summary across all attempted viewports.
No crawling, form submission, remote site automation, or security testing.
## Installation
Requires Node.js 20+ and a Chromium browser. The Linux build and integration tests were verified for version 0.1.0. Windows setup instructions are provided; Windows test results are not yet verified.
Clone and build:
```bash
git clone https://github.com/ahmedsaeed1-eng/web-quality-mcp.git
cd web-quality-mcp
npm ci
npx playwright install chromium
npm run build
```
Playwright may require additional OS libraries on Linux. Install those using
the official Playwright installation instructions on a machine you maintain.
## Connect to Codex
Register the locally built executable with the [Codex MCP configuration](https://developers.openai.com/codex/mcp):
```bash
codex mcp add web-quality -- node /absolute/path/to/web-quality-mcp/dist/server.js
```
Alternatively, add the following to your Codex user configuration:
```toml
[mcp_servers.web-quality]
command = "node"
args = ["/absolute/path/to/web-quality-mcp/dist/server.js"]
```
On Windows use the absolute path to your checked-out project's
`dist/server.js` file with forward slashes or escaped backslashes in TOML.
Restart/reload your MCP client as necessary and start your frontend dev server.
Example prompt:
> Run the web-quality local UI audit against http://localhost:3000/ at four
> viewport widths in RTL and LTR. Explain failures and propose corrections.
## Tool reference
`audit_local_ui` accepts the following arguments:
```json
{
"url": "http://localhost:3000/",
"widths": [360, 768, 1024, 1440],
"directions": ["ltr", "rtl"],
"height": 900
}
```
Only `url` is required. Custom widths must be integers between 240 and 1920
(up to four); height must be 320–1440. Directions can include one or both
of `ltr` and `rtl`. A successful invocation returns a structured JSON report
with `schemaVersion`, `cases`, `summary`, and explanatory `notes`.
Each case provides its viewport, direction, status, blocked request count,
layout findings, and accessibility violations. Incomplete cases and
accessibility failures are explicitly marked. Rule and selector lists are
capped to help keep agent context manageable.
### Actual fixture report
```json
{
"schemaVersion": 1,
"summary": {
"tested": 8,
"failed": 0,
"layoutFindings": 12,
"accessibilityViolations": 8
}
}
```
## Intended scope and limitations
Use this with your own development server and disposable test data.
Only literal HTTP(S) loopback addresses `localhost`, `127.0.0.1`, and `[::1]`
are accepted; URLs with credentials are rejected. The fresh headless browser
allows only same-origin GET/HEAD page requests and blocks redirects,
cross-origin requests, WebSockets, and mutating methods. Network-dependent
fonts, scripts, authentication, and separate-origin APIs may not render as
expected. This is intentionally a narrow UI QA workflow, not a security sandbox.
Forcing the document direction is useful for layout checks, but is not a
translation or internationalization completeness test. Element overflow and
clipping checks are heuristics and may flag intentional scrolling or
truncation. Automated accessibility results are not a full WCAG certification;
manual keyboard, assistive-technology, and visual review remain essential.
The tool does not return page text or full DOM HTML. Selectors can contain
page-specific identifiers, so review reports before sharing them. No report
files are automatically written and no logs or telemetry are sent by the tool.
The browser and local page run in your environment.
## Development and tests
```bash
npm ci
npx playwright install chromium
npm test
```
Tests use disposable localhost HTML fixtures and invoke the real MCP tool over
stdio with the official SDK client. They cover bad and clean layouts, both
directions, multiple viewports, a missing image alternative, and blocked
cross-origin/mutating requests. Set `WQM_CHROMIUM_EXECUTABLE` if you explicitly
need to use a locally installed compatible Chromium executable.
## License and credit
Original project code is MIT licensed. This project uses Playwright, axe-core,
MCP SDK, and Zod under their respective licenses; see
[THIRD_PARTY.md](THIRD_PARTY.md). Upstream projects are independent of this
repository and do not endorse it.
TDQS
Scored across 1 tool
There is only one tool, so there is no possibility of misselection or overlap with a sibling tool. Its purpose—auditing a developer-owned local page for overflow, clipping, and accessibility issues—is stated clearly and bounds what it does not do.
The single name audit_local_ui follows a readable verb_noun_resource snake_case convention. With only one tool there is no pattern to verify against, so consistency is satisfied only trivially rather than demonstrated.
One tool is very thin for a server whose stated scope is broad 'Web Quality'. A single constrained audit cannot reasonably represent the full surface implied by the server name and offers no alternate entry points.
Coverage is limited to local page overflow, clipping, and automated a11y checks in LTR/RTL, with no remote URL auditing, crawling, interaction, performance, SEO, or reporting operations. For a quality-audit domain this leaves significant gaps that would force an agent to abandon the server for most tasks.