The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Playwright Spatial Layout MCP listing page.
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.
detect_visual_occlusionChecks if one element physically overlaps another by computing bounding box intersection.
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
compute_viewport_reflowMeasures how element positions and sizes change across multiple viewport sizes.
Or install globally:
"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?"
MIT © vola-trebla