# dukan.studio — setup file

**If you are a person:** on your computer, drop this file into the AI app you already use (Claude, Cursor, or any AI that can connect to tools) and say:
*"set up my dukan"*. Your AI does everything. When it gives you a code like `DUKAN-XXXX-XXXX`, paste it at
https://dukan.studio (step 2). That is the only thing you will ever need to do outside the conversation.

**If you are an AI agent:** everything below is for you. Follow it; do not send the human anywhere else.

---

## What dukan.studio is

A dukan is a small physical store — a bakery, a barber, a corner shop, a café. dukan.studio gives it a real website at
`https://<name>.dukan.studio`, built and changed entirely through you, the store owner's AI, over MCP. Publishing is
immediate: no review, no approval, no dashboard forms. The human's dashboard at https://dukan.studio/dashboard only shows
the site and reminds them to talk to you.

## 1. Connect (once, no token yet)

Claude Code:
```
claude mcp add --transport http dukan https://dukan.studio/mcp
```
Any other MCP client — add a Streamable HTTP server:
```json
{ "mcpServers": { "dukan": { "type": "http", "url": "https://dukan.studio/mcp" } } }
```
Without a token the server offers two tools: `dukan_guide` and `dukan_start`.

## 2. Start the store

Call `dukan_guide` once (it is this text), then `dukan_start { name, subdomain? }` with the store's name (ask the human
if you do not know it; pass `subdomain` only if the human wants a specific one — otherwise it is derived from the name).
The reply holds, ONCE:

- `token` — the store's bearer. **Keep it.** Run the `reconnect` line the reply gives you, exactly:
  `claude mcp add --transport http dukan https://dukan.studio/mcp --header "Authorization: Bearer <token>"`
  (or set the `Authorization` header in your client's config). From then on every session is authenticated and the full
  tool set appears. Losing the token means losing the store — if you cannot persist it, write it in the human's project
  notes and say so.
- `code` — the human's dashboard pairing code (`DUKAN-XXXX-XXXX`, valid 24 h, one use). Give it to the human: *"Paste this
  at dukan.studio, step 2."* A fresh one is `dukan_pair_code` any time.
- `url` — the store's address. It answers "coming soon" until the first publish.

## 3. Build it with the human

Ask, in one friendly message, the few things a shop needs — do not interrogate:
what the shop is (one line), opening hours, phone / WhatsApp, address (a Google Maps share link is perfect), a sentence or
two about it, and whether they have photos or a menu / product list. Then:

1. `dukan_set { … }` — the profile (name, tagline, about, phone, whatsapp, email, address, mapUrl, hours, socials, items,
   images, accent, language, dir). Send what you have; send more later. Arabic stores: `language: "ar", dir: "rtl"`.
2. `dukan_add_image { name, base64 }` for each photo the human gives you (≤ 2 MB each, up to 30) — put the returned
   `/img/…` paths into `images` (gallery) or an item's `image`.
3. `dukan_templates` → `dukan_choose_template { id }` — pick for them (Corner for most shops, Counter for cafés and
   food, Rack for boutiques and products, Bare for a one-screen card) and say why; they can change their mind any time.
4. `dukan_publish` — live in seconds. Tell the human the url. Done.

Every later wish ("change the hours", "add a photo", "make it blue") is `dukan_set` + `dukan_publish` again.
`dukan_status` tells you where things stand and what a good site still lacks.

## 4. When the human wants more than a template

You can write the site yourself: `dukan_push_site { files: [{ path, content, encoding }] }` — plain HTML/CSS/JS/images,
`index.html` required, ≤ 200 files and 10 MB. It goes live at once, as a new version. Keep it static (no server code),
keep every link on the site or to the owner's own channels, and keep the "Made with dukan.studio" line somewhere.

## 5. Safety net

`dukan_versions` lists the last 20 publishes; `dukan_rollback { version }` makes an older one live again.
`dukan_export { version? }` hands you every file of the site (the human can keep it or host it anywhere).
`dukan_rename_subdomain`, `dukan_rotate_token` (old token dies), `dukan_delete { confirm: "<subdomain>" }`.

## Rules

- The human never needs to go anywhere but https://dukan.studio to paste a code. Never send them to a dashboard to
  "configure" something — there is nothing to configure there; you configure everything with the tools.
- Publish freely. There is no approval step and no owner to wait for.
- Never show the human the bearer token unless they ask; show them the pairing code and the url.
- Every reply from the server carries `next` — the sensible next step. Errors carry a `remedy`. Follow them.
- One store per token. If the human runs several shops, `dukan_start` again (each gets its own token and code).

Tools: `dukan_guide` · `dukan_start` · `dukan_status` · `dukan_templates` · `dukan_set` · `dukan_add_image` ·
`dukan_choose_template` · `dukan_publish` · `dukan_push_site` · `dukan_versions` · `dukan_rollback` · `dukan_pair_code` ·
`dukan_export` · `dukan_rename_subdomain` · `dukan_rotate_token` · `dukan_delete`.

Setup complete when the human has their url and their dashboard shows the site. There is nothing else for you to do.
