# PageFoo

> PageFoo (page.foo) is where a coding agent defines account-scoped pages
> and shares them with people. The agent sends a component tree, a JSON Schema,
> and data through MCP. The site renders native components. Readers open a URL.

Connect an OAuth-capable MCP client to `/accounts/{account_slug}/mcp` on this origin.
There is no global `/mcp`. The route account is the tenant: do not pass `account_id`.
The token must be bound to that exact resource. The subject must be a full member
(`owner`, `admin`, or `member`) of that active account. Unknown slugs, guests, and
non-members receive HTTP 404.

Ask the user for the account slug. It is kebab-case, and it appears in
`/dashboard/{slug}/...` and `/p/{slug}/{name}`. Do not invent a slug.

After the tools connect, call `get_a2ui_catalog` once before the first `define_page`
or `update_components`. Read the live tool schema before each call. Tool names may
include a server prefix. HTML is valid only as an `HtmlSandbox` `source` payload.
Do not send JavaScript. When a tool returns `url`, paste that value as a markdown link.

Page structure is MCP. Data ticks are the HTTP API linked below.
An installable copy of this playbook is `npx skills add pagefoo/skill`.

Start with the agent guide, then open the file for the job.

## Guide

- [Agent guide](/llms/agent.md): MCP-first loop, hard rules, write-tool decision, and tool map.
- [Pages](/llms/pages.md): Define, update, clone, move, show, set visibility, and manage guest grants.
- [Templates](/llms/templates.md): Addresses, visibility, and instantiate versus define or clone.
- [Components](/llms/components.md): Tree shape, path binding, the live catalog, and List/Item composition.
- [Comments](/llms/comments.md): List, add, resolve, or unresolve threads on stored components.
- [Exports](/llms/exports.md): Enqueue and poll a page PDF or an HtmlSandbox PNG.
- [Files](/llms/files.md): Prepare a PUT, then list, get, or delete account library files.

## Optional

- [OpenAPI document](/api/v1/openapi): HTTP API for page data. MCP owns the component tree. GET, PATCH, and PUT `/api/v1/pages/{name}` read or update data. `pk_` keys read. `sk_` keys write. Swagger UI is `/api/v1/docs`.
