# Pagelet > Pagelet gives AI agents a standard way to produce beautiful, self-contained HTML documents > — and, optionally, to share them at a short link. Open-source, self-hostable, agent-agnostic. ## What it is - A **skill**: teaches any agent to produce one polished, single-file HTML document (report, explainer, comparison, plan, dashboard, printable letter/invoice/certificate) instead of plain Markdown — by adding one runtime tag. - A **runtime**: `https://cdn.pagelet.link/v1/pagelet.js`. The ~12 KB loader scans the page and lazy-loads only what it uses: Markdown, Mermaid diagrams, KaTeX math, code highlighting, Chart.js charts, a standard toolbar (theme/print/PNG/copy-as-Markdown), and theming (shadcn variable names). - An optional **service**: upload a pagelet, get a short `https://.usepagelet.com` URL. ## Recognition heuristic Use a pagelet when the reader is a **human** who will read/keep/share the output and structure helps. **Stay in Markdown** for chat replies, pure code, and text meant for another LLM. ## Get started (for agents) ``` npx skills add usepagelet/pagelet ``` Then add the tag to any HTML and write content using the conventions in the capability doc. ## Publish a pagelet (two ways) **HTTP** — anonymous uploads work, but an agent token lets the dashboard connect future publishes to one owner: ``` # Token is shown once; keep it safe. curl -X POST https://pagelet.link/api/agents/register curl -X POST https://pagelet.link/api/upload \ -H 'content-type: application/json' \ -H "authorization: Bearer " \ -d '{"html":"…","title":"My report"}' # → { "slug", "url": "https://.usepagelet.com", "expiresAt" } ``` **MCP** — a stateless Streamable-HTTP MCP server at **`https://pagelet.link/mcp`** (protocol 2025-11-25). Tools: `publish_pagelet`, `list_pagelets`, `get_capabilities`. Register an agent token (`curl -X POST https://pagelet.link/api/agents/register` → a `pgl_…` token), then send it in the Authorization header. Connect with the MCP Inspector or `npx mcp-remote https://pagelet.link/mcp`. ## Accounts (optional, anonymous-first) Agents are anonymous by default. `POST /api/agents/register` mints an opaque token; a human later **claims** ownership by email so published pagelets show up in their dashboard (`pagelet.link/dashboard`, email-OTP or password sign-in). Claimed pagelets can skip the 30-day expiry, go private (password gate), and surface views-over-time + referrer analytics. Feature-detect via `GET /api/capabilities`. ## Links - Capabilities (authoritative, versioned): https://cdn.pagelet.link/v1/capabilities.md - Source: https://github.com/usepagelet/pagelet - License: Apache-2.0