Source: https://www.scrawlee.com/docs/limits

# Scrawlee, for AI agents

Scrawlee hosts static web apps, browser games and demos ("Scrawls"). Each Scrawl has a page at `https://www.scrawlee.com/s/<id>` (play, like, star, comment) and runs on its own origin, `https://<id>.scrawlee.me`. No code of the author runs on a server. This guide is for agents that help a person publish on Scrawlee, through the site or through the MCP server. The person-facing documentation is `https://www.scrawlee.com/docs`.

## Working with the person

- Prefer showing them what to click on the site when they are there; use the MCP tools when they asked you to do it.
- Two accounts per person at most. Never suggest another account to get around a limit or a sanction: extra accounts are suspended or banned.
- Everything in a Scrawl is public: never put API keys, tokens or passwords in its files.
- A `scrawlee.yml` at the root of the published files declares the Scrawl's cloud data (values stored and shared through Scrawlee, rooms); add one only when the person asks for that (topic `cloud`). Publishing refuses it with every problem and its line until it is valid (schema for editors: `https://www.scrawlee.com/schema/scrawlee.yml.json`). No other name (`scrawlee.yaml`, `scrawlee.json`) is read.
- Scrawls have no versions: a Scrawl has its files online and, while it changes, an update that is not live until published. Never talk about version numbers to the person.
- Every Scrawl must be free and open to anyone with its link (no paywall, password or third-party login gate). It may require a Scrawlee account only if it cannot work without one (each player's progress, playing together), never to choose who may play: the username a player shares must not be used to restrict access. Malware, phishing, crypto mining with visitors' devices, and buying or trading likes, stars or follows are banned.

## Guiding the person through the site

Labels below are the exact words on the site.

- **Create** (top bar): "Where is your code?"
  - "In a git repository": a button per provider (GitHub, GitLab, Bitbucket, Gitea, Codeberg); "Connect" when not connected yet, then pick the repository and the branch. Build settings are filled in from the repository at once; check them, open the build settings to change a value.
  - "Or in a folder on your computer": "Drop a folder here" or "Browse" (on phones, "Choose a folder"). A built folder is published as it is; a source folder is built first.
  - "Details": title, description, thumbnail, tags, then "Visibility" (Public: "In feeds, search and your profile"; Unlisted: "Only people with the link"), "Comments", "Auto-update" (git only). Then publish; the build screen shows each step with an estimate; "View Scrawl" at the end.
- **The Scrawl's page** (owner): "Edit" (title, description, link description, thumbnail, tags, comments on or off) and a "Manage" menu: "Rebuild now", "Build log", "Publish every push" / "Turn off auto-update", "Make public" / "Make unlisted", "Delete Scrawl".
- **Settings** (account menu): Profile, My Scrawls (published, unlisted and drafts), Account (email, username, download your data, delete account), Security (sessions and devices, passkeys, two-factor, recovery codes, linked sign-in providers), Git providers (connect, disconnect, manage the GitHub app's repositories), Connected apps (AI apps and their access), Notifications, Quotas (what the account uses), Sanctions (decisions and appeals).
- **Docs** is `https://www.scrawlee.com/docs`, one page per section (footer link "Docs"); **Contact** is `https://www.scrawlee.com/contact` (a guided form for help or ideas). Report a Scrawl, comment or profile with "Report" on it.
- A GitHub repository missing from the list: the Scrawlee GitHub app only sees the repositories it was given. Settings, Git providers, manage the app's access, add the repository or the organization, then refresh the list.

## Doing it through MCP

The MCP server is `https://mcp.scrawlee.com` (OAuth with PKCE). Scopes the person grants: read Scrawls, read their unlisted ones, prepare drafts, publish, social (like, star, comment).

- **Publish a built folder, with a shell** (fastest, binaries included):
  1. `list_my_scrawls` to find the Scrawl, or `create_scrawl_draft` for a new one.
  2. `get_upload_url`: an address that lasts 1 hour and takes 20 uploads, up to 100 MB gzipped and 1 GB unpacked.
  3. `tar -czf - -C dist . | curl -sS --fail-with-body -T - '<upload_url>'` (the folder that holds `index.html`). The JSON reply has the update (not live yet, with its `update` id) and its warnings.
  4. Fix every warning (see "Upload warnings") and upload again; each upload replaces the update the previous one made.
  5. `publish_scrawl`.
- **Without a shell**: `upload_scrawl_files`, text in `files` and binaries as base64 in `binary_files`, about 6 MB per call.
- **Change a few files of a published Scrawl**: `list_scrawl_files` and `read_scrawl_file`, then `upload_scrawl_files` with `base: "live"`, only the changed files, and `delete` for removed paths.
- **Unpublished uploads** never go live. A Scrawl keeps at most 3; drop one with `abandon_upload` (`get_my_scrawl` lists them). An upload never published expires after 24 hours.
- **Build from git**: `build_scrawl` on a Scrawl that has a git source, then `get_build` until it ends; `list_my_builds` lists past ones. A failed build's log ends with the cause.
- **Edit details**: `edit_my_scrawl` (title up to 80 characters, description up to 2000, link description up to 140, up to 5 tags of 24 characters: lowercase letters, digits and dashes).
- **Social**: `star_scrawl`, `comment_on_scrawl` (comments up to 800 characters), at most 8 comments and 30 stars per hour from AI apps.
- **This guide**: `get_scrawlee_docs` with one `topic` (rules, interface, mcp, repository, detection, builds, checks, cloud, limits); without one it lists them. Read only the section you need.
- **Keep calls small**: `read_scrawl_file` returns 16 KB by default (64 KB at most, then `offset`), `get_build` the end of the log, `search_scrawls` 10 results.

## Preparing a repository that publishes well

Scrawlee publishes static files. Before suggesting changes to a repository, check what it builds to.

- **Static output.** Next.js: `output: 'export'` in next.config. SvelteKit: `@sveltejs/adapter-static` (with `fallback` only if the app uses client routing, see Routing). Nuxt: `nuxt generate`. Astro: no server adapter. React Router or Remix: SPA mode. Angular: the default browser build. Anything with API routes, server actions or server-side rendering at request time will not work.
- **No base path.** A Scrawl is served at the root of its own origin. Remove `base: '/repo/'` (Vite), `basePath` (Next.js), `paths.base` (SvelteKit), `site`/`base` meant for GitHub Pages, `baseurl` (Jekyll), `baseURL` with a path (Hugo).
- **Routing.** Paths that are not files return 404: there is no fallback to `index.html`. Use hash routing (`createHashRouter`, `createWebHashHistory`, `HashRouter`) or prerender one `index.html` per route. `/about` works when `about/index.html` exists (it redirects to `/about/`); `about.html` alone does not answer `/about`.
- **Pin Node** with `.nvmrc` (or `.node-version`, `.tool-versions`, `mise.toml`, `.npmrc use-node-version`, Volta). Commit the lockfile so installs are reproducible (`npm ci`, `pnpm install --frozen-lockfile`, `yarn install --immutable`).
- **Monorepos.** Keep the site in one package with its own `package.json` and a `build` script; workspaces (npm, pnpm, Yarn, Turborepo) install at the root and build only that package. The person can set the root folder in the build settings.
- **No secrets, no environment variables.** Build settings have none. Public configuration belongs in the code.
- **Threads.** No cross-origin isolation: no `SharedArrayBuffer` or WebAssembly threads. Godot 4: turn Thread Support off in the Web export; Emscripten: no `-pthread`.
- **Inside the Scrawl page** the frame allows scripts, same-origin storage, fullscreen, gamepads, pointer lock, autoplay, forms, popups, dialogs and clipboard writes. Camera, microphone, location and downloads are blocked there. Storage (localStorage, IndexedDB) belongs to the Scrawl's own origin and survives updates; cookies should use the `__Host-` prefix.
- **Thumbnails** are uploaded by the person (16:9, PNG, JPEG or WebP, up to 5 MB); never captured automatically.

## How build settings are detected

Scrawlee fills in the build settings from the repository (or the dropped folder); the person can change every value. Knowing the rules lets you make a repository detect cleanly.

1. **Where the site is.** The repository is listed (up to 20,000 paths, 6 levels, without `node_modules`, `vendor`, `target`, virtualenvs and `.git`). Folders that look like a project are ranked from their files alone, then up to 60 files are read. A package with a framework and a build script beats one without; a package published as a library (`main`, `exports`, `bin`…) with no page of its own is pushed down.
2. **Package manager**, from the lockfile or `packageManager`: npm (`package-lock.json`, `npm-shrinkwrap.json`), pnpm (`pnpm-lock.yaml`), Yarn (`yarn.lock`, `.yarnrc.yml`), through Corepack. A lockfile makes the install frozen. Bun is not on build machines: `bun.lock` projects install with npm, with a warning.
3. **Framework**, from the dependencies, in this order: Astro, SvelteKit, Nuxt, Next.js, React Router, Remix, SolidStart, Gatsby, Docusaurus, VitePress, VuePress, Eleventy, Hexo, Angular, Quasar, Create React App, Vue CLI, Slidev, Expo (web), Ember, Stencil, Preact CLI, Rsbuild, Vite, Parcel, webpack, esbuild. Its config file is read for the output folder (`outDir`, `distDir`, adapter `pages`…), and a server setup gives a warning.
4. **Hosting files** win when present: `netlify.toml` (`base`, `publish`, `command`, `NODE_VERSION`) and `vercel.json` (`buildCommand`, `outputDirectory`).
5. **Other generators**, from their config: Hugo (`hugo.toml`…), Jekyll (`_config.yml` + `Gemfile`), MkDocs (`mkdocs.yml`), Sphinx (`conf.py`, Read the Docs config), Pelican, mdBook (`book.toml`), Trunk and Dioxus (Rust). The tools they need (Python, Go, Rust, Hugo, Ruby) are added.
6. **Node version.** Pins (`.nvmrc`, `.node-version`, `.tool-versions`, `mise.toml`, `.npmrc use-node-version`, `volta.node` in the folder and its parents, Netlify's `NODE_VERSION`) are matched against the requirements (`engines` and `devEngines` of package.json, the engines locked in the lockfile, the framework's minimum). The first available major (18, 20, 22, 24, 26) that satisfies them is suggested, the pinned major when it fits, else 24, else the newest that fits, with a warning when a pin had to be overridden. Left empty, a build uses 22.
7. **No build at all**: a folder with `index.html` at its root and no project file is published as it is.

## Builds

- Build time: 120 minutes per account and month (UTC); a build stops after 30 minutes. Publishing an already built folder takes none.
- Steps: preparing a machine, installing, building, publishing. The log keeps the commands' output; its last lines name the failure.
- Common failures and fixes: lockfile out of date with `package.json` (reinstall, commit the lockfile); output folder not the one the build writes (fix it in the build settings); Node too old or too new for a dependency (pin a version); a framework set up for a server (switch to static output); a missing tool for a generator (add it in the build settings).
- Auto-update publishes each new commit of the branch within a couple of minutes. What is online stays until a new build works.

## Upload warnings

Every upload is checked; each warning would leave a blank or broken page. Fix them before `publish_scrawl`.

- **Server-rendering template**: an HTML page still holds `<!--app-html-->`, `<!--ssr-outlet-->` or `%sveltekit.body%`. Build the static output instead.
- **Source code the browser cannot run**: a page loads `.ts`, `.tsx`, `.jsx`, `.vue`, `.svelte`, `.scss`, `.sass` or `.less`. Upload the build output, not the sources.
- **Bare import**: `import x from 'react'` without an import map. Bundle the code or import from a full URL.
- **Missing file**: a page, stylesheet or script refers to a file not in the upload (names are case-sensitive).
- **Above the root**: a reference climbs out of the Scrawl (`../x.js` from the root).
- **Local server address**: `http://localhost:` or `http://127.0.0.1:` in a file.

## Cloud data

Only when the person asks for it (values saved or shared through Scrawlee, people playing or working together live). Two parts:

- `scrawlee.yml` at the root of the published files (in `public/` for Vite and most frameworks, so it is served as is): `cloud:` with `data:` (each variable: `scope: shared|own|public`, `type`, its bounds and an optional `write` rule such as `add`, `increase` or `once`, `rate` such as `10/min`, `rank` for a public number) and `rooms:` (each kind: `max_members`, `state`, typed `messages`). Every string needs `max_length`, every list `max_items`, every map `max_entries`. Publishing refuses a file with problems and lists them with their line.
- The `scrawlee` package, from npm (`npm install scrawlee`, `import { cloud } from 'scrawlee'`) or, without a bundler, `import { cloud } from 'https://www.scrawlee.com/sdk/v1.js'` in a `<script type="module">`. React: `useCloud(name)` from `scrawlee/react`; Vue: `useCloud(name)` from `scrawlee/vue`; Svelte: a value is a store (`$score`).

```js
const me = await cloud.ready()            // { mode, user: { id, name } | null, access }
const score = cloud.data('score')
await score.set(12)                       // rejects with error.code: 'rule', 'invalid', 'no_access'...
score.watch((v) => show(v))               // live, as Scrawlee stored it
const room = await cloud.room('match').join()   // or join('code')
room.on('move', (data, from) => apply(data))
room.send('move', { x: 1 })
```

The first write opens Scrawlee's consent panel by itself (`cloud.ask()` opens it on purpose). Opened outside Scrawlee the Scrawl only reads; on `localhost` (a dev server) the package runs a local mode: data kept in the browser, each tab another person, the same rules as the file. The Scrawl never gets the person's account or email: an id made for this Scrawl and the name they chose (or none). A Scrawl must not let people send each other negative content (no free chat), and may require a Scrawlee sign-in (`sign_in: required`) only if it cannot work without one.

## Limits

Every account has the same limits.

- Storage: 500 MB. New Scrawls: 20 first publications per rolling seven days. Deployments: 20 successful publications per rolling 24 hours across the account, including updates. Only first publications also use a weekly slot. Drafts: 50.
- A Scrawl's files: up to 1000 files, 25 MB per file, 100 MB in all. Updates not live yet: 3 per Scrawl, kept 24 hours.
- Images (avatar, thumbnail): 5 MB.
- Build time: 120 minutes per account and month (UTC); a build stops after 30 minutes. Publishing an already built folder takes none.
- Usernames: 3 to 16 characters (letters, digits, `.`, `_`, `-`, starting and ending with a letter or digit), changed once every 30 days.
- AI apps: 8 comments and 30 stars per hour.