TL;DR
Preview Deploy on Every PR is a devops workflow that chains GitHub + Vercel to automate a common task. Open a PR and a Vercel preview URL appears as a comment within minutes. Branches are cleaned up automatically when PRs close. Once configured, it runs through Claude Code, Cursor, Windsurf or any MCP-compatible AI agent.
Preview Deploy on Every PR
Open a PR and a Vercel preview URL appears as a comment within minutes. Branches are cleaned up automatically when PRs close.
How it works
Partial support — 1 of 2 MCPs hostable
Hosted execution needs every MCP on the whitelist. Use the local CLI for this recipe until the missing MCPs are added.
Not yet hostable:
mcpizy recipe install github-vercel-preview-deployWhy this combo?
GitHub knows when a PR is opened or closed; Vercel knows how to build and deploy your frontend. Combining them means every reviewer gets a live URL to click, not a 'run it locally' instruction. Cleanup is automatic, so you never accumulate zombie deployments.
Without this workflow
Reviewer asks for a preview, developer runs build locally, shares a screenshot or a localhost link that doesn't work for anyone else.
With MCPizy
PR opens, preview URL posted as a comment in under 3 minutes, review happens on the real thing.
Business value
Concrete ROI — not marketing fluff.
Time saved
- Unblocks designers and PMs from engineering bottleneck — they review on real URLs, not Figma mockups
- Zero zombie deployments: automatic cleanup keeps Vercel bill flat even with 100+ open PRs
Workflow steps
- 1PR opened — GitHub event captured
- 2Trigger Vercel preview deployment
- 3Wait for deployment to go live
- 4Post preview URL as PR comment
- 5Cleanup preview when PR is closed
Use cases
- Give non-technical stakeholders a clickable preview before approving UI changes
- Run automated visual regression tests against the preview URL
- Let QA verify hotfixes on an isolated preview before merging to production
- Share feature previews with clients without giving them repo access
Agent prompt (copy into Claude Code)
This prompt is the workflow. Paste into Claude Code, Cursor, or Windsurf.
You are a preview-deploy agent. Run on every PR event from GitHub. On pull_request opened / synchronize: 1. Call github.get_pull_request(pr_number) to get head SHA + branch name 2. Call vercel.deploy_to_vercel(project, git_ref=branch, target="preview") and capture deployment URL 3. Poll vercel.get_deployment(id) until state === "READY" (timeout 5min) 4. Call github.add_pr_comment with "Preview ready: <url>" — update same comment on subsequent pushes (use marker <!-- mcpizy-preview -->) 5. On pull_request closed: call vercel.delete_deployment(id) for all preview deployments tied to this branch Reply with the preview URL and status only.
Trigger & credentials
How this workflow fires and what env vars you need.
POST /webhook/github (GitHub repo → Settings → Webhooks, events: pull_request)
One-command deploy
Install everything — MCPs, prompt, env template — in a single call.
$ mcpizy recipe install github-vercel-preview-deploy ✓ Installs all 2 MCP servers ✓ Writes prompt to ~/.mcpizy/prompts/github-vercel-preview-deploy.md ✓ Generates .env.example in current directory ✓ Ready to paste into Claude Code
Requires mcpizy CLI v1.1+ — install via npm i -g mcpizy.
Quick install (MCPs only)
$ mcpizy install github && mcpizy install vercelMore DevOps recipes
Auto DB Migrations on Push
Every push to main triggers a Supabase migration automatically. Schema diffs are committed and applied with zero manual steps.
Container Deployment to AWS
Build, tag, push to ECR and deploy to ECS in one automated pipeline triggered by a git tag or manual dispatch.
Branch-per-PR Databases
Each PR gets its own Neon database branch for isolated testing. Branch is deleted automatically when the PR closes.
Issue → Branch → PR Pipeline
A Linear issue assigned to a developer automatically creates a git branch, syncs status changes, and opens a draft PR.
Frequently asked questions
What is this workflow?
Preview Deploy on Every PR is a devops automation that uses GitHub + Vercel together via the Model Context Protocol. Open a PR and a Vercel preview URL appears as a comment within minutes. Branches are cleaned up automatically when PRs close.
How long does setup take?
Setup takes around 5 min setup, runs on every PR automatically. You install the required MCP servers with `mcpizy install github && mcpizy install vercel`, connect your accounts, and the workflow is ready to run.
What does this workflow change in practice?
Unblocks designers and PMs from engineering bottleneck — they review on real URLs, not Figma mockups; Zero zombie deployments: automatic cleanup keeps Vercel bill flat even with 100+ open PRs.
Which MCP servers do I need for this?
You need 2 MCP servers: GitHub (mcpizy install github), Vercel (mcpizy install vercel). All are installable in one command via the MCPizy CLI and configured in your `.claude.json` or `.cursor/mcp.json`.
Does this work with Claude Code, Cursor, and Windsurf?
Yes. The workflow runs with any MCP-compatible AI agent — Claude Code, Claude Desktop, Cursor, Windsurf, VS Code with Copilot, and custom agents built on the MCP SDK. The MCP servers are identical across clients; only the config file path (`.claude.json` vs `.cursor/mcp.json`) changes.
Start building this workflow
Install the required MCPs from the directory and automate this in 5 min setup.
$ mcpizy install github && mcpizy install vercel
Free to install. Connect your accounts and this workflow runs itself.