Skip to content
anvilninePublic

About

Self-hosted artifact publishing. POST HTML/JSX/Markdown/zip, get an unguessable public URL. MCP server built in.

Topics

Resources

Contributing

Security policy

Stars

8 stars

Watchers

1 watching

Forks

Repository files navigation

artifacts

Self-hosted, Claude-style artifact publishing

POST HTML, a React component, Markdown, a PDF, a zipped static site, or an Android or iOS build. Get back an unguessable URL on your own domain.

CI License: MIT Node >= 22 Docker image on ghcr.io Listed in the MCP registry

Features • Quick start • Docs • Deploy • API • CLI • MCP • FAQ • Security

Dashboard: publish, group by project, and manage artifacts
The dashboard: drop files to publish, group by project, copy a link.


About

AI assistants produce a lot of shareable output: dashboards, prototypes, reports, small apps. Claude's hosted artifacts work well, but the URLs live on someone else's infrastructure. This is the self-hosted version. You POST content, it serves the rendered result at an unguessable URL on a domain you control.

It runs as one container with a single admin account and, by default, no database. Each artifact is a directory of plain files under /data, so backing up that directory backs up everything. On hosts that wipe local disk on restart, point it at durable external storage instead (an S3-compatible bucket, a git remote, or Postgres) by setting STORAGE_BACKEND. See deploying.

Features

  • Content types. HTML, JSX/TSX (a single React component, no build step), Markdown, BPMN 2.0 process maps, PDF, zipped static sites, and APK, AAB and IPA app builds.
  • Agent-native, human-friendly. A built-in MCP server lets Claude Code, Codex, or any MCP client publish with one tool call. Humans get a drag-and-drop web UI at / (behind an admin login) and a CLI.
  • Two-tier auth. An admin logs into the dashboard with a password; CLI and MCP carry scoped, revocable API keys (read / publish / full) with optional expiry, so you never share one master secret.
  • Private by default, with per-artifact visibility. A new artifact is private, shared through a signed capability link (?k=…) you can rotate to revoke. Switch any artifact to public (anyone with the bare link) or password-protected. Nothing is discoverable by default: unguessable slugs, noindex everywhere. See visibility.
  • Optional viewer frame. A slim top toolbar (title, copy link, hide) like Claude, Gemini, and ChatGPT artifacts. Toggle it globally in Settings or per artifact; ?raw=1 serves the bare content. Redirects and app install pages are never framed.
  • Markdown render settings. Pick the reading font, content width, base font size, and starting theme for every Markdown artifact in Settings. Markdown renders from its source on each view, so a change shows on existing artifacts too. Framed Markdown gets a navbar button that cycles Auto, Light, and Dark for that reader. A fenced mermaid code block is drawn as a diagram that follows the theme. See docs/formats.md.
  • BPMN process maps. Publish a BPMN 2.0 file and it gets a diagram viewer with pan, zoom, and SVG or .bpmn download. The XML is checked on publish, and a file with no diagram layout gets one drawn for it, pools and lanes included, so an agent can write the process and leave the coordinates to the server. See docs/formats.md.
  • PDF hosting. Publish a PDF and it gets a viewer page plus a direct-download link. Three per-artifact viewer modes (standard, presentation, minimal) and a download toggle that removes the viewer's buttons. The toggle is a convenience, not protection: the file's URL still answers with the bytes. See docs/formats.md.
  • Over-the-air app installs. Drop an .apk, .aab or .ipa and it gets an install page. An iPhone or iPad gets an Install button, an Android phone gets the download and the steps after it, and a computer gets a QR code to move the tester to their phone. The page shows the version, build number, bundle or package id, minimum OS and SHA-256, all read from the build at upload. For an IPA it also reads the provisioning profile: Ad Hoc or Development with its device count, Enterprise, or App Store. A build that cannot install from a link (signed for the App Store, an expired profile, or a server on plain HTTP) says why instead of showing a button that fails. Upload a new build to the same slug and testers keep one link. An .aab is a Play Console upload, so its page says so and shows the bundletool commands. See docs/formats.md.
  • Redirects. type: "redirect" turns a slug into a short link that answers an HTTP 301 at the server, where other hosts fall back to a JavaScript bounce. The target must be an absolute http(s) URL and cannot carry credentials, and the response is uncacheable, so repointing the slug takes effect on the next visit. Repoint one from the row menu in the dashboard, or with a PUT. Read the cost of running an open redirector on your domain first: docs/formats.md.
  • Embeddable. A public artifact drops into any page as one <iframe>. The row menu writes the tag for you, pointing at ?raw=1 so the frame holds the artifact and not a second toolbar. Private and password-protected artifacts stay unembeddable on purpose, and the unlock prompt refuses to be framed at all. See docs/embedding.md.
  • QR code per artifact. Every artifact has a QR of its permanent URL, from the row menu in the dashboard, GET /api/artifacts/:slug/qr, or artifacts qr <slug>. SVG or PNG, generated in-process: no QR library, no third-party image service, nothing about your artifacts leaves the box. See the API reference.
  • Organize by project. Group artifacts built for the same project into collapsible sections, with a search box across project, title, slug, tags, and a redirect's target. Tags stay for cross-cutting labels.
  • Lifecycle controls. Custom slugs, rename, tags, disable without deleting, auto-expire, delete.
  • Abuse-resistant. Login and unlock endpoints are rate-limited per client IP (failures only), and password hashing runs off the event loop, so a burst of guesses slows those two routes instead of stalling the server. Set TRUST_PROXY for the real client IP behind Cloudflare or a reverse proxy. See deploying.

