Download the PHP package inchoo/magento-bricklayer without Composer

On this page you can find all versions of the php package inchoo/magento-bricklayer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package magento-bricklayer

Magento Bricklayer

An MCP server that gives AI coding agents runtime visibility into Magento 2. Agents reading source files miss the full picture — DI preferences, plugin chains, EAV attributes, and event observers are resolved at runtime across dozens of modules. Bricklayer exposes this runtime state so agents make informed architectural decisions instead of guessing.

Table of Contents

What is Bricklayer?

Bricklayer is a Composer library that implements an MCP server for Magento 2. When started, it exposes 84 tools that AI agents can invoke to:

Only 17 essential tools are visible at startup — the remaining 67 are discoverable via search-tools, reducing token overhead while keeping all tools callable.

The name "Bricklayer" reflects the methodical, structured approach to building Magento 2 modules and extensions, laying each component (the "bricks") in the correct order and position to construct a solid, maintainable codebase.

How Agents Use Bricklayer

Magento resolves DI configuration, plugin chains, preferences, and event observers at runtime across all installed modules. An agent reading source files sees only one module's perspective — it misses overrides, conflicts, and customizations from other modules. Bricklayer bridges this gap.

Before writing a plugin, an agent calls check-class to see existing plugins and their sortOrders, DI preferences, and class rewrites — preventing conflicts that would only surface in environments with more extensions installed.

Before working with products or customers, an agent calls eav-attributes to discover custom attributes that exist only in the database, not in any source file.

When debugging, an agent calls diagnose-error which combines the exception log, stack trace, DI context, and plugin chain analysis into a single actionable diagnosis — far more than reading var/log/exception.log alone.

Before writing any code, an agent calls development-context to load domain-specific guidelines (plugin patterns, EAV best practices, Hyvä checkout APIs, etc.) ensuring the generated code follows Magento conventions.

Each tool response includes hints pointing to the next logical step — introspection tools suggest relevant guidelines to load, and guidelines suggest which runtime checks to perform. This creates a natural workflow: check → learn → write.

Requirements

Installation

As a Development Dependency (Recommended)

Global Installation

Quick Start

1. Install Agent Configuration

Run from your Magento project root:

This prompts you to select which AI agents to configure and generates:

2. Start Using with Your AI Agent

The MCP server is automatically started by compatible agents. Your agent can now:

Supported AI Agents

Agent Configuration Files Status
Claude Code .mcp.json + CLAUDE.md Fully Supported
Cursor .mcp.json + .cursorrules Fully Supported
GitHub Copilot .mcp.json + .github/copilot-instructions.md Supported
JetBrains AI (PhpStorm) .mcp.json + .junie/guidelines.md Supported
Gemini CLI .mcp.json + AGENTS.md Supported
OpenAI Codex .codex/config.toml + AGENTS.md Supported¹
Mistral Vibe .vibe/config.toml + AGENTS.md Supported

¹ Project-scoped .codex/config.toml requires a recent Codex CLI release and is only loaded after you mark the project as trusted in Codex.

Available Commands

install

Generates agent configuration files for your AI tools.

Options:

init

Generates .bricklayer.json configuration file with deploy-mode-aware defaults.

Options:

The generated config contains one entry per runtime-configurable tool (36 tools at the time of writing). The list is discovered by scanning the source for requireToolEnabled() call sites, so every key the file contains is one the runtime actually honors — no dead keys, no drift.

Deploy-mode behavior:

This command is also called automatically during bricklayer install. Additionally, bricklayer verify will auto-generate the file if it's missing.

config:set

Update a single value in .bricklayer.json with full validation, round-trip verification, and a guided interactive mode for discoverability.

Options:

Interactive mode (no arguments) is the recommended path for newcomers. It lists all 36 runtime-configurable tools with their current values inline, lets you pick a tool, pick a setting (when more than one is available), and enter a new value with type-aware validation (bool picker, int validator that re-prompts on non-numeric input).

Scripted mode (positional arguments) is for automation. Values are parsed automatically: true/false → bool, null → null, numeric → int/float, [...]/{...} → JSON-decoded, anything else → string.

Safety checks on every successful set:

