Build token workflows on RARE Protocol.
The published @rareprotocol/rare-cli package provides the global rare command and SDK exports for collections, mints, releases, markets, swaps, searches, and Merkle utilities.
npm install -g @rareprotocol/rare-cli\nrare --helpRequires Node.js 22+. Supported chains include mainnet, sepolia, base, and base-sepolia. Some marketplace, release, lazy mint, Liquid Edition, and swap flows are available only where the underlying contracts are deployed.
Configure wallet and RPC
Each chain can store its own key source, RPC URL, and optional Uniswap API key source under ~/.rare/config.json. Prefer 1Password references when you do not want plaintext private keys in local config.
rare configure --chain sepolia --private-key 0xYourPrivateKeyHere
rare configure --chain sepolia --private-key-ref op://Private/rare-sepolia/private-key
rare configure --chain sepolia --rpc-url https://your-rpc-endpoint.com
rare configure --show
rare wallet addressCollections
rare collection deploy erc721 "My Collection" "MC"Deploy a Sovereign ERC-721 collection.rare collection deploy lazy-erc721 "My Release" "MR" --max-tokens 1000Deploy a Lazy Sovereign collection for direct sale releases.rare collection deploy lazy-batch-mint "My Lazy Collection" "MLC"Deploy a lazy batch mint collection for prepared buyer minting.rare import erc721 --contract 0x...Import an existing ERC-721 contract into the RARE registry.Mint & releases
Upload media to IPFS and mint in one step, batch mint from a metadata directory, or prepare lazy mints and RareMinter direct sale releases.
rare collection mint \
--contract 0x... \
--name "My NFT" \
--description "A description" \
--image ./art.png
rare collection mint-batch --contract 0x... --base-uri ipfs://... --amount 100
rare collection prepare-lazy-mint --contract 0x... --base-uri ipfs://... --amount 100
rare listing release configure --contract 0x... --price 0.1 --max-mints 5
rare listing release mint --contract 0x... --quantity 1Markets
rare listing create --contract 0x... --token-id 1 --price 1.0Create a fixed-price listing.rare listing buy --contract 0x... --token-id 1 --price 1.0Buy a listed token after asserting price.rare offer create --contract 0x... --token-id 1 --price 0.5Create an offer in ETH or a named ERC-20 currency.rare auction create --contract 0x... --token-id 1 --price 0.1 --end-time 1778586400Create a reserve or scheduled auction.rare swap buy-rare --amount-in 0.1 --quote-onlyQuote or execute supported swap routes.Marketplace commands support named currencies such as eth, usdc, and rare, or a raw ERC-20 address.
Search & API-backed utilities
rare search nfts --query "portrait"
rare search nfts --mine
rare search events --chain-id 1 --contract 0x... --token-id 1 --event-type CREATE_NFT
rare search collections
rare nft get --contract 0x... --token-id 1
rare user get 0x...
rare currencies --chain mainnetMerkle proof, metadata, media upload, and search flows use the SuperRare Token API by default. Set RARE_API_BASE_URL to target another deployment.
SDK client
Use the client export with viem app clients. Public package subpaths are intentionally scoped to client, contracts, and pure utility helpers.
npm install @rareprotocol/rare-cli viem
import { createRareClient } from "@rareprotocol/rare-cli/client";
import { contractAddresses, supportedChains } from "@rareprotocol/rare-cli/contracts";
import { buildUtilsTree, getUtilsTreeProof } from "@rareprotocol/rare-cli/utils";
const rare = createRareClient({ publicClient, walletClient });
const nfts = await rare.search.nfts({ query: "portrait", perPage: 10 });MCP server
rare mcp serve starts a stdio MCP server for Claude, Codex, Cursor, Windsurf, and MCP Inspector. It registers read-only tools by default; write-capable tools require an explicit --allow-writes.
rare mcp serve
rare mcp serve --allow-writes
npx @modelcontextprotocol/inspector rare mcp serve