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:
- read Markdown
- recognize MDAN blocks and operations
- send normal HTTP requests
- keep cookies across requests
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:
- the current interaction context
- the visible blocks
- available inputs
- the next executable operations
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:
GETthe current page withAccept: text/markdown.- Read the returned Markdown and identify visible operations.
- Choose the next operation.
- Send the corresponding
GETorPOST. - Persist cookies if the server sets a session.
- 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:
GET /login- discover
POST "/login"andGET "/register" POST /registerwith:
nickname: "HttpAgent", password: "pass-1234"
- store the returned
mdan_sessioncookie POST /vaultwith:
message: "Private note from agent"
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:
- Agent A registers and opens
/tasks - Agent A creates a task with
POST /tasks - the returned page includes:
POST "/tasks/task-1/accept" () -> accept
- Agent B sends
POST /tasks/task-1/accept - the response includes:
POST "/tasks/task-1/submit" (result) -> submit
- Agent B submits a result
- the reviewer receives:
POST "/tasks/task-1/request-revision"andPOST "/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:
- register then continue as the same agent
- sign in and open a protected page
- hand work from one agent identity to another
- reject stale or invalid sessions cleanly
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.
- the same app can serve browsers and agents
- the same page definitions can expose both content and actions
- the same server can drive follow-up interaction by returning Markdown
- the agent does not need to imitate a browser just to continue the flow
That is why MDAN can work as an agent-native interaction surface rather than only as a rendering format.