Skip to content
Hacker News · AI·· 8 h agoAI score52

Connecting Chrome DevTools MCP to Codex to debug CSS with get_css_styles

Giving AI Agents a Better Way to Debug CSS

AI summary

The article shows how to connect Chrome DevTools MCP to Codex by adding a custom STDIO server that runs npx -y chrome-devtools-mcp@latest, then use its get_css_styles tool to inspect the CSS actually applied to an element. In the worked example, the agent uses take_snapshot to locate the heading and get_css_styles to see matched rules, inherited and inline styles, custom properties and overridden declarations, identifying that #main .card h2 outranks .card h2 on specificity. The author also used it to audit a navigation component for redundant declarations, duplicate rules, unnecessary specificity, conflicting cascade layers and repeated !important, and cautions that findings still need review in the browser.

Source:Hacker News · AI · amitmerchant.com