MCP Server
@jml/brok-mcp is a Node MCP server that exposes the Brok
registry to AI coding tools like Claude Code and Cursor. It lets an agent discover
available items, rank a build kit from product intent, inspect dependencies and files, and retrieve the exact
php artisan ui:add command to run — without ever writing
files into your project itself.
What it does
The MCP server acts as a read-only guide for AI assistants. It answers questions like
"what components are available?", "what does the data-table
block depend on?", and "how do I install the Pro pricing block?" — but it never touches
your project's files.
Actual installation always stays in your hands: the agent calls
get_add_command to retrieve the correct artisan command,
then you (or the agent, in your terminal) runs it:
php artisan ui:add button
This keeps the MCP server stateless and your project tree under your control.
Install
Add to Claude Code
Register the server with a single command. Claude Code downloads and caches the package via npx — no global install required.
claude mcp add brok -- npx -y @jml/brok-mcp
Add to Cursor
Add the server to your Cursor MCP configuration file. Create or edit ~/.cursor/mcp.json:
{
"mcpServers": {
"brok": { "command": "npx", "args": ["-y", "@jml/brok-mcp"] }
}
}
Configuration
Pass environment variables when registering the server to point it at a different registry or supply a Pro licence token.
| Variable | Description |
|---|---|
| BROK_REGISTRY_URL | Registry HTTP base URL. Defaults to the local docs-registry dev server until a production registry is deployed. |
| BROK_REGISTRY_LOCAL | Optional path to a local directory of pre-built registry JSON files. When set, the server reads from disk instead of making HTTP requests — useful for offline development. |
| BROK_LICENSE_TOKEN | Bearer token for Pro registry items. Obtain it by running php artisan ui:auth in your Laravel app. |
| BROK_DOCS_URL | Base URL used to construct docs links returned by get_item and get_item_examples. Defaults to the public docs site. |
Pass env vars to Claude Code with the --env flag:
claude mcp add brok --env BROK_REGISTRY_URL=https://your-registry.example -- npx -y @jml/brok-mcp
Tools
The server exposes eight tools. AI assistants call these automatically based on your instructions; you can also invoke them directly in an MCP-aware client.
| Tool | Returns |
|---|---|
| list_items | Paginated list of registry items with bounded limit/offset controls. Accepts optional component, block, page, bundle, or theme kind and open/Pro tier filters. |
| search_items | Deterministically ranked items matching names, descriptions, authored knowledge, related items, and intent synonyms. |
| get_item | Full item manifest for a given slug: registry dependencies, npm/Composer dependencies, and the list of files written into the consumer app. |
| get_item_examples | Blocks that compose the requested item, plus a link to the component's docs page for further reading. |
| get_add_command | The exact php artisan ui:add command to run, with all resolved registry dependencies listed so nothing is missed. |
| doctor | Registry reachability, whether a local or remote source is in use, and Pro auth status. |
| build_kit | A ranked, typed starter kit for a natural-language product intent, including the recommended first move, alternatives, matched terms, dependencies, and install commands. |
| compose_page | Ordered install commands and Blade markup for 1–50 canonical block names. It validates the whole composition and never writes files. |
Successful calls expose the same payload as MCP structuredContent as well as display text, so agents do not need to parse prose.
Pro items
Note
BROK_LICENSE_TOKEN to be visible
and installable. Obtain your token by running
php artisan ui:auth inside your Laravel app, then pass the
token when registering the MCP server:
--env BROK_LICENSE_TOKEN=<your-token>.
Without a valid token, Pro items are hidden from list_items and
search_items results.