Vercel

Deploy bitmcp on Vercel with a single server artifact.

bitmcp build emits dist/server.js, hashed View HTML under dist/ui/, and dist/manifest.json. The same server file runs on every platform.

Scaffold for Vercel

npx bitmcp create my-app --deploy vercel

That writes deploy: "vercel" and vercel.json with a rewrite from /mcp to /api/mcp.

Set environment variables

In the Vercel project:

  1. Set BITMCP_STATE_KEY
  2. Set http.allowedHosts in bitmcp.config.ts to your deployment host
  3. Set MCP_URL when OAuth is enabled

Confirmations and ctx.ask mint requestState tokens that must verify on any replica. BITMCP_STATE_KEY is required in production.

Deploy

vercel

bitmcp build writes gitignored api/mcp.js that re-exports dist/server.js. vercel runs pnpm build first.

bitmcp.config.ts

import { defineConfig } from "bitmcp";

export default defineConfig({
  deploy: "vercel",
  http: {
    path: "/mcp",
    allowedHosts: ["your-app.vercel.app"],
  },
});

When OAuth is enabled, set MCP_URL to your public MCP endpoint (for example https://your-app.vercel.app/mcp). See Supabase or other auth guides.

See also

Cloudflare and Node and custom deploy the same dist/server.js artifact.