preview

Host an ephemeral built static site at a unique URL. Pro+ only.

When to use

Call preview_create when the agent has built a static site (React, Vue, Astro, plain HTML) and wants to hand the user a live URL to open in their browser — without requiring a Vercel account or a local dev server.

Example user prompts

  • Build the app and send me a live preview URL.
  • Give me a pail preview for the static site so I can open it on my phone.
  • Update the preview after you apply the CSS changes.

MCP tool signature

preview_create(
    bundle_b64_targz: str,          # base64-encoded .tar.gz of dist/
    project: str | None = None,
    entry: str = 'index.html',
    ttl_hours: int = 4,
    access_token: str | None = None,
) -> Preview   # {preview_id, url, expires_at}

preview_update(preview_id, bundle_b64_targz) -> None
preview_revoke(preview_id) -> None

Example call

import base64, subprocess, tarfile, io

# Build the site
subprocess.run(['npm', 'run', 'build'], check=True)

# Bundle dist/ as tar.gz
buf = io.BytesIO()
with tarfile.open(fileobj=buf, mode='w:gz') as tar:
    tar.add('dist', arcname='.')
bundle = base64.b64encode(buf.getvalue()).decode()

result = preview_create(bundle_b64_targz=bundle, ttl_hours=24)
print(result['url'])  # share this with your client

Return value

Returns a Preview object with preview_id, url, and expires_at. The URL serves the static bundle as a real website — client-side routing, asset paths, and JS all work.

Credit cost

5 actions per create call, plus storage metered at plan rates. Pro+ only.

Notes

Bundle size cap: 10 MB on Pro, 100 MB on Team. No custom domains in v1. For a single file or folder of static assets without client-side routing, share is cheaper and simpler.

Recipes

See all recipes for copy-paste patterns that use preview and other tools together.