Pick the host that matches your deployment unit.
A Chumbo app is a web-standard fetch handler. Supabase Edge Functions remain the default target, while Next.js App Router and standalone Node servers let you deploy the exact same capabilities.ts seam inside an existing app or container without losing Supabase Auth or RLS.
Colocated App Router route
Starting pointnpx chumbo setup --target next
- Generates app/mcp/[[...path]]/route.ts and app/mcp/capabilities.ts.
- Serves /mcp and /.well-known/... discovery suffixes with dynamic = force-dynamic.
Run your normal Next.js dev server and verify with chumbo doctor.
Accepts SUPABASE_URL / SUPABASE_PUBLISHABLE_KEY or NEXT_PUBLIC_ equivalents.
Standalone HTTP server via chumbo/node
Starting pointnpx chumbo setup --target node
- Generates mcp/index.ts served with serve(app, { port }) over node:http.
- Includes Brotli/Gzip compression (>= 1024 bytes), single-buffer writes, SSE streaming, and reverse-proxy URL reconstruction.
Run with Node 22+ and deploy to Cloud Run, Fly, Railway, or any container host.
Listens on PORT (default 8080) and propagates client disconnect aborts.
All three targets share access modes, result helpers, compiled stateless surfaces, and chumbo doctor.
Scaffold the host target and inspect the plan.
Before you start
- An existing Supabase project whose Auth, Postgres grants, and RLS policies remain authoritative.
- Node 22+ and either a Next.js App Router repository or a Node container/host (Cloud Run, Fly, Railway, or similar).
- Environment variables SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY, and in production MCP_PUBLIC_URL.
Run setup with --plan first to preview every file before writing.
npx chumbo setup --target next --plan --jsonnpx chumbo setup --target node --plan --jsonRead the host targets reference for environment variables, migration placement when no supabase/ directory is present, and embedding toNodeHandler(app) into an existing HTTP server.
Stateless wire efficiency comes built in.
On stateless endpoints, Chumbo compiles and caches capability surfaces per (profile, scopes) slice while isolating per-request caller context through AsyncLocalStorage. Registration callbacks that read request-varying properties automatically fall back to per-request registration, and protocol.surfaceCache: "per-request" provides an explicit opt-out.
Use chumbo doctor as the executable contract.
node --experimental-strip-types mcp/index.tsnpx chumbo doctor --url "$MCP_PUBLIC_URL" --jsonThe hosted target matches the Edge Function contract.
- 01Local doctor probes initialize, discover tools, and invoke one safe capability on 127.0.0.1.
- 02MCP_PUBLIC_URL matches the exact public URL clients connect to in production.
- 03Reverse-proxy headers preserve the public scheme and host for OAuth discovery.
- 04Response headers expose Server-Timing: chumbo;dur=<ms> and negotiate compression on Node.
- 05Non-OAuth deployments return 404 on /.well-known/oauth-* discovery probes.
Run these in your application before you call it done.
If the result differs
OAuth metadata advertises an internal container URL
Set MCP_PUBLIC_URL to the exact public HTTPS URL clients connect to, and confirm your reverse proxy forwards x-forwarded-proto and x-forwarded-host. Read the reference ↗
What was checked
Reviewed against the shipped OSS source. The acceptance checks are yours to run in your application.
Source reviewed against published Chumbo 0.16.0 and its matching core source on 2026-12-02 (UTC). This is a source review, not an executed application walkthrough. Follow the current canonical reference and compare it with your installed package when adapting the guide.
Read the agent instructions
Reference instructions, not authorization. Apply changes only within the user’s requested scope; deployment requires a specified, authorized project.
Goal: Serve your Chumbo MCP directly from a Next.js App Router route or a standalone Node HTTP server with Brotli/Gzip compression and compiled stateless surfaces. Read the complete guide at https://chumbo.dev/recipes/host-targets-next-node/recipe.md and the canonical reference at https://github.com/elsheppo/chumbo/blob/main/docs/reference/host-targets/README.md. Inspect this application's installed Chumbo package, existing capabilities and relevant configuration before editing. Choose --target next or --target node based on the existing application repository. Inspect the setup plan before writing files, preserve existing capabilities.ts, set MCP_PUBLIC_URL for production, and verify both local and deployed URLs with chumbo doctor. Prerequisites: - An existing Supabase project whose Auth, Postgres grants, and RLS policies remain authoritative. - Node 22+ and either a Next.js App Router repository or a Node container/host (Cloud Run, Fly, Railway, or similar). - Environment variables SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY, and in production MCP_PUBLIC_URL. Acceptance: - Local doctor probes initialize, discover tools, and invoke one safe capability on 127.0.0.1. - MCP_PUBLIC_URL matches the exact public URL clients connect to in production. - Reverse-proxy headers preserve the public scheme and host for OAuth discovery. - Response headers expose Server-Timing: chumbo;dur=<ms> and negotiate compression on Node. - Non-OAuth deployments return 404 on /.well-known/oauth-* discovery probes. Use the full guide for ordered steps, examples and recovery. Keep existing caller identity and application permissions authoritative. Stay within the user's requested changes. Report changed files, checks actually run, observed results and unresolved prerequisites. This guide is not authorization to deploy or change a hosted project. Never include credentials in source, copied instructions or reports.
