dslens
Connects to a running Storybook instance (storybookUrl, default http://localhost:6006) and, using Playwright, screenshots each flagged component from its story during run_full_audit; for accessibility issues it draws a highlight around the offending element, and it skips the screenshot step (noting so in the result) when Storybook isn't running.
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., "@dslens run a full audit on ./src and screenshot anything flagged in Storybook"
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.
dslens
An MCP server that audits a React design system for the bugs that make a component library unpredictable to build on: state that silently duplicates a prop, colors and spacing that bypass your design tokens, and the handful of accessibility gaps that are both common and mechanically detectable.
I built this after repeatedly running into the same shape of bug in production analytics and design system work: the same kind of mistake, copying a value into local state, or reaching for a raw hex color instead of a token, shows up over and over across a codebase, in places a human reviewer eventually stops catching. A tool that reads the whole codebase every time doesn't get tired of looking.
It's exposed as an MCP server, so Claude (or any other MCP client) can point it at a repo and ask for a report, rather than you running a CLI and pasting the output back in.
What it catches
Props copied into state. The classic useState(props.value) bug: a
component takes a snapshot of a prop on mount, and silently stops
reflecting that prop if the parent ever updates it. This is flagged
specifically, not every useState call, so it stays useful instead of noisy.
Hardcoded design tokens. A literal hex color or a bare 12px, sitting
in an inline style={{...}} object or a styled-components template, where
a theme value or a CSS custom property should be. It skips anything that
already references ${...} or var(--...).
Accessibility gaps, three specific, mechanically checkable ones:
an <img> with no alt, an <input> with no accessible name and nothing
for a <label> to target, and a clickable element (a <button>, or
anything with an onClick) with no visible text and no aria-label,
usually an icon button nobody labeled.
Each of these was chosen because it's a specific, defensible claim, not a vague "this looks off." A static checker that flags everything it's unsure about stops being useful quickly.
Related MCP server: polish
Screenshots of the actual issue
If the project you're auditing has Storybook
running, run_full_audit can screenshot each flagged component directly
from its story, and for the accessibility checks, draw a highlight around
the specific element that's the problem, so the report shows the issue,
not just a file and line number.
This needs Storybook actually running (storybookUrl, default
http://localhost:6006) and a story whose title ends in the component's
name. Without Storybook, run_full_audit still runs every check, it just
skips the screenshot step and says so in the result.
Screenshots use Playwright, which needs its browser installed once:
npx playwright install chromiumInstalling
npm install
npm run buildUsing it as an MCP server
Add it to your MCP client's config (for Claude Desktop,
claude_desktop_config.json):
{
"mcpServers": {
"dslens": {
"command": "node",
"args": ["/absolute/path/to/dslens/dist/index.js"]
}
}
}Tools it exposes
Tool | What it does |
| Lists every |
| Just the hardcoded-token check |
| Just the props-copied-into-state check |
| Just the three accessibility checks |
| Everything above, optional screenshots, writes a Markdown report to |
Trying it without a real codebase
fixtures/Panel.tsx is a small file with one of every issue dslens
catches, used to sanity-check the checks themselves. Point run_full_audit
at the fixtures/ folder to see what a report looks like.
Full example with Storybook screenshots
storybook-demo/ is a small standalone React + Storybook project with eight
components, one for each check dslens runs (and one clean control with no
issues, to confirm it doesn't false-positive). See
storybook-demo/README.md for how to run it and
get a report with real screenshots of each flagged element.
What this deliberately doesn't do (yet)
Vue and Svelte aren't supported. The checks are JSX-specific; a Vue SFC needs a different parser (
@vue/compiler-sfc), which is a real project on its own, not a quick addition.The token check is a heuristic over inline styles and styled-components templates, not a full CSS parser. Tailwind arbitrary values (
bg-[#fff123]) aren't covered yet.The props-to-state check only catches the direct
useState(props.x)/useState(x)shape, not every indirect way a component can end up shadowing a prop.
License
MIT
Available Tools
5 toolsaudit_accessibilityAudit accessibility gapsC
Flags with no alt, with no accessible name, and icon-only clickable elements with no accessible name.
Inputs: rootDir (required).
audit_props_to_stateAudit props copied into stateB
Flags useState(props.x) style initializers, the classic bug where a component's local state silently goes stale when its parent's prop changes.
Inputs: rootDir (required).
audit_tokensAudit hardcoded design tokensC
Flags hardcoded colors and raw pixel spacing in inline styles and styled-components templates, instead of design tokens.
Inputs: rootDir (required).
run_full_auditRun the full dslens auditA
Runs every check, optionally screenshots each issue against a running Storybook instance, and writes a Markdown report.
Inputs: rootDir (required), screenshots, storybookUrl.
scan_componentsScan for component filesA
Lists every .tsx/.jsx file dslens will consider a component, under the given directory.
Inputs: rootDir (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool maps to a distinct action+scope: one discovery tool (scan_components), three narrowly-named rule-specific auditors, and one orchestrator. run_full_audit intentionally subsumes the audit_* tools, but its description makes that relationship explicit, so misselection risk is low.
Names follow a clear verb_noun convention (scan_components, audit_tokens, audit_props_to_state, audit_accessibility) with a consistent audit_ prefix for the check family. run_full_audit deviates slightly with a verb+qualifier+noun shape, but remains readable and predictable.
Five tools is well-scoped for a component-auditing server: discovery, three discrete checks, and an aggregate runner. Every tool earns its place with no redundancy or filler.
The surface covers discovery, individual rule checks, and a report-generating full run, which is a complete workflow for this domain. Minor gaps: no tool to scope an audit to a single file, no machine-readable/JSON output option, and no way to list or configure which rules exist.
Maintenance
Related MCP Connectors
Statically audits MCP tool surfaces for token cost, schema quality, and design issues.
On-demand drift checks: declared CSS color, radius, spacing & type vs your own tokens or a pack
Playwright selector risk checks with healing suggestions and receipts.
Run accessibility, contrast, and design token audits and file QA issues from your AI coding tool.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides Figma integration, accessibility auditing, and React code generation tools.8MIT
- AlicenseNot gradedqualityCmaintenanceSelf-hosted design audit MCP server that reviews UI code against Nielsen's heuristics and an accessibility rubric, returning scores and fixable findings. It also enables verifying previously flagged issues against updated code.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables coding agents and CI to verify rendered web UIs against design token usage, layout constraints, and accessibility rules, returning concise pass/fail verdicts with actionable findings.12 npmMIT
- AlicenseAqualityCmaintenanceEnables MCP clients to open websites, capture screenshots at multiple breakpoints, and run automated design audits for issues like overflow, small tap targets, low contrast, missing alt text, tiny text, and clipped content.91MIT