MCP server that gives AI agents geometric spatial awareness of web page layouts using Playwright
MCPpedia last refreshed this data
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"io-github-vola-trebla-playwright-spatial-layout-mcp-vola-trebla": {
"args": [
"-y",
"playwright-spatial-layout-mcp"
],
"command": "npx"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
An MCP server that gives AI agents geometric spatial awareness of web page layouts using Playwright.
Run this in your terminal to verify the server starts. Then let us know if it worked — your result helps other developers.
npx -y 'playwright-spatial-layout-mcp' 2>&1 | head -1 && echo "✓ Server started successfully"
After testing, let us know if it worked:
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
Checked playwright-spatial-layout-mcp against OSV.dev.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in browser
Browser automation with Puppeteer for web scraping and testing
🔥 Official Firecrawl MCP Server - Adds powerful web scraping and search to Cursor, Claude and any other LLM clients.
The Apify MCP server enables your AI agents to extract data from social media, search engines, maps, e-commerce sites, or any other website using thousands of ready-made scrapers, crawlers, and automation tools available on the Apify Store.
Self-hosted URL- and file-to-Markdown service for humans and AI agents - web pages, documents, images, audio, YouTube. PWA + REST + MCP + Claude Code skill, Reddit-aware, refreshable share links.
MCP Security Weekly
Get CVE alerts and security updates for io.github.vola-trebla/playwright-spatial-layout-mcp and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
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.
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:
y: 1450px — below the fold on mobileplaywright-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.
extract_bounding_boxesReturns position, size, z-index, and viewport visibility for one or more elements.
{
"url": "https://your-app.com",
"selectors": ["header", ".hero-cta", "footer"],
"viewport": { "width": 375, "height": 812 }
}
[
{
"selector": ".hero-cta",
"box": { "x": 16, "y": 892, "width": 343, "height": 48 },
"z_index": "auto",
"is_visible": true,
"is_in_viewport": false
}
]
detect_visual_occlusionChecks if one element physically overlaps another by computing bounding box intersection.
{
"url": "https://your-app.com",
"target_selector": ".checkout-button",
"overlay_selector": ".cookie-banner"
}
{
"is_occluded": true,
"intersection_ratio": 0.61,
"occluded_area_px": 4128
}
verify_spatial_relationshipsValidates 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
{
"url": "https://your-app.com",
"rules": [
{ "type": "above", "element_a": "nav", "element_b": ".hero" },
{ "type": "not_overlapping", "element_a": ".sidebar", "element_b": ".main-content" }
]
}
{
"passed": false,
"results": [
{ "passed": true, "reason": "'nav' bottom (64px) is above '.hero' top (64px)" },
{ "passed": false, "reason": "'.sidebar' and '.main-content' overlap by 12%" }
]
}
compute_viewport_reflowMeasures how element positions and sizes change across multiple viewport sizes.
{
"url": "https://your-app.com",
"selectors": ["nav", ".hero", ".cta-button"],
"viewports": [
{ "width": 375, "height": 812 },
{ "width": 768, "height": 1024 },
{ "width": 1280, "height": 720 }
]
}
[
{
"selector": ".cta-button",
"shifted": true,
"max_delta_x": 442,
"max_delta_y": 318,
"max_delta_width": 897,
"max_delta_height": 0
}
]
npx playwright-spatial-layout-mcp
Or install globally:
npm install -g playwright-spatial-layout-mcp
npx playwright install chromium
{
"mcpServers": {
"playwright-spatial-layout-mcp": {
"command": "npx",
"arg
... [View full README on GitHub](https://github.com/vola-trebla/playwright-spatial-layout-mcp#readme)