
Cssprobe Cli
io.github.mack-peng由 GitHub 账号 mack-peng 发布v0.3.0更新于 Oct 24, 2026
Runtime CSS probe — inspect layout, overflow, scroll chains in a real browser. For AI agents.
概览
本地 MCP 服务器,启动真实 Chromium 浏览器,让助手检查实际渲染的 CSS 布局、溢出与滚动行为。
- 可以做什么
- 打开、关闭和查看浏览器会话状态,支持有头模式、自定义视口和已保存的登录状态
- 检查选择器的计算样式与声明样式、DOM 树、ASCII 布局图和带置信度的诊断结论
- 在页面中执行 JavaScript、注入 CSS、调整视口大小并截图
- 点击、悬停、输入文本,以及等待选择器、JS 条件或网络空闲
- 运行多步骤流程脚本和 JSON 回归套件,带断言与产物输出
- 适用场景
- 适合需要排查只在运行时才出现的 CSS 问题:元素为何溢出、实际渲染布局如何、容器是否可滚动,而不是仅凭源码猜测。也适合在样式改动后验证页面,或做可重复的浏览器回归检查。
- 运行要求
- 以本地 npm 包 cssprobe-cli 运行,通过 mcp 子命令启动;需要 Node.js 以及 Playwright 管理的 Chromium 浏览器。仅支持桌面端,覆盖 macOS、Linux、Windows 的 x64 与 arm64。未声明需要账号、API 密钥或环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 Cssprobe Cli,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
cssprobe-cli
Runtime CSS probe — inspect layout, scroll, colors, backgrounds, fonts and more in a live browser. Built for both humans and AI agents.
[License: MIT] [Node.js] [npm version] [npm downloads] [GitHub stars]
Static + runtime CSS diagnosis for AI agents — pair with cssgraph (the CSS knowledge graph) for the full picture.
Why cssprobe-cli?
When an AI agent needs to debug CSS — why is this element overflowing, what's the actual rendered layout, is this container scrollable — it can't see the browser. It guesses from static code, missing runtime-only issues like overflow, scroll chains, and containing block hijacks.
cssprobe-cli gives the agent eyes. It opens a real browser, collects computed styles and metrics via injected JavaScript, analyzes them with a confidence model, and returns structured findings — all in one command. The agent asks a question about any selector and gets back the DOM tree, ASCII layout diagram, overflow warnings, and scroll diagnosis without leaving the terminal.
Installation
For Humans
Copy and paste this prompt to your LLM agent (Claude Code, Cursor, Codex, etc.):
Or read the Installation Guide, but seriously, let an agent do it. Humans fat-finger configs.
For LLM Agents
Fetch the installation guide and follow it:
Or install directly:
How It Works
- Session —
openspawns a daemon process managing a browser. Commands connect via Unix socket. - Collector — Injected as IIFE into the page. Walks the DOM, reads computed styles, declared values, and element metrics.
- Analyzer — Pure Node.js functions. Classifies findings with confidence levels (DEFINITE / INDEFINITE / UNVERIFIABLE).
- Renderer — Outputs Markdown (default) or JSON. Includes ASCII layout diagram, DOM tree, and findings.
Quick Start
1. Inspect a Page
2. Login-Protected Pages
3. JSON Output
4. Use as an MCP Server (AI clients)
cssprobe-cli ships an MCP server (stdio), so AI clients call it as a native tool — no shell needed:
Manual configuration for any MCP client:
Exposes 10 tools: cssprobe_open, cssprobe_inspect, cssprobe_tree, cssprobe_layout,
cssprobe_findings, cssprobe_eval, cssprobe_screenshot, cssprobe_inject_css,
cssprobe_close, cssprobe_status. Remove with cssprobe-cli mcp-uninstall.
Commands
Session Management
CSS Inspection
Inspection commands accept --frame <index|name|url-substring> to target an iframe; the default is the main frame.
CSS Injection
Browser
Interaction
click / hover support --nth N (1-based, default first match), --force (skip actionability checks) and --timeout ms. Without --nth, multiple matches fail (strict) to prevent wrong-target clicks.
State
Configuration
Multi-step Flows
The interaction commands drive a page step by step; run turns a sequence into a versionable script:
For repeatable flows, write a script and run it with one command. The script runs inside the daemon session (full Playwright page access):
Scripts must default-export an async function receiving the API object: page, context, frames(), newPage(), click, hover, type, waitFor, inspect, screenshot, expect, log. waitFor accepts { state, timeout, frame }. Uncaught page errors are collected into the result envelope as pageErrors. screenshot relative paths resolve against the script's directory; logs (log() and console.*) are collected and returned with the result. On failure the command exits 1, prints the collected logs, and keeps the session alive.
Scripts are executed by the local daemon with full Node privileges — only run trusted scripts.
Scenario Suites (Regression)
Run repeatable regression cases from a JSON suite: each case opens a fresh browser, executes steps, asserts on saved values, and writes artifacts + an optional JUnit report.
Steps: goto, reload, wait, eval, sample, waitStable, click, waitFor, screenshot, assert. wait takes a fixed ms; waitFor supports frame for in-iframe selector/js waits. sample and eval save values with save: "<name>"; assertions read them with on: "<name>" + path, or check live state (url, title, frames), url, globals, absent. sample supports key, tailFrom, ignoreErrors; every run writes summary.json, per-case case.json, sample series and failure screenshots.
Iframe and preview pages. A page can contain hidden helper iframes (about:blank); use frames to pick the real one, and state: "attached" when waiting for a frame element that is not visible. Preview frames can take 6–8s to render and analytics requests keep networkIdle busy — prefer a fixed wait step followed by a waitFor inside the frame (frame: "i/preview") instead of networkIdle.
Confidence Model
Every finding carries a confidence level:
The report header shows: confidence: DEFINITE 8 | INDEFINITE 0 | UNVERIFIABLE 1
Complementary Tool: cssgraph
cssprobe-cli is a runtime CSS probe — it opens a real browser and reads what is actually rendered. For static questions about the source code — where is .btn-primary defined, what cascades over it, which components reference it, what would change if I edited it — use cssgraph, a local SQLite knowledge graph of every className, property, variable, and at-rule in your stylesheets. The two tools complement each other:
Recommended workflow for a style problem — go static first, then verify at runtime:
Install: npm install -g cssgraph (requires Node.js >= 22.5.0). It exposes 12 MCP tools (cssgraph_explore, cssgraph_rule, cssgraph_impact, …) plus CLI commands. See npm / GitHub.
Configuration
Priority: CLI flags > Environment variables > Config file
Config file: ~/.cssprobe-clirc
Supported Platforms
Development
If cssprobe-cli is useful
A ⭐ star helps other developers discover it — and tells us to keep shipping.
License
MIT
来源:README.md,提交 80057ad
工具
0版本历史
1- v0.3.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分