Ways to publish

From How Credential
A browser Drop files on the dashboard at /, or paste into New Admin login
The terminal artifacts publish page.html, artifacts publish app.ipa or artifacts deploy ./dist (CLI) Scoped API key
Any HTTP client POST /api/artifacts, or POST /api/artifacts/app with a build file (REST API) Scoped API key
An agent publish_artifact over the built-in MCP server Scoped API key

Screenshots

A published artifact served with the viewer topbar
A published artifact with the optional viewer frame: title, copy link, hide.
The New artifact form with type set to redirect
The New form: type, visibility, slug, tags and project in one place.
An install page for an iOS build on an iPhone, with an Install button and the steps after it
An IPA's install page on an iPhone: one tap, then what to do next for this build's profile.
An install page for an Android build on a computer, with a QR code and the build details
The same kind of page on a computer: a QR code for the phone, and what was read from the build.
Two redirect artifacts in the dashboard list, each showing its target URL
Redirects in the list show where they point.

Quick start

1. Run it

Clone, configure, start:

git clone https://github.com/anvilnine/artifacts && cd artifacts
cp .env.example .env   # set ARTIFACTS_API_KEY (openssl rand -hex 32) and BASE_URL
docker compose up -d

Or skip the clone and run the image directly:

docker run -d -p 3000:3000 -v artifacts-data:/data \
  -e ARTIFACTS_API_KEY=$(openssl rand -hex 32) \
  -e BASE_URL=https://artifacts.example.com \
  ghcr.io/anvilnine/artifacts:latest

2. Publish something

curl -s -X POST https://artifacts.example.com/api/artifacts \
  -H "Authorization: Bearer $ARTIFACTS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"content": "<h1>hello</h1>", "type": "html", "slug": "hello", "tags": ["demo"]}'
# {"slug":"hello","url":"https://artifacts.example.com/a/hello"}

3. Let an agent publish

Add the MCP server to Claude Code. Codex and other clients are in docs/mcp.md.

claude mcp add --transport http artifacts https://artifacts.example.com/mcp \
  --header "Authorization: Bearer ${ARTIFACTS_API_KEY}" --scope user

Documentation

I want to… Read
Deploy it (Docker, compose, Coolify, bare node, env vars) docs/deploy.md
Keep artifacts in a private GitHub repo docs/storage-github.md
Keep artifacts in a Forgejo or Gitea repo docs/storage-forgejo.md
Run on Coolify with MinIO as durable storage docs/coolify-minio.md
Publish preview deploys from GitHub Actions docs/ci-preview.md
Use the REST API (incl. zip sites and tags) docs/api.md
Publish from the terminal docs/cli.md
Hook up Claude Code / Codex / any agent docs/mcp.md
Set up login + scoped API keys docs/auth.md
Understand JSX/TSX rendering + zip validation docs/formats.md
Put an artifact inside another page docs/embedding.md
Hand testers an APK or IPA to install from a link docs/formats.md

Storage

One container, a single admin account, and no database by default. Pick a backend with STORAGE_BACKEND:

Backend Where artifacts live Guide
local (default) Plain files under DATA_DIR (/data) Deploying
s3 Any S3-compatible bucket: R2, B2, MinIO, Spaces, Wasabi, GCS interop S3, Coolify + MinIO
git A git remote, one commit per change GitHub, Forgejo
postgres A Postgres table Postgres
sqlite One SQLite file, through Node's built-in node:sqlite SQLite

The optional backends load their dependency only when selected.

FAQ

How do I back it up?
On the default local backend every artifact is a directory of plain files under /data. Back up that directory and you have backed up everything. On the other backends, back up the bucket, repo or database.
My host wipes local disk on restart. Will I lose artifacts?
On the local backend, yes. Fly Machines without a volume, Cloud Run and Heroku dynos all start fresh. Set STORAGE_BACKEND to s3, git or postgres and the container holds no state. See storage backends.
Who can see a new artifact?
Only people holding its capability link (?k=…). New artifacts are private unless you set DEFAULT_VISIBILITY=public. Rotate the link to revoke every copy already handed out (artifacts rotate <slug>). Links expire after CAP_TOKEN_TTL_DAYS, 30 by default. See visibility.
Can I embed an artifact in another site?
A public one, yes, as an <iframe> pointing at /a/<slug>?raw=1. A private artifact shows as an empty frame and the password prompt refuses to be framed. See embedding.
Can CI publish a preview of every pull request?
Yes. Give CI its own scoped key, build the site for its subpath, and run artifacts deploy. Both patterns (one stable preview, or one per pull request) are in docs/ci-preview.md.
Can testers install my iOS or Android build from the link?
Yes, for an .apk, and for an .ipa signed with an Ad Hoc, Development or Enterprise profile. iOS only installs from a link served over HTTPS, and an Ad Hoc or Development build only installs on the devices listed in its profile. An App Store build and an .aab cannot install from any link, and their pages say so. Builds up to 200 MB by default (APP_MAX_MB). See app builds.
It sits behind Cloudflare. Does rate limiting still see the real client IP?
Set TRUST_PROXY=cloudflare to read CF-Connecting-IP, or TRUST_PROXY=xff behind another reverse proxy. See rate limiting and the edge.

Development

No build step. Node ≥ 22.

npm install
cp .env.example .env   # any ARTIFACTS_API_KEY works locally, e.g. "test"
npm run dev
# UI at http://localhost:3000

The end-to-end suite is one shell script:

bash .github/workflows/smoke.sh http://localhost:3000 <your-key>

A few cases cannot be reached over HTTP, such as a hand-edited auth.json. Those run as unit tests on node's built-in runner, no server needed:

npm test

That covers the dashboard too. dashboard-check.mjs fetches /, parses the inline script in public/index.html, and checks that every element the script grabs by id is still in the markup. It runs no browser, so it catches a syntax error or a deleted element but not a runtime error.

PRs welcome. See CONTRIBUTING.md.

Hosted version

Self-hosting is the product, and the open source version stays complete. If you would rather not run a server, Anvil Nine is building a managed version: same publishing flow, custom domains, backups handled for you. A waitlist page opens with the first cloud announcement; watch this repo's releases until then.

Security

Uploaded HTML runs in the browser. That is the whole point, so the model is built to contain it:

  • Serve artifacts from their own origin. Point artifact URLs at a domain that hosts nothing else, so a published page can never touch the dashboard's session cookie.
  • Writes need a scoped API key. Publishing carries a bearer key; the admin dashboard uses a separate HttpOnly, SameSite=Strict session cookie.
  • Reads rely on unguessable slugs. Public artifacts are reachable by anyone with the link and carry noindex, but there is no listing to browse. Don't publish secrets.
  • Credential routes are throttled. Login and unlock rate-limit per client IP and hash passwords off the event loop. A caller below publish scope gets a 256 kB body parser instead of the 10 MB one, and a cap of 20 large bodies a minute per client IP, both checked before the body is parsed. Put a CDN or edge limiter in front for volumetric attacks.

Full threat model in SECURITY.md.

Acknowledgements

This project stands on other people's open source. All of the following are MIT licensed.

Runtime

Optional storage backends (loaded only when selected)

The SQLite backend uses Node's built-in node:sqlite (no dependency).

Web UI

  • Tabler Icons for the app-bar icons (search, new, settings, lock), inlined as SVG

License

MIT © 2026 Zonily Jame

One container. Plain files by default; pluggable S3 / git / Postgres / SQLite storage.

About

Self-hosted artifact publishing. POST HTML/JSX/Markdown/zip, get an unguessable public URL. MCP server built in.

Topics

Resources

Contributing

Security policy

Stars

8 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages