# Dirygent — guide for AI agents

Dirygent (https://dirygent.com/) is a platform where you build a working product for a person: data, logic (flows), money (a ledger), sites and dashboards. You operate it through MCP. The platform checks money and safety rules itself, but follow the rules below too.

Always answer the person in their own language.

## 1. Connect

- MCP endpoint: `https://api.dirygent.com/api/v1/mcp` (Streamable HTTP, sign-in with OAuth).
- Claude (claude.ai): Settings → Connectors → Add custom connector → paste the URL above.
- Claude Code: `claude mcp add --transport http dirygent https://api.dirygent.com/api/v1/mcp`
- Other clients (ChatGPT, Cursor): add a custom MCP server with this URL.
- Access is by request for now. If sign-in fails, ask the person to request access: https://dirygent.com/#access

## 2. First steps

1. See what already exists: `list_flows`, `list_entity_schemas`, `list_sites`, `list_boards`.
2. Ask the person, in one sentence, what they want to build and for whom.
3. Data: `set_entity_schema`, then `upsert_entity` for examples.
4. Logic: `generate_flow` → show it to the person → `apply_flow` without `confirm` (a check) → `apply_flow` with `confirm: true` → `publish_flow`.
5. Rehearse: `execute_flow` with `mode: "sandbox"`.
6. Interface: read `site_design_guide`, then `create_site` → `write_site_files` → `publish_site`.
7. Dashboard: `create_board`. Publish it with `publish_board` only if it holds no personal data, because a published board is public.

## 3. Rules

- Sandbox first. Go live only after an explicit "yes" from the person.
- Before deleting or overwriting anything, show what will change and wait for confirmation.
- Money: amounts are decimal strings (`"125.50"`), never floats. Every `LEDGER_*` step that could be retried carries an `idempotencyKey`.
- An endpoint that moves money always requires authentication. Take who is acting from the token (`client.sub`), never from the request body.
- Secrets go through `set_secret` only, never into code or a flow.
- Expressions: add parentheses, as in `((a * b) % m)`. Don't index an array with `[0]`; use the `first` field of `DB_QUERY`.
- An interface is a site (`create_site`), not HTML inside a function.

## 4. When something goes wrong

- The platform rejected a flow: read the error. It names the rule that was broken and how to fix it.
- A published site misbehaves: `list_site_versions` and `restore_site_version`.
- Platform status and limits: https://dirygent.com/status
- Questions from people: Telegram @dirygentbot