Auto-creates .bricklayer.json with deploy-mode-aware defaults if the file is missing.

Negative integer values need the -- separator (standard Symfony Console behavior):

mcp

Starts the MCP server (invoked automatically by AI agents).

Options:

inspect

Displays information about the current Magento installation.

Options:

update

Regenerates agent configuration files (CLAUDE.md, .cursorrules, etc.) from the current bundled content plus any project-local overrides in .bricklayer/.

Options:

When the project has files under .bricklayer/ (see Project-Local Overrides), the command reports which local files were applied alongside the regenerated agent files.

verify

Runs a post-install health check against your Bricklayer installation.

Options:

Checks performed: Magento bootstrap, deploy mode detection, MCP server creation and tool count, agent configuration files, PsySH availability for code-runner, database connectivity, log directory writability, and .bricklayer.json validation. If .bricklayer.json is missing, verify auto-generates it with deploy-mode-aware defaults.

Docker / Container Environments

Bricklayer automatically detects Docker, DDEV, and Warden environments:

Automatic Container Detection

For Docker environments with dynamic or non-standard container names, use the bricklayer-mcp-docker wrapper script. This script automatically detects the PHP container at runtime:

The wrapper script:

This is useful when container names vary between environments or are dynamically generated (e.g., projectname-apache-php-1).

MCP Tools Overview

Bricklayer uses progressive disclosure — 17 essential tools are visible in tools/list while 67 additional tools remain callable and discoverable via search-tools. This reduces token overhead for AI agents. Tools marked with [tier 1] are always visible; all others are tier 2.

Application & Module Tools

Database Tools

EAV Tools

Configuration & DI Tools

Routing & API Tools

GraphQL Tools

View Tools

Message Queue Tools

Catalog Tools

Order Tools

Customer Tools

Development Tools

Log Tools

Diagnostic Tools

The diagnose-error tool orchestrates multiple introspection tools to produce a comprehensive diagnosis:

Parameters: Parameter Default Description
index 0 Which error to diagnose (0 = most recent)
source exception Log file: exception, system, debug, cron
since 1h Time window: 5m, 1h, 24h, 7d
pattern "" Substring filter for error messages
verbosity standard Detail level: minimal, standard, detailed

Response structure:

The tool recognizes 15 common Magento error patterns including class-not-found, DI compilation errors, database issues, search engine failures, invalid templates/blocks, memory exhaustion, and session errors.

Code Runner Tool

Parameters: Parameter Default Description
code (required) PHP code to execute (without <?php tags)
area "" Magento area for DI resolution: frontend, adminhtml, webapi_rest, graphql, crontab, global
allow_write false When false, DB changes are rolled back after execution
timeout 30 Maximum execution time in seconds
mode "execute" execute runs code normally; define saves reusable functions for the session

Reusable functions (mode=define):

Define named PHP functions that persist across code-runner calls within the same session. Functions are validated against the same dangerous pattern blocklist and cleared on reinitialize. Maximum 20 defined functions per session.

Helper functions available in executed code:

Response includes:

Code runs through a PsySH shell when the psy/psysh dependency is available (it ships as a Bricklayer requirement), falling back to a plain eval engine otherwise — verify reports which is active. Read-only mode wraps execution in a database transaction that is always rolled back unless allow_write=true, so read_only: true and the rollback note appear on every default call (even for code that performs no writes); pass allow_write=true to commit.

The tool validates code against 9 dangerous patterns (shell execution, file writes, superglobals, cURL, eval, header manipulation, global handler registration, long sleeps). Disabled in production mode and configurable via .bricklayer.json.

Code Generation Tools

All code generation tools support dry_run (preview without writing) and force (overwrite existing files) parameters. In dry-run mode, each file is annotated with new or exists status. Without force, existing files cause a conflict error listing the affected paths.

Development Context Tool

Context-Aware Hints

Select tools return a conditional _hint field in their response when they detect a situation where the agent would benefit from a follow-up action:

Tool Condition Hint
product-get Product has custom EAV attributes Points to eav-attributes for attribute metadata
customer-get Customer has custom EAV attributes Points to eav-attributes for attribute metadata
system-status check=indexers Any indexer is invalid Points to log for related errors
system-status check=cache Any cache type is disabled Warns about potential impact
diagnose-error Exception involves plugins Points to plugin-list for the relevant class
diagnose-error Exception involves DI config Points to di-configuration for the relevant class

