bricks_analyze_url
Overview
Analyzes a URL to extract design tokens including colors, fonts, sections, and layout patterns. Fetches the page HTML and parses it to identify design elements that can be used as reference when building in Bricks.
This is the foundation tool for the « clone design » workflow. By analyzing an existing website, you can extract its color palette, typography choices, section structure, and layout patterns, then recreate them in Bricks using the MCP design system tools.
Supports extraction of hex/rgb/hsl colors, CSS custom properties for colors, Google Fonts and font-family declarations, semantic HTML sections, and CSS layout patterns (grid, flexbox, Bootstrap, Tailwind).
Key Features
When to Use
You need to extract the color palette from a reference site
You want to identify which fonts a website uses
You need to understand the section structure and layout patterns of a page
You are building a design system based on an existing site as reference
Bricks Builder version 1.9 or higher
The MCP server must have outbound HTTP access to fetch the URL
When NOT to Use
You need to analyze a page that requires authentication (login)
You want to analyze your own Bricks pages — use bricks_analyze_page instead
Parameters
Warning: Undefined array key "param_enum_values" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 28
urlstring (URL)REQUIREDWarning: Undefined array key "param_enum_values" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 28
extractarray of strings (enum)optionalall typesCode Examples
Warning: Undefined array key "example_output" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 12
Extract all design tokens from a website
Analyzes a reference site to extract colors, fonts, sections, and layout patterns.
bricks_analyze_url({
url: "https://example.com"
})
// Returns:
// {
// url: "https://example.com",
// colors: ["#1a1a2e", "#4361ee", "#e2e8f0", "rgba(0,0,0,0.1)"],
// fonts: ["Inter", "Playfair Display"],
// sections: [
// { tag: "header", id: "site-header", classes: ["sticky", "bg-white"] },
// { tag: "section", classes: ["hero", "full-width"] },
// { tag: "section", id: "features", classes: ["py-20"] }
// ],
// layout_patterns: ["css-grid", "flexbox", "3-column-grid", "contained-width"]
// }Warning: Undefined array key "example_output" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 12
Extract only colors and fonts
Focuses extraction on just the color palette and typography.
bricks_analyze_url({
url: "https://example.com",
extract: ["colors", "fonts"]
})Common Mistakes
Warning: Undefined array key "fix_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 47
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 1935
Warning: Undefined array key "wrong_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 48
Warning: Undefined array key "right_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 49
Warning: Undefined array key "fix_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 47
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 1935
Warning: Undefined array key "wrong_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 48
Warning: Undefined array key "right_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 49
Warning: Undefined array key "fix_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 47
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 1935
Warning: Undefined array key "wrong_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 48
Warning: Undefined array key "right_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 49
Tips & Warnings
Tip: After extracting design tokens, use bricks_create_color_palette to create the color palette, bricks_upload_font or Google Fonts for typography, and bricks_update_theme_styles to set the typography scale.
Tip: The section structure output maps directly to Bricks sections. Use it as a blueprint: each detected <section> becomes a bricks_add_section call.
Tip: Layout pattern detection helps you choose between CSS Grid and Flexbox for your Bricks elements. If the reference site uses a 3-column grid, use _gridTemplateColumns: "1fr 1fr 1fr" in Bricks.
Warning: The URL fetch has a 15-second timeout. Very slow or large pages may time out. Single-page applications (SPAs) that render content via JavaScript may return minimal HTML.