How Vercel Works

development

Manages Vercel deployments, debugging, and configuration. Use when deploying apps, investigating production errors, checking deployment status, or configuring vercel.json. Integrates with Vercel MCP for API access. Related: `using-neon` for database errors, `configuring-mcps` for MCP setup.

Using Vercel

Vercel deployment and debugging for CaseMark projects. For more information, context7 their documentation.

SkillUse When
using-neonDatabase connection errors, investigating production data
using-linearCreating tickets for deployment issues
configuring-mcpsSetting up Vercel MCP, troubleshooting MCP connections
contributingDeploying branches, PR previews

Vercel MCP Tools

Prefer MCP over CLI when available. See configuring-mcps for setup.

ToolPurpose
vercel_list_projectsList all projects in a team
vercel_get_projectGet project details
vercel_list_deploymentsList recent deployments
vercel_get_deploymentGet deployment details by ID or URL
vercel_get_deployment_build_logsView build logs
// List deployments
vercel_list_deployments({ projectId: "prj_xxx", teamId: "casemark-ai" })

// Get deployment (works with production URL)
vercel_get_deployment({ idOrUrl: "api.case.dev", teamId: "casemark-ai" })

// View build logs
vercel_get_deployment_build_logs({ idOrUrl: "<deployment-id>", teamId: "casemark-ai", limit: 200 })

Debug Workflow

Production Debug Checklist:
- [ ] Get deployment details via MCP
- [ ] Check build logs for errors
- [ ] If database error → load `using-neon` skill
- [ ] If CLI needed → ask user to run `vercel link`
- [ ] Pull env vars: `vercel env pull --scope casemark-ai`
- [ ] Check runtime logs: `vercel logs <url> --scope casemark-ai`

Agent Limitation: TUI Commands

The Vercel CLI uses a TUI for auth/linking. Ask the user to run:

vercel link --scope casemark-ai

Then use non-interactive commands: vercel logs, vercel env.

Error Pattern → Skill Routing

ErrorLoad Skill
"Database connection failed"using-neon
"Environment variable missing"Check vercel env ls, may need contributing for env setup
"Authentication failed"Check auth secrets match environment
"Build succeeded, runtime fails"Check for hardcoded dev URLs

CLI Commands

# Deployments
vercel list --scope casemark-ai
vercel logs <url> --scope casemark-ai
vercel logs <url> --scope casemark-ai --follow

# Environment
vercel env ls --scope casemark-ai
vercel env pull --scope casemark-ai

# Deploy
vercel --scope casemark-ai           # Preview
vercel --prod --scope casemark-ai    # Production
vercel promote <url> --scope casemark-ai

Environments

EnvironmentTriggerURL Pattern
ProductionMerge to mainCustom domains
PreviewPR/branch push*-git-<branch>-casemark-ai.vercel.app
Localbun devlocalhost:{port}

vercel.json

{
  "crons": [{ "path": "/api/cron/job", "schedule": "0 6 1 * *" }],
  "headers": [{ "source": "/(.*)", "headers": [{ "key": "X-Frame-Options", "value": "DENY" }] }]
}

Cron jobs only run in production.

Stop and Ask

Stop and ask if:

  • Modifying production environment variables
  • Deployment failing after multiple attempts
  • Rolling back production

Proceed if:

  • Checking status/logs (read-only)
  • Debugging with MCP tools

External References

Use context7_query-docs for quick Vercel lookups, or:

Danger Zone