Publish an interactive artifact
publish_artifactPublish a self-contained interactive HTML page, React artifact or Cursor canvas into a Folio wiki, where it joins the page tree; send an id to replace an existing artifact's content.
Instructions
Publishes an interactive page (kind "artifact") into Folio: a Claude artifact, a Cursor canvas or any self-contained HTML page. It is shown in a sandboxed iframe and is in the tree, search, trash and Git like any page. Without id it creates a new artifact under parentPath of space; with id it replaces that artifact's content (id, path, properties and title/icon are kept unless sent).
How to send it: ONE self-contained HTML document in html (the entry page). It must run with no build step and no server: inline your CSS, JS and DATA (no fetch of your own APIs — the frame's CSP blocks other hosts). Scripts, styles and fonts may load only from cdnjs.cloudflare.com, cdn.jsdelivr.net, unpkg.com, cdn.tailwindcss.com, code.jquery.com, esm.sh (and Google Fonts).
A React artifact or a Cursor canvas (.canvas.tsx): build a standalone page that loads React from the CDN — e.g. + react-dom + @babel/standalone with holding the component, or importing from https://esm.sh/react@18 — map imports of libraries (recharts, lucide-react, d3, three…) to CDN/esm.sh URLs, replace cursor/canvas or shadcn components with plain HTML/CSS, and mount the component. Put the original JSX/TSX in sourceCode (kept as the source file; type react or canvas-tsx).
State: window.storage (the Claude artifact API: get/set/delete/list, async, string values, shared = seen by every reader) and localStorage both work and persist per reader; window.claude.complete does not (it rejects). Declare capabilities (claude, network, connectors) if the page needs more than storage — Folio shows a "works partially" note.
Also accepted instead of html: text with type svg / markdown / mermaid (Folio wraps it into a page), files (extra files next to the entry, utf8 or base64, referenced by relative path), url (a direct https link to an .html/.zip/.svg/.md file; claude.ai and Cursor share links are refused — send the HTML instead), embedCode (a Claude "Get embed code" ). Set sourceUrl to the original link (e.g. the claude.ai share URL) and origin (claude / cursor / other) when you know them. properties become page properties. Requires an editor role and a write-scoped token.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"space": "<space>"
},
"name": "publish_artifact"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Replace this artifact (its page id); omit to create a new one | |
| url | No | Import from a direct https link to an .html / .zip / .svg / .md file instead of html | |
| html | No | The entry page: one complete, self-contained HTML document | |
| icon | No | Emoji icon | |
| text | No | Raw svg / markdown / mermaid text (with type svg / markdown / mermaid) instead of html | |
| type | No | What the source was: html (default), react, svg, markdown, mermaid, canvas-tsx, embed | |
| entry | No | Entry file inside the artifact when it is not index.html | |
| files | No | Extra files of the artifact, referenced from the entry by relative path | |
| space | Yes | Space slug | |
| title | No | Page title (new artifact: default the HTML <title>) | |
| origin | No | Where it came from: claude, cursor, url, upload or other | |
| embedCode | No | A Claude embed code (<iframe src=...>) — creates an embed artifact | |
| sourceUrl | No | Link to the original (e.g. the claude.ai share URL) — stored, never fetched | |
| parentPath | No | New artifact only: folder from the space root ("" = root), e.g. "reports" | |
| properties | No | Page properties (status, owner, tags, …) | |
| sourceCode | No | The original JSX/TSX (or other source) of a React artifact / Cursor canvas, kept verbatim | |
| capabilities | No | What the page needs from its host besides storage: claude, network, connectors | |
| sourceFileName | No | File name for sourceCode (default source.jsx, or source.canvas.tsx for type canvas-tsx) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Page id of the artifact | |
| url | Yes | Link to the page in Folio | |
| path | Yes | Path of the artifact folder (<slug>.artifact) relative to the space root | |
| space | Yes | ||
| title | Yes | Page title | |
| created | Yes | True when a new artifact was created, false when an existing one was replaced | |
| warnings | Yes | Non-fatal notes (e.g. a capability Folio does not provide) |