home / mcp / layout detector mcp server
Provides layout analysis by locating assets, measuring spatial relationships, and detecting patterns to enable semantic layout rebuilds.
Configuration
View docs{
"mcpServers": {
"katlis-layout-detector-mcp": {
"command": "layout-detector-mcp",
"args": []
}
}
}Layout Detector MCP analyzes webpage screenshots to locate known assets, measure their spatial relationships, and identify layout patterns. It outputs structured data that enables AI assistants to rebuild layouts with accurate positioning and semantics, helping you convert visuals into accessible CSS and semantic structures.
You will use an MCP client to interact with the Layout Detector MCP server. Start the local server, then call its analysis tools to extract positions, patterns, and measurements from a screenshot and a set of asset images. Use the results to drive layout recreation in your UI code.
Typical workflow:
Prerequisites: Python 3.11 or newer, and a Python packaging tool (pip). Ensure you have network access for package installation.
pip install git+https://github.com/katlis/layout-detector-mcp.git
# Or install locally after cloning
# git clone https://github.com/katlis/layout-detector-mcp.git
# cd layout-detector-mcp
# pip install .Configure your MCP client to point at the local Layout Detector MCP server. The server is run as a standard Python-based MCP callable via the layout-detector-mcp command.
# Start the MCP server (run in a separate terminal/session)
layout-detector-mcpIf you encounter a module or dependency issue, install the required Python packages, such as OpenCV and supporting libraries, and re-run the server start command.
If the server fails to start, verify Python 3.11+ is available and that your environment has network access to install dependencies.
The main analysis tool returns the viewport size, detected pattern, center-related data, and a list of detected elements with their coordinates and dimensions. Use this data to drive absolute positioning or to generate semantic layout structures in your target framework.
Example outputs can include keys such as viewport, pattern type and confidence, center element, and elements with asset names and positions.
Performs full layout analysis including pattern detection to identify structure, positions, and relational data among assets.
Locates known assets within a screenshot and returns their positions and confidence scores.
Returns basic dimensions and metadata about a given screenshot.