Additionally, introspection tools return a _skill_hint field that guides agents to load relevant development guidelines:

Tool Hint
plugin-list Points to development-context category=plugin
di-configuration Points to development-context category=module
preference-list Points to development-context category=preference
event-list Points to development-context category=observer
eav-attributes Points to development-context category=eav
database-schema Points to development-context category=model
graphql-inspect Points to development-context category=graphql
route-list Points to development-context category=frontend
api-endpoints Points to development-context category=rest-api
layout-inspect Points to development-context category=frontend
ui-component-inspect Points to development-context category=ui-component
message-queue-inspect Points to development-context category=message-queue
diagnose-performance Points to development-context category=performance

The development-context tool itself returns _next_steps — suggesting which introspection tools to call for the loaded category (e.g., loading the plugin category suggests calling check-class for the target class).

Pagination

All list tools include pagination metadata in their response:

The has_more field provides a reliable signal for agents to decide whether to fetch additional pages.

MCP Resources

Bricklayer provides MCP resources that AI agents can access for context. Guidelines and skills are auto-discovered from the filesystem — adding new files makes them available as resources automatically (see Extending Bricklayer).

Guidelines Resource

30 Magento development guidelines accessed via URI template magento://guidelines/{category}/{name}, covering:

Use magento://guidelines/index for a complete listing.

Coding Standards Resource

Magento coding standards reference with PSR-12 compliance and architecture guidelines (magento://standards/coding, magento://standards/architecture).

Skills Resource

Development skills are auto-discovered and accessed through magento://skills/{name}. A skill can bundle focused sub-skills in topic sub-directories, served via magento://skills/{name}/{topic}. Skills cover:

Use magento://skills/index for a complete listing.

Template & Reference Resources

Code templates for common patterns (magento://templates/module, magento://templates/controller, magento://templates/api, magento://templates/model) and reference documentation (magento://reference/events, magento://reference/di-patterns, magento://reference/acl). Layout handle reference is no longer a static resource — the layout-inspect tool enumerates registered handles at runtime instead.

Configuration

.bricklayer.json lives at your Magento root. The easiest way to create or edit it is:

A generated developer-mode config looks like this (35 entries total — one per runtime-configurable tool; the snippet below is an excerpt):

Every key in a generated config maps to a requireToolEnabled() call site in the source, so the file never contains dead keys. If you add keys that the runtime does not honor (e.g. product-get.enabled), config:set will warn you before writing.

Per-Tool Configuration

Every write tool can be individually enabled or disabled via the enabled flag:

Destructive tools (product-delete, category-delete, customer-delete, customer-address-delete, order-cancel, order-create, creditmemo-create, and all 4 code generation tools) are blocked by default in production mode. They must be explicitly enabled in .bricklayer.json with "enabled": true to work in production.

Recommended Production Configuration

Environment Variable Overrides

Environment variables are the highest-priority configuration layer — they override .bricklayer.json.

Two variables are read directly and stand alone:

Any tool setting is overridable by mapping its dot-notation config key to an env name: prefix with BRICKLAYER_, upper-case, and replace both . and - with _. Hyphenated tool names (code-runner, database-query, product-delete, …) are fully supported.

The env key must include the full config path. For example tools.code-runner.enabled maps to BRICKLAYER_TOOLS_CODE_RUNNER_ENABLED — not BRICKLAYER_CODE_RUNNER_ENABLED, which targets a different (unread) key and has no effect.

Architecture

Bricklayer is implemented as a standalone Composer library rather than a Magento module. This follows the proven pattern established by n98-magerun2:

Auto-Reinitialize

Bricklayer runs as a long-lived MCP server process that bootstraps Magento's ObjectManager once at startup. When external commands change the application state (e.g. setup:upgrade, setup:di:compile, module:enable), the in-memory ObjectManager can become stale — new modules won't be recognized, config defaults won't load, and DI preferences may be outdated.

To solve this, Bricklayer tracks the modification times of two sentinel files:

Before every tool call, the RequiresMagento trait checks these mtimes. If either file has changed since the last initialization, Magento is automatically reinitialized with a fresh ObjectManager — no manual intervention required. The staleness check costs two filemtime() calls (~microseconds) per tool invocation.

A manual reinitialize tool is also available for edge cases where sentinel files don't change (e.g. editing a module's config.xml without recompiling).

Config Hot-Reload

Bricklayer also tracks the modification time of .bricklayer.json. When the file is edited while the MCP server is running (e.g. enabling a tool), the change is detected automatically on the next tool call — no server restart required. The staleness check costs a single filemtime() call per config access.

Project-Local Overrides

Bricklayer ships with a bundled library of guidelines, skills, and a category map — but every Magento project has conventions that deviate from the bundled defaults (custom ERP integrations, CSP rules, payment quirks, house style). Project-local overrides let you add or replace content without forking the package.

Any file the project places under .bricklayer/ at the Magento root is picked up automatically by bricklayer update, development-context, and search-docs. Nothing needs to be registered in .bricklayer.json — the path is the contract, modelled after Laravel Boost.

Directory layout

Override vs addition semantics

Optional SKILL.md frontmatter

Local SKILL.md files may start with a small YAML frontmatter block for richer display names and descriptions. The block is stripped before the content is handed to an agent.

Only name and description are consumed — any other keys are ignored. Files with no frontmatter fall back to the directory name as display name.

Typical workflow

bricklayer update reports which local files were applied:

Local skills and guidelines are also tagged [Project] in search-docs results so agents can tell project conventions apart from bundled Magento knowledge.

Extending Bricklayer

Bricklayer uses auto-discovery for tools, guidelines, skills, and categories. Adding new capabilities requires editing only the source file — agent documentation (CLAUDE.md, .cursorrules, etc.) is regenerated automatically when you run vendor/bin/bricklayer update. MCP resources (guidelines, skills, templates) are served dynamically on each agent request and need no separate build step.

Add a tool to an existing class

Add a public method with #[McpTool] to any class in src/Mcp/Tool/:

The tool is auto-detected via reflection and appears in the correct documentation section based on its class.

Add a new tool class

Create a new file in src/Mcp/Tool/, e.g. CmsTools.php. Any class with #[McpTool] methods is picked up automatically and gets its own documentation section (class name CmsTools becomes heading "Cms Tools").

To customize the section title, column headers, or ordering, add an entry to ToolScanner::GROUP_CONFIG. This is optional — it works without it.

Add a guideline

Drop a markdown file into config/guidelines/{category}/{name}.md. It becomes available as MCP resource magento://guidelines/{category}/{name} and appears in the guidelines index automatically.

Add a skill

Create a directory config/skills/{name}/ with a SKILL.md file inside. It becomes available as MCP resource magento://skills/{name} and appears in the skills index automatically.

A large skill can split focused topics into sub-directories: config/skills/{name}/{topic}/SKILL.md is served as magento://skills/{name}/{topic}. Keep the parent SKILL.md as the day-to-day core and point to sub-skills for deep dives, so agents load the focused content only when the task needs it.

An optional YAML frontmatter block (--- delimited) at the top of any SKILL.md is stripped before the content is served to agents.

Add a development-context category

Add one entry to ContextTools::CATEGORY_MAP:

The group key determines which heading it falls under in the generated documentation. Available groups: Hyvä Theme, Module Development, API & Integration, Frontend & Admin, System & Quality — or add a new one.

Regenerate documentation

After making changes, regenerate agent configuration files:

Security

Query & Log Safety

Production Mode Protection

Per-Tool Configuration

Code Execution Safety

Contributing

Contributions are welcome! Please read our contributing guidelines before submitting pull requests.

License

MIT License - see LICENSE for details.

Credits

Developed by Inchoo - Magento Development Experts.

Inspired by:


All versions of magento-bricklayer with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
mcp/sdk Version ^0.3 || ^1.0
psy/psysh Version ^0.12
symfony/console Version ^5.4 || ^6.0 || ^7.0
psr/log Version ^2.0 || ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package inchoo/magento-bricklayer contains the following files

Loading the files please wait ...