
Playwright Spatial Layout Mcp
io.github.vola-trebla由 GitHub 账号 vola-trebla 发布v0.2.0更新于 Oct 24, 2026
MCP server that gives AI agents geometric spatial awareness of web page layouts using Playwright
发布方自己的服务:Layout
概览
基于 Playwright 的 MCP 服务器,为助手提供真实网页的边界框几何数据,用于分析布局、遮挡与重排。
- 可以做什么
- 测量指定选择器元素的位置、尺寸、z-index 与视口可见性
- 检测目标元素与浮层之间的视觉遮挡,给出相交比例与被遮挡面积
- 校验 left_of、right_of、above、below、contains、not_overlapping 等布局规则并返回通过与否及原因
- 在多个视口尺寸下比较元素位置与尺寸,找出布局偏移
- 适用场景
- 适合排查 Playwright 测试失败或响应式布局问题:DOM 看似正常,但元素被隐藏、移出屏幕、相互重叠或发生位移。也适合检查横幅或弹窗是否在特定视口下挡住主要按钮。
- 运行要求
- 通过 npx 或全局 npm 安装以 stdio 在本地运行;需要 Node.js 以及 Playwright 的 Chromium 浏览器(npx playwright install chromium)。未声明账号、API 密钥或环境变量。加载被检查页面需要网络访问。
安装
在 SourceWeft 中
- 打开 控制台中的 Playwright Spatial Layout Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
playwright-spatial-layout-mcp 🐸📐
[npm version] [npm downloads] [CI] [License: MIT]
An MCP server that gives AI agents geometric spatial awareness of web page layouts using Playwright.
AI agents can read the DOM and know a button exists — but they can't see that it's hidden under a sticky header, pushed off-screen by a broken CSS rule, or overlapping another element on mobile. This MCP fixes that by exposing real bounding box mathematics from a live browser.
🤔 The Problem
When an AI agent analyzes a Playwright test failure, it reads the accessibility tree:
"The Submit button exists in the DOM. It has role=button. It is visible."
What it cannot see:
- 🙈 The button is at
y: 1450px— below the fold on mobile - 🙈 A cookie banner overlaps it by 73%, making it unclickable
- 🙈 On a 375px viewport the nav and hero section overlap each other
- 🙈 An element shifted 200px to the right after a CSS refactor
playwright-spatial-layout-mcp gives the agent coordinates, intersection ratios, and layout shift data so it can reason about the rendered page — not just the markup.
🛠️ Tools
extract_bounding_boxes
Returns position, size, z-index, and viewport visibility for one or more elements.
detect_visual_occlusion
Checks if one element physically overlaps another by computing bounding box intersection.
verify_spatial_relationships
Validates a set of layout rules and returns pass/fail with a human-readable reason per rule.
Supported rule types: left_of · right_of · above · below · contains · not_overlapping
compute_viewport_reflow
Measures how element positions and sizes change across multiple viewport sizes.
🚀 Installation
Or install globally:
Claude Desktop config
💡 Example Agent Prompts
"Check if the cookie banner is blocking the checkout button on mobile (375px viewport)"
"Verify that the navigation is above the hero section and the sidebar doesn't overlap the main content"
"Show me which elements shift the most when resizing from desktop to mobile"
"Is the promotional modal covering the primary CTA on iPad viewport?"
🔗 Related Projects
- playwright-trace-decoder-mcp — root-cause analysis of CI failures from Playwright traces
- flakiness-knowledge-graph-mcp — knowledge graph of flaky test patterns
- ast-impact-mapper-mcp — find affected tests from code changes via TypeScript AST
- zod-contract-mock-forge-mcp — deterministic mock generation from Zod schemas
📄 License
MIT © vola-trebla
来源:README.md,提交 6c85ccf
工具
0版本历史
1- v0.2.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
其他 Layout 集成
Layout
link.layout官方发布者
Layout 是一个远程 MCP 端点,让助手按餐厅名称在 Layout 合作的餐厅下单自取餐食。
LayoutBridge Light for Adobe InDesign®
com.mcp-interfaces
本地 MCP 服务器,让助手在用户桌面上读取和编辑 Adobe InDesign 文档:页面、框架、文本、样式、预检与 PDF 导出。

EasyGerber: AI PCB design, layout, and routing
由 GitHub 账号 EasyGerber 发布
托管式 EasyGerber MCP 服务器,让助手设计 PCB:选用目录元件、创建与编辑电路板、生成布局布线、检查并导出。

Layout Debug
由 GitHub 账号 AntonChuraev99 发布
本地 MCP 服务器:在运行中的网页或 Android 应用里点选界面元素,把它的锚点、盒模型和测量数据交给编码智能体。
LayoutBridge for Adobe InDesign®
com.mcp-interfaces
本地 MCP 服务器,让助手在用户桌面上查看和编辑 Adobe InDesign 文档:页面、框架、文本、样式、排版检查与 PDF 导出。