Stylespeak logo

Stylespeak

Analyzes CSS cascade, variables, and change impact for AI agents through MCP tools and a Node.js CLI.

Install Stylespeak

Run the project’s own setup commands, in order.

Setup steps from the project

stylespeak installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    npm install -g @patrizzos/stylespeak
    

Overview

The stylespeak MCP server analyzes CSS files to explain cascade outcomes, property conflicts, variable resolution, and likely change effects. It provides MCP tools for resolving styles, tracing properties, previewing impact, generating project manifests, and checking browser-computed styles through Chromium CDP. File-based analysis uses heuristic confidence levels because it has no DOM, while live browser inspection returns exact computed results. Reach for it when an AI coding agent needs CSS context before editing styles.

Use cases

  • Resolve the winning CSS rule for a selector
  • Trace every declaration of a property across project files
  • Preview selectors affected by a CSS change
  • Build a compact CSS manifest for an agent session
  • Inspect exact computed styles in Chromium

Key features

  • Cascade and specificity analysis
  • CSS custom-property resolution
  • Change-impact prediction
  • Project-wide style manifests
  • Chromium CDP inspection
  • CSS, SCSS, and CSS Modules support

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

17/19 checks healthy over the last 111d

How Stylespeak works

What stylespeak MCP server does

The stylespeak MCP server gives coding agents a structured way to inspect CSS before changing it. It can determine which declaration wins for a selector, identify overridden rules, follow custom-property chains, and estimate which selectors may change after an edit. The same functionality is available through an MCP server and a command-line interface.

Analysis can cover regular CSS, SCSS with nesting, CSS Modules, and compiled output from vanilla-extract, Linaria, or StyleX. Styled-components, Emotion, and CSS-in-JS object syntax are not supported.

How it works

The server reads the supplied files and builds an in-memory representation of selectors, declarations, specificity, variables, and cascade relationships. Its file-based matcher uses confidence levels rather than claiming browser certainty: exact matches are certain, subset matches are likely, and combinator-based relationships are possible because the DOM is unavailable.

CSS custom properties are resolved in the returned data. Results can include the original value, the resolved value, the variable chain, and alternate values from media contexts. Chained variables, fallbacks, nested fallbacks, scoped variables, and circular-reference protection are supported.

For browser-backed inspection, live_resolve connects to Chromium through the Chrome DevTools Protocol. It reports computed styles and matched rules from the running browser, using the browser's resolution rather than the file-analysis heuristics. Chromium must be started with remote debugging enabled, such as --remote-debugging-port=9222; that port should not be exposed to untrusted networks.

Setup and configuration

Install the CLI globally with npm:

Terminal
npm install -g @patrizzos/stylespeak

The project requires Node.js 21 or newer and has no external dependencies. To run the MCP server, add a stdio entry to the client configuration. Cursor uses .cursor/mcp.json, while VS Code uses .vscode/mcp.json:

config.json
{
  "mcpServers": {
    "stylespeak": {
      "command": "node",
      "args": ["/absolute/path/to/stylespeak/src/server.js"]
    }
  }
}

CLI examples include stylespeak resolve ".btn.primary" src/styles/main.css, stylespeak trace "color" --projectRoot src/styles, stylespeak impact ".btn" "background-color" src/styles/main.css --newValue "#ff0000", and stylespeak manifest --projectRoot src/styles.

Tools and capabilities

The stylespeak MCP server exposes five tools:

  • resolve_styles calculates the properties received by a selector, identifies the winning rule, lists overridden rules, and reports confidence.
  • trace_property finds declarations for a property, groups competing selectors, and shows their cascade chains.
  • impact_preview estimates value changes, shielded selectors, cascade uncertainty, inheritance effects, and downstream variable impacts before an edit.
  • style_manifest creates a compact project-level summary of selectors, properties, variables, competition groups, and risk hotspots.
  • live_resolve retrieves browser-computed styles and matched rules for a selector.

Tool inputs can include selectors, properties, file lists, project roots, optional component files, maximum selector counts, new values, browser ports, and tab URLs as applicable.

Limitations and notes

File-based results are predictions when DOM structure or rendering context affects selector matching. Use live_resolve when exact browser computation is required. The live tool needs an accessible Chromium debugging endpoint and should be used only on a trusted local machine.

The project is intended for CSS explanation and pre-edit analysis. It can be paired with stylesafe, which checks CSS problems after edits, but stylesafe is a separate package and is not required by the documented zero-dependency setup.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Stylespeak

stylespeak is an MCP server that connects AI coding agents to CSS files and, through Chrome DevTools Protocol, a running Chromium browser. Its main tools resolve styles, trace properties, preview change impact, build style manifests, and inspect browser-computed styles. It also provides the same core analysis through a Node.js CLI.

Install it from the repository with Node.js 21 or newer, then configure a stdio MCP entry that runs `node` against `src/server.js`. The CLI can be installed globally with `npm install -g @patrizzos/stylespeak`.

Yes, stylespeak works with Cursor through its MCP configuration. Add the server command and absolute `src/server.js` path to `.cursor/mcp.json`, then connect the client to call the documented tools.

Yes, stylespeak resolves custom properties including chained variables, fallbacks, nested fallbacks, scoped values, and media-context overrides. Results can include the raw value, resolved value, and variable chain.

Yes, the `live_resolve` tool queries Chromium through CDP and returns computed styles and matched rules. Chromium must be launched with remote debugging enabled, such as port 9222.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewStylespeak AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/stylespeak?style=directory)](https://allmcps.com/mcp/stylespeak)
HTML Embed
<a href="https://allmcps.com/mcp/stylespeak"><img src="https://allmcps.com/api/badge/stylespeak?style=directory" alt="Stylespeak on AllMCPs" /></a>