Skip to main content
Screenshot of the merch store example app.
See the live example: mdk-merchstore-example.vercel.app This is an example for building a merch store with moneydevkit. We’ll sell a single physical product — an AI-designed t-shirt — for a fixed price over the Lightning Network. This example is different from the others: it involves a real physical product and a real outbound payment on every sale. When a customer pays, the store programmatically pays a print-on-demand supplier over L402 to produce and ship the shirt, and keeps the spread between the retail price and the production cost.

Step 1: Install the MCP server

The MCP server lets your coding agent connect to your existing moneydevkit account and wire up your app for you. Pick your coding agent below:
Run this in your project directory:
claude mcp add moneydevkit --transport http https://mcp.moneydevkit.com/mcp/account/
Run this in your project directory:
codex mcp add moneydevkit --url https://mcp.moneydevkit.com/mcp/account/

Step 2: Start a new project

Create an empty folder and open it in your coding agent. This will be the root of your new Next.js project.

Step 3: Prompt your coding agent

Paste the following prompt into your coding agent to scaffold the merch store. Note that the build has a couple of paid steps (generating the artwork and creating the product cost roughly 0.250.25–0.50 total), so your agent will pause and ask you to fund its agent wallet with a few dollars of bitcoin before it proceeds.

Scaffold a merch store in Next.js.

Step 4: Preview and deploy

When your coding agent finishes, you can preview your app. The agent will give you a link that you can open in your browser to preview the app locally. When you’re ready to ship it, head to Vercel to deploy. Because this store pays a supplier on every sale, a few things have to be wired up by you (your agent can’t do these on your behalf):
  1. Create a moneydevkit app (or connect your existing one via the MCP) and copy MDK_ACCESS_TOKEN and MDK_MNEMONIC.
  2. Enable programmatic payouts — the switch is on the Payouts page of the dashboard. The store pays the supplier out of its balance on every sale; each app has a rolling daily programmatic payout limit, so make sure it comfortably covers your expected order volume. There’s no dashboard product to create; the store uses an AMOUNT-type checkout for the fixed price.
  3. Configure a checkout.completed notification webhook pointing at https://YOUR_HOST/api/webhooks/checkout-completed, and copy its signing secret into MDK_WEBHOOK_SECRET. Point it at your production alias, not a one-off immutable deployment URL.
  4. Add the environment variables to your deployment: UNHUMAN_PRODUCT_UUID, UNHUMAN_VARIANT_ID (the sync variant id), MDK_ACCESS_TOKEN, MDK_MNEMONIC, and MDK_WEBHOOK_SECRET — then redeploy. Environment changes don’t apply to a running deployment until you redeploy.
  5. Keep the checkout.completed webhook enabled. moneydevkit auto-disables an endpoint after a streak of failed deliveries, so if early orders fail while you finish wiring things up, the webhook can silently switch off. Re-enable it and confirm one delivery returns 200 so it stays on.