---
name: deploy-to-vercel-config
description: Reference vercel.json configuration for deploying a FrontMCP server to Vercel
---

# vercel.json Reference for FrontMCP

The Vercel CLI build adapter (`frontmcp build --target vercel`) emits a project that uses Vercel's [Build Output API v3](https://vercel.com/docs/build-output-api/v3). The adapter writes `.vercel/output/functions/index.func/handler.cjs` plus a `.vercel/output/config.json` with the catch-all route.

The adapter ALSO writes a minimal `vercel.json` for you, with just `version`, `buildCommand`, and `installCommand`. You should **not** hand-author a `rewrites: [...] -> /api/frontmcp` block — there is no `api/` directory in the build output, and the Build Output API handles routing via `.vercel/output/config.json`.

## Generated vercel.json

After `frontmcp build --target vercel`, your `vercel.json` looks like:

```json
{
  "version": 2,
  "buildCommand": "yarn build",
  "installCommand": "yarn install"
}
```

The `buildCommand` and `installCommand` are detected from your lockfile (`bun.lockb` -> bun, `pnpm-lock.yaml` -> pnpm, `yarn.lock` -> yarn, `package-lock.json` -> npm).

## Customizing

You can hand-edit `vercel.json` AFTER the build to add fields Vercel supports — for example, regions or environment-level headers:

```json
{
  "version": 2,
  "buildCommand": "yarn build",
  "installCommand": "yarn install",
  "regions": ["iad1"]
}
```

To add response headers, prefer setting them inside your FrontMCP server (where they apply both locally and in production) rather than in `vercel.json`.

## What NOT to Do

- Do **not** add a `rewrites` block routing to `/api/frontmcp` — there is no `api/` directory in the Vercel build output.
- Do **not** add a `functions: { "api/frontmcp.ts": ... }` map — the function lives at `.vercel/output/functions/index.func/handler.cjs`, configured by `.vc-config.json` (runtime, handler) generated by the adapter.
- Do **not** set `framework` to a value the FrontMCP build doesn't match. Leaving it unset is safest.

## Function Runtime Config

The adapter writes `.vercel/output/functions/index.func/.vc-config.json` automatically:

```json
{
  "runtime": "nodejs24.x",
  "handler": "handler.cjs",
  "launcherType": "Nodejs"
}
```

If you need to change memory or maxDuration, configure them via the Vercel dashboard (Project Settings -> Functions) or `vercel.json`'s top-level Vercel-specific configuration. Per-function blocks keyed by `api/frontmcp.ts` will not work because that file does not exist.

## Examples

| Example                                                                                                             | Level        | Description                                                                                                                                                                                                                                                                                             |
| ------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`minimal-vercel-config`](../examples/deploy-to-vercel-config/minimal-vercel-config.md)                             | Basic        | `frontmcp build --target vercel` writes this minimal `vercel.json` for you. The package manager is detected from your lockfile.                                                                                                                                                                         |
| [`vercel-config-with-security-headers`](../examples/deploy-to-vercel-config/vercel-config-with-security-headers.md) | Intermediate | The Vercel adapter emits a minimal `vercel.json` (version + buildCommand + installCommand). You can layer extra Vercel-supported keys on top after the build — but never add `functions: { 'api/frontmcp.ts': ... }` or `rewrites` to `/api/frontmcp` (the build does not produce an `api/` directory). |

> See all examples in [`examples/deploy-to-vercel-config/`](../examples/deploy-to-vercel-config/)

## Reference

- Vercel Build Output API v3: https://vercel.com/docs/build-output-api/v3
- Related skills: `deploy-to-vercel`, `deploy-to-node`
