uses preview

Ship the agent's built React site as a temp URL

Problem

Your agent has scaffolded or rebuilt a React/Vue/Astro site. You want to see it in a real browser without setting up a local dev server, deploying to Vercel, or running ngrok. You want a temp URL that expires automatically and works right now.

The MCP call

import base64, io, subprocess, tarfile

# Build the site
subprocess.run(['npm', 'run', 'build'], check=True, cwd='./my-app')

# Bundle dist/ as a .tar.gz in memory
buf = io.BytesIO()
with tarfile.open(fileobj=buf, mode='w:gz') as tar:
    tar.add('./my-app/dist', arcname='.')
bundle_b64 = base64.b64encode(buf.getvalue()).decode()

# Upload and get a live URL
result = preview_create(
    bundle_b64_targz=bundle_b64,
    entry='index.html',
    ttl_hours=24,
)
print(result['url'])  # open this in any browser

What you get back

A Preview with a URL like https://pail.thalos.ai/preview/aB3x.../. The site is served as a real website — client-side routing works, asset paths resolve, JavaScript runs. It expires after the TTL.

Follow-up calls

If you iterate on the site, call preview_update(preview_id, new_bundle) to replace the bundle in-place. The URL stays the same.

Notes

Pro+ only. Bundle size cap: 10 MB on Pro, 100 MB on Team. No custom domains in v1. The entry parameter sets the HTML file served at the root URL — use it if your build outputs something other than index.html.