style-agent
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@style-agent check computed styles for the primary button against spec"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
style-agent
Portable style verification toolkit (Chrome CDP + JSON specs).
Works as a CLI, and optionally as an MCP server for any MCP client (Cursor, Claude Code, etc.). Not a Cursor-only plugin.
You: define acceptance + final review
Agent / you: find → inspect → fix CSS → re-check
Channel: Chrome DevTools Protocol (no browser extension required)Quick start (CLI)
git clone https://github.com/jtrslar/style-agent.git
cd style-agent
npm install
chmod +x launch-chrome.sh
# 1) Start debug Chrome (independent profile)
./launch-chrome.sh http://127.0.0.1:8080/your-page
# or: ./launch-chrome.sh then navigate manually
# 2) Probe CDP / run a demo spec (adapt selectors to your DOM)
node cli.mjs status
node cli.mjs inspect demo-modal-shell.jsonDemo specs under specs/examples/ use neutral class names (.demo-modal, …). Copy them into your app repo and edit selectors — do not treat examples as a product baseline.
Related MCP server: browser-devtools-mcp
Optional: MCP client
Register the server with your client. Cursor example:
See examples/mcp.cursor.json.example (replace the absolute path).
Optional Cursor rule sample: examples/cursor/style-agent.mdc.
Then refresh MCP in the client settings.
MCP tools
Tool | Purpose |
| CDP + open tabs |
| JSON spec check (failures only by default) |
| text / css / testid / role → uid |
| computed-style subtree |
| interact then measure |
| helpers |
| advanced page expressions |
No screenshots in the default path — structured JSON only.
Where specs live
Kind | Location |
Project specs | Your app repo, e.g. |
This repo | Format demos only |
Details: SPECS.md.
node cli.mjs inspect /absolute/path/to/your-app/style-specs/foo.json
# or
export STYLE_AGENT_SPECS_DIR="/absolute/path/to/your-app/style-specs"Layout
index.mjs MCP server entry (optional)
cli.mjs CLI
launch-chrome.sh debug Chrome on CDP
lib/cdp.js CDP connect
inject/page-runtime.js page-side find + inspect
SPECS.md project vs example specs
UPGRADE.md optional Pixelmatch roadmap
specs/examples/ neutral demos only
examples/ MCP / Cursor samplesEnvironment (optional)
Variable | Default | Meaning |
|
| CDP endpoint |
|
| Spec search dir (point at your app in real use) |
Upgrade path
UPGRADE.md: optional Pixelmatch gate + style-agent targeted fixes.
When style_status reports upgradeStatus=proposed, ask once whether to adopt it.
Notes
Log in / CAPTCHA in the debug Chrome window yourself when needed
Does not replace human visual taste checks; it provides structured diffs for fixing CSS
Available Tools
12 toolsstyle_clickB
点击 uid(开下拉/弹层)。也可传 selector 走 Playwright 真实点击。
Inputs: uid, index, scroll, timeout, +3 more.
style_dialogsC
列出 dialog / aria-modal。
Inputs: index, urlIncludes, titleIncludes.
style_evalA
页面内执行 JS 表达式(高级;优先其它工具)。
Inputs: expression (required), index, urlIncludes, titleIncludes.
style_findB
按文案/CSS/testid/role 查找元素,返回 uid(供 style_styles / style_click)。
Inputs: css, role, text, index, +4 more.
style_highlightB
高亮 uid(确认定位)。
Inputs: uid (required), index, urlIncludes, titleIncludes.
style_hoverC
悬停 uid(hover 才展开的菜单)。
Inputs: uid (required), index, scroll, urlIncludes, +1 more.
style_inspectA
按 JSON spec 跑样式/布局检查(setup+nodes+relations)。默认只返回失败项。有验收标准时优先用。
Inputs: spec, index, specJson, urlIncludes, +2 more.
style_spacingC
两 uid 元素间距。
Inputs: uidA (required), uidB (required), index, urlIncludes, +1 more.
style_statusA
检查 CDP 是否连通、列出标签。闭环开始时先调。
Inputs: no named parameters.
style_stylesA
读取模块 computed style 子树(uid 或 css)。探索/对稿时用;有 spec 优先 style_inspect。
Inputs: css, uid, depth, index, +3 more.
style_tabsB
列出调试 Chrome 中的页面标签。
Inputs: no named parameters.
style_waitC
等待元素出现(css/text/testId/role)。默认最多返回 3 条;优先用 css。
Inputs: css, role, text, index, +6 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Tools are mostly distinct with clear roles: find vs wait, click vs hover, styles vs inspect. However, style_status and style_tabs both list tabs, and style_styles vs style_inspect overlap in reading computed styles, creating minor confusion.
All tools share the 'style_' prefix and are lowercase snake_case, forming a recognizable pattern. Some use verbs (find, click, wait) while others use nouns (tabs, dialogs, styles), deviating from a strict verb_noun convention but remaining predictable.
With 12 tools, the set is well-scoped for a style/UI inspection purpose. Each tool covers a needed action without redundancy, fitting comfortably within the ideal 3-15 range.
The toolset covers the core lifecycle: health check, locating elements, reading styles, spacing, interactions, waiting, dialog listing, and spec-based inspection. Minor gaps such as missing screenshot or scroll capabilities are workarounds, but the surface is robust for style verification.
Maintenance
Related MCP Connectors
Read visual design reviews from live web pages: comments, CSS selectors, styles, console errors.
Hosted real Google Chrome MCP with per-user persistent state. Navigate, click, type, screenshot.
Automate cloud Chrome—navigate, click, type, screenshot, run code, record screen video
On-demand drift checks: declared CSS color, radius, spacing & type vs your own tokens or a pack
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI coding assistants to control and inspect a live Chrome browser for automation, debugging, performance analysis, network monitoring, and DOM interaction through Chrome DevTools Protocol.Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables reading browser DevTools data (tabs, console errors, network requests, screenshots, DOM, CSS, JS execution) via Chrome DevTools Protocol.MIT
- AlicenseNot gradedqualityCmaintenanceEnables CSS layout verification and debugging by extracting deterministic, diffable rendered layout from a browser, allowing agents to inspect, explain, and diff CSS changes.14 npm2MIT
- AlicenseAqualityDmaintenanceEnables AI to interact with Chrome DevTools Protocol to inspect and debug live web pages, including DOM, styles, console logs, and network requests.111MIT