MCP and agents
What an agent reads and runs today (llms.txt, the .md twins, /openapi.json, explain, the graph's verbs over the index durable-sdk index writes, AGENTS.md and the four skills), how it signs up with a key, and the MCP that is coming.
This page is for an agent operating a Durable app, and for the person setting one up. It teaches what exists for an agent today: every docs page as Markdown, the OpenAPI document, durable-sdk explain, the graph's verbs over the index the template writes and durable-sdk index rewrites, the AGENTS.md and the four skills every app carries; and names what is coming: durable-sdk mcp (DS-025) and the hosted MCP at https://durablesdk.com/mcp (DS-026).
What exists#
| Surface | Where | What it is |
|---|---|---|
/llms.txt |
https://durablesdk.com/llms.txt |
The index: the product in one paragraph, then every docs page as - [title](url): summary, the API and the CLI reference first. |
/llms-full.txt |
https://durablesdk.com/llms-full.txt |
Every docs page's Markdown in order, each under its H1, a --- rule between. |
The .md twins |
https://durablesdk.com/docs/<slug>.md, or Accept: text/markdown |
Every page's source, front matter stripped, the links absolute. Fetch the page you need and follow its links; never scrape the HTML. |
/openapi.json |
https://durablesdk.com/openapi.json |
The platform API, OpenAPI 3.1, rendered from the route table: every route, its scope, its schemas, PlaneError; the operator contract's catalogue under /apps/{slug}/console/<path>. API reference. |
durable-sdk explain <code> |
the CLI, offline | The registry row for an error code, a refusal id a door threw, or a doctor rule: the sentence, the trap, the remedy. --json for the row as data. The platform's plane.* codes and the engine's are one table. Errors. |
--json on every verb |
the CLI | The route's answer verbatim on stdout, progress on stderr, a refusal as { "error": { "code", "message", "remedy", "docs" } }; the exit grammar 0/1/2/3. CLI reference. |
AGENTS.md |
the root of every app durable-sdk init writes |
What the app is, its file map, the commands, the rules a workflow must keep, where the console is, how to log in, the docs URL. CLAUDE.md is @AGENTS.md. Beside it, .claude/skills/durable/: the four generated skills (write a workflow, debug a run, redrive safely, ask the graph), the SDK's procedures rendered for the app, every command and tool in them checked against the CLI and the MCP at generation. |
durable-sdk doctor --host |
the CLI, offline | Every guard rule over the tree; a finding is one line with its fix and the rule's id; --explain <rule id> says the law and the hazard. Run it before and after any change. |
durable-sdk explain <subject>, graph walk, graph path, graph impact --changed, graph diff --base |
the CLI, offline, over the graph-index.json the template writes at the app's root |
The graph asked, never read whole: a door's card with the run it admits, a workflow's steps with their writes, a fact's listeners, the closure from any node, the first chain between two, the blast radius of a change (what it reaches) and what the graph gained, lost and changed against a ref. The index is durable-sdk index's, written at the root: the template's build runs it and durable-sdk test --changed checks it first. --api <url> reads a deployment's live graph with its bearer; a hosted app's bearer is sealed, so --api is a self-hosted app's, and the hosted walk is the console proxy's GET /api/v1/apps/<slug>/console/catalog/graph?from=<node>. Vibe coding with the graph. |
Coming#
durable-sdk mcp [--app <slug>](DS-025): the MCP server over the platform's console proxy with your key, stdio, for a laptop's agent: the tools derived from the operator contract (runs, a run's bundle, limbo, redrive, explain,graph_walkfor the graph's walk, and the checkout's two,graph_explainfor its card andgraph_impactfor a change's radius, read off the index of the directory the server runs in), the two prompts (triage,explain_run), the resources (durable://limbo,durable://runs/{id}).durable-sdk mcp install --client claude-code|cursorwill write the client's config with a${DURABLE_API_KEY}reference, never a value.- The hosted MCP at
https://durablesdk.com/mcp(DS-026): streamable HTTP, the key as bearer, the same tools, no install.
Until then an agent reads an app's runs through the console proxy routes of the API (GET /apps/:slug/console/runs, .../runs/limbo, .../runs/:id/bundle) with a key, its graph through GET /apps/:slug/console/catalog/graph?from=<node>&depth=2&format=text (the walk's lines, the body edges once the build has run durable-sdk index), and redrives with POST /apps/:slug/console/runs/:id/redrive. A destructive action (a dismiss, an undo) is a person's, from the dashboard, under every surface.
For agents#
Sign up with a key#
A key is minted by a person. Ask for one from https://durablesdk.com/dashboard/keys with the scope the task needs (read to look, deploy to deploy and operate, admin to create or delete an app), and hold it in the environment:
export DURABLE_API_KEY="dsk_live_…"
printf '%s' "$DURABLE_API_KEY" | durable-sdk login --with-key
durable-sdk whoami --jsonA key never mints a key (plane.key.mint_by_person); do not try. A key expires (90 days from the device flow; 30, 90 or 365 from the dashboard): whoami says when.
The commands to run first#
npx durable-sdk init my-app # the template; judged under the slug grammar first
cd my-app
durable-sdk doctor --host # green before you change anything
durable-sdk test --changed # the template's own test passes
durable-sdk apps create my-app # provisioned; .durable-sdk/app.json written
durable-sdk deploy --prod --json # the Deployment as data; exit 0 on promoted
curl -s https://my-app.durablesdk.com/health
durable-sdk logs --followIn an app that exists: durable-sdk apps link <slug> once, then deploy, logs, secrets, runs limbo take the app from .durable-sdk/app.json.
How to read an answer#
- Exit 0: the thing asked stands. Exit 1: the verb's own red (a failed build, a red check); read the
erroron the--jsonbody and rundurable-sdk explain <code>. Exit 2: the request was refused or a flag is wrong; theremedyis the next action. Exit 3: the platform is unreachable; wait and retry with the sameIdempotency-Key. - A sentence a door throws in your own code is a refusal id (
workflow.key.reads_clock,step.undo.declares):durable-sdk explain <id>says the trap and the remedy. Do not work around a refusal; do what it says. - A deployment's
checkrows name what the platform read on the new build before promoting it; afailrow stands on its own hostname and was never promoted.
What never to do#
- Never print, log, store or echo a key, a read string,
ADMIN_TOKENor any value fromdurable-sdk secrets set. A value moves on stdin;--env-filewrites the read string to a file. - Never call
beginRun,runSaga,finishRunorappendLedgerby hand; every side effect is a step inside adefineWorkflow()started with.execute(). - Never read the clock, randomness or the environment in a key or a run body outside a step; the moment rides in the input as
requestId. - Never write a step without an
undoor anirreversible: "<reason>"; never catch aroundctx.step; neverPromise.allover steps (ctx.all). - Never edit a ledger row, delete the engine's tables or run
migrate downon production. - Never set a reserved variable name (
DATABASE_URL,CRON_SECRET,ADMIN_TOKEN, …) as a secret; the door refuses it and the platform owns them. - Never deploy with a red
durable-sdk doctor --host.
The reading order#
https://durablesdk.com/llms.txt.- Quickstart and Concepts.
- Writing a workflow, Steps and undo, Vibe coding with the graph.
- CLI reference, API reference, Errors.
- The app's own
AGENTS.md.
Every docs page carries a task line in its front matter, one sentence an agent can be handed, and a "Copy as prompt" control that wraps it: read this page as Markdown, do the task, run durable-sdk doctor --host before and after, and treat a refused line as a refusal id for durable-sdk explain.