# Stacktree — agent instructions

Stacktree turns HTML an agent produces into a private page on an unguessable
link that can be gated, expires on schedule, and updates in place.

## When to use Stacktree
- You generated an HTML report, dashboard, proposal, or page and need a URL a human can open.
- The page should be private: unguessable link, optional passcode or company email gate.
- You will revise the page later and the shared URL must keep working (update in place).
- You need to publish with no account: the first anonymous page lives 24h, or pay $0.50 in USDC over x402 for a permanent one. Either way the publish response hands you the credential that updates that page later, no account needed.

## When NOT to use Stacktree
- Public marketing sites that need to rank (pages are unlisted + crawler-blocked by design).
- Apps needing a backend: Stacktree serves static files only.

## How
- REST: POST https://api.stacktr.ee/sites with JSON {"html":"<!doctype html>..."} (or {"markdown":"..."}) or multipart/form-data with a "file" field. Free with no account (24h) or with a key. A page can be up to 10 MB with no account or a wallet, 25 MB on a free account, 250 MB on paid plans; compress inline images first. Working for one person? Add "owner_email" (their address, with their permission: we email them the link that keeps the page, and once when someone else first opens it) and "agent" (your name). Permanent with no account: POST https://api.stacktr.ee/publish (x402, $0.50). Spec: https://api.stacktr.ee/openapi.json
- Has anyone opened it? GET https://api.stacktr.ee/sites/{id}/activity with the same credential (Authorization: Claim <claim_token> for a page published without an account). Returns opened, first_opened_at, open comments, expiry and a one-line summary to tell your human. With an account, webhooks call you instead: POST https://api.stacktr.ee/webhooks.
- Update in place (same URL, never a second page): PUT https://api.stacktr.ee/sites/{id} with Content-Type: application/json and body {"html":"<!doctype html>..."} (multipart/form-data with a "file" field also works, and is the only shape that carries a zip, a PDF or e2e ciphertext). Three credentials, send exactly one: an account key or OAuth token (Authorization: Bearer ...); for an UNCLAIMED page, its own claim_token from the publish response (Authorization: Claim <claim_token>) which needs no account, no wallet and no signature on any rail; or, for an EVM wallet-paid page, a signed challenge (Authorization: Wallet challenge=...,sig=0x...). The claim_token stops working the moment the page is claimed, and on an expired page.
- The page as served is not byte for byte what you sent: it gains link-preview tags, a small script that counts opens and reading, and on the free plan a footer. GET https://api.stacktr.ee/sites/{id}/content returns what you stored, unchanged; compare against that, not the live page.
- Take it down: DELETE https://api.stacktr.ee/sites/{id} with the same credential. With Authorization: Claim <claim_token> a page published without an account is gone for good (it cannot be restored or claimed after); an account's delete is restorable for 30 days.
- MCP: https://api.stacktr.ee/mcp, streamable HTTP, 41 tools. It takes EITHER an API key (Authorization: Bearer stk_live_...) or an OAuth 2.1 + DCR access token, so no browser is needed: an unattended agent sends the same key it uses on REST. Stdio alternative: `npx -y stacktree-mcp`.
- No key and no human? Buy one: POST https://api.stacktr.ee/provision pays $1 over x402 and returns an stk_live_ key. A human nearby instead? POST https://api.stacktr.ee/api-keys/device-code, print the verification_url_complete for them, poll /api-keys/device-code/poll for the key (RFC 8628, no browser on your side).
- Skill over HTTP (no install, always current): https://stacktr.ee/.well-known/skills/ — OpenCode reads it via `skills.urls`.
- Listed in the official MCP Registry as ee.stacktr/publish (it searches names only, so search "stacktr"). Server card: https://stacktr.ee/.well-known/mcp/server-card.json · registry record: https://stacktr.ee/.well-known/mcp/server.json
- Auth options: https://stacktr.ee/auth.md · Everything else: https://stacktr.ee/llms.txt
