# Ship a fix and check the Vercel deploy

> Fixing a bug means jumping between the editor, GitHub and the deploy logs.

This setup is for developers who deploy on Vercel and want the agent to take a bug from fix to verified preview. The agent in Claude Code or Cursor edits the code, opens a pull request on GitHub, then reads the Vercel preview deployment and its build logs. You end up with a pull request and a checked preview link, and you still make the merge decision.

## Steps

1. **Connect GitHub**: Connect GitHub's MCP server through OAuth or a fine-grained personal access token limited to the repositories you work on. Give it permission to read code, push to branches and open pull requests. Protect your main branch in GitHub so changes can only land through a reviewed pull request.
   Tip: Branch protection on main is the real guardrail here, whatever the token allows.
2. **Connect Vercel**: Add Vercel's MCP server and sign in with your Vercel account through OAuth. Ask the agent to list your projects and the latest deployments for this repository to confirm access. The agent can then read deployment status and build logs for the preview that each pull request creates.
   Tip: Point the agent at the project by name if your team has many Vercel projects.
3. **Verify the preview**: After the pull request opens, ask the agent to wait for the preview deployment, read the build logs and report any errors or warnings. Open the preview URL yourself and test the fix in the browser. Merge only when the build is green and the fix works.
   Tip: If the preview is protected, the agent may not load the page itself; check it in your own browser.

## Prompts to try

- Fix the bug where the cart total ignores discount codes, push to a new branch and open a pull request.
- Check the Vercel preview for this pull request and tell me if the build failed and why.
- Read the build logs for the latest failed deployment of project storefront and suggest a fix.
- Compare the preview's build warnings with the last production deployment.
- Write a short pull request description that explains the bug, the fix and how to test it on the preview.

## What you need

- GitHub repository connected to a Vercel project
- Vercel account with access to that project
- Claude Code or Cursor
- Branch protection on your production branch

## Limits

- The agent reads build logs and deployment status; it does not test your app in a browser by itself.
- Protected preview deployments may block automated page checks.
- Runtime errors that only appear under real traffic will not show up in a preview.

## Security notes

- Never give merge rights to the agent.
- Vercel access is read-only for deployments and logs.

## MCP servers

- [GitHub MCP Server](https://github.com/github/github-mcp-server): repository-read, issue-write, pull-request-write
- [Vercel MCP Server](https://vercel.com/docs/mcp): project-read, deployment-read, logs-read

## FAQ

**Can the agent deploy to production?**

Production deploys on Vercel normally happen when you merge to your production branch, and this setup leaves merging to you. Keep branch protection on and do not give the agent permission to merge.

**Do I need a paid Vercel plan?**

Vercel's MCP server works with your existing account, and preview deployments are available on the Hobby plan. Team features and some log retention depend on your plan, so check Vercel's pricing page for details.

**Should I use Claude Code or Cursor?**

Both can edit code and call MCP servers. Claude Code fits terminal-based work and can run your tests and git commands; Cursor suits you if you prefer to watch edits in the editor.

**What if the build passes but the fix is wrong?**

A green build only proves the code compiled and deployed. Test the preview yourself or ask the agent to add a test that reproduces the bug before you merge.

## Tools

- **[GitHub](https://suiteintent.com/t/github?m=GB)**: Code hosting, issues and pull requests. · Best for: Teams reviewing code through pull requests · Free plan · 10000
- **[Vercel](https://suiteintent.com/t/vercel?m=GB)**: Hosting that deploys web apps from Git. · Best for: Preview links on every push for your team · Free plan · 30000
