MDAN MDAN Docs
Site

Direct Agent Consumption

MDAN is meant to be consumed directly by agents.

An agent does not need a headless browser, a separate MCP wrapper, or a custom runtime layer before it can use an MDAN app or continue an interactive Markdown page.

If the agent can:

it can continue the interaction on its own.

What The Agent Reads

The agent usually asks for Markdown:

Accept: text/markdown; profile="https://mdan.ai/spec/v1"

The server then returns a Markdown page or fragment that already contains:

That response is not just content. It is the next interaction surface.

What The Agent Sends

For write operations, the agent sends normal HTTP requests with a Markdown body:

Content-Type: text/markdown

The request body is not arbitrary prose. It should use MDAN's direct-write body format:

nickname: "Ada", password: "pass-1234"

Another example:

message: "Private note from agent"

If the body does not match the expected format, the server can reject it with a recoverable error.

Minimal Consumption Loop

A simple agent loop usually looks like this:

  1. GET the current page with Accept: text/markdown.
  2. Read the returned Markdown and identify visible operations.
  3. Choose the next operation.
  4. Send the corresponding GET or POST.
  5. Persist cookies if the server sets a session.
  6. Continue from the returned page or fragment.

That is enough to support many real app flows.

Example: Auth Session

In the auth-session example, an agent can:

  1. GET /login
  2. discover POST "/login" and GET "/register"
  3. POST /register with:
nickname: "HttpAgent", password: "pass-1234"
  1. store the returned mdan_session cookie
  2. POST /vault with:
message: "Private note from agent"
  1. POST /vault/logout

The important point is that each response already tells the agent what it can do next.

Example: Agent Tasks

In the agent-tasks demo, one agent can create a task and another can take it over directly through MDAN pages.

The flow looks like this:

  1. Agent A registers and opens /tasks
  2. Agent A creates a task with POST /tasks
  3. the returned page includes:
POST "/tasks/task-1/accept" () -> accept
  1. Agent B sends POST /tasks/task-1/accept
  2. the response includes:
POST "/tasks/task-1/submit" (result) -> submit
  1. Agent B submits a result
  2. the reviewer receives: POST "/tasks/task-1/request-revision" and POST "/tasks/task-1/complete"

This is direct handoff over HTTP. No browser automation is required.

Cookies And Session State

Agents should keep cookies the same way any HTTP client would.

That is enough for flows such as:

Session handling stays inside ordinary HTTP semantics. MDAN does not need a separate agent session channel.

What This Proves

Direct consumption matters because it keeps the app surface unified.

That is why MDAN can work as an agent-native interaction surface rather than only as a rendering format.