@mercurjs) provides all the built-in marketplace blocks. You can also create and host your own.
How it works
A registry is a set of JSON files — one per block — served over HTTP. When you runbunx @mercurjs/cli@latest add, the CLI fetches the block’s JSON, resolves its dependencies, and copies the source files into your project.
registry.json
Theregistry.json file defines your registry and all its blocks:
registry.json
Block properties
| Property | Description |
|---|---|
name | Block identifier used in bunx @mercurjs/cli@latest add |
description | Short description shown in search results |
dependencies | NPM packages to install |
registryDependencies | Other blocks this block depends on (e.g. @mercurjs/wishlist) |
docs | Markdown shown to the user after installation |
files | List of source files with their paths and types |
categories | Tags for search and filtering |
File types
Each file in a block has atype that determines where it gets placed in the target project:
| Type | Target alias |
|---|---|
registry:module | modules |
registry:workflow | workflows |
registry:api | api |
registry:link | links |
registry:vendor | vendor |
registry:admin | admin |
registry:lib | lib |
blocks.json.
Building
Build your registry into distributable JSON files:registry.json, resolves all imports for each block, embeds the file contents, and outputs one JSON file per block to the r/ directory.
| Option | Description |
|---|---|
-o, --output <path> | Output directory (default: ./r) |
-v, --verbose | Show detailed output |
Hosting
Serve the builtr/ directory over HTTP. Any static hosting works — GitHub Pages, Vercel, Netlify, S3, or your own server. The only requirement is that {name}.json files are accessible at a public URL.
Using custom registries
Add your registry toblocks.json in any Mercur project:
blocks.json
{name} as a placeholder for block names. Then install blocks from it:
Authentication
For private registries, you can use headers with environment variables:blocks.json
Dependencies between blocks
Blocks can depend on other blocks usingregistryDependencies. When a user installs your block, the CLI automatically resolves and installs all dependencies in the correct order.