stylespeak
v1.2.0MCP server and CLI that makes CSS legible to AI agents — explains what applies and why.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
resolve_styles
Resolves what CSS actually applies to a given selector. Returns every property the selector would receive, which rule wins for each property, and which rules were overridden — with confidence levels (certain/likely/possible) since no real DOM is available. Call this before modifying styles for an element to understand the full cascade context first.
| Parameter | Type | Description |
|---|---|---|
selector * | string | CSS selector to resolve, e.g. ".btn.primary", "#header a:hover" |
componentFiles | array | Optional: absolute paths to JSX/TSX files. When provided, builds an AST component graph to upgrade selector confidence from possible to likely where ancestry is confirmed. |
files | array | Absolute paths to CSS/SCSS files to analyze. |
projectRoot | string | Optional: path to a project root. All CSS/SCSS files will be discovered recursively. |
trace_property
Traces a CSS property across all provided files — finding every rule that sets it, grouping competing rules that target overlapping selectors, and showing who wins in each group. Use this to understand the blast radius of a property before changing it, or to find out why a property value isn't applying as expected.
| Parameter | Type | Description |
|---|---|---|
property * | string | CSS property name to trace, e.g. "color", "background-color", "padding" |
files | array | Absolute paths to CSS/SCSS files to analyze. |
projectRoot | string | Optional: path to a project root. All CSS/SCSS files will be discovered recursively. |
live_resolve
Resolves CSS for a selector by querying a live running browser via Chrome DevTools Protocol (CDP). Returns exact computed styles and every matched rule in cascade order — no static analysis, no heuristics, confidence is always exact. Requires Chrome or any Chromium browser (Edge, Brave, Arc) running with --remote-debugging-port=9222. Use this when you need ground truth. Fall back to resolve_styles when no browser is running.
| Parameter | Type | Description |
|---|---|---|
selector * | string | CSS selector to resolve against the live DOM, e.g. ".btn.primary", "#header a" |
port | number | CDP port (default: 9222). Change if you started Chrome with a different port. |
tabUrl | string | Optional URL substring to target a specific tab. If omitted, uses the first available tab. |
impact_preview
Predicts the blast radius of a proposed CSS change before it is made. Given a selector, property, and optional new value, returns every competing rule in the codebase that would be affected — showing which selectors will see a different value, which are shielded by higher specificity, which cascade relationships are uncertain, and which downstream rules are affected through CSS variable chains or inheritance. Works without a browser. Use this before making any CSS change to understand the full impact.
| Parameter | Type | Description |
|---|---|---|
property * | string | The CSS property you are about to change, e.g. "background-color", "--color-primary" |
selector * | string | The CSS selector you are about to change, e.g. ".btn", ":root" |
files | array | Absolute paths to CSS/SCSS files to analyze. |
newValue | string | Optional: the new value you plan to set. Enables before/after comparison in variable chain impacts. |
projectRoot | string | Optional: path to a project root. All CSS/SCSS files will be discovered recursively. |
style_manifest
Builds a compressed, structured summary of a project's entire CSS knowledge — selectors, properties, variables, competition groups, and risk hotspots — that an agent can load ONCE at the start of a session and keep in context. Use this at the beginning of any CSS editing task to understand the landscape before querying individual selectors. Much faster than running resolve_styles on every selector. Follow up with resolve_styles, trace_property, or impact_preview for deep analysis of specific selectors surfaced in the manifest.
| Parameter | Type | Description |
|---|---|---|
files | array | Absolute paths to CSS/SCSS files to analyze. |
maxSelectors | number | Maximum selectors to include (default: 200). Hotspot selectors are prioritised when truncating. |
projectRoot | string | Path to project root. All CSS/SCSS files discovered recursively. |