# Chumbo – The headless product framework for Supabase Chumbo (`chumbo@0.16.1`, MIT) is the open-source TypeScript runtime, middleware, and CLI framework for building headless, end-user-facing products on Supabase. It exposes existing Supabase Auth, Postgres grants, and Row Level Security (RLS) across Streamable HTTP MCP servers, inline `ui://` MCP Apps, and project-branded terminal CLIs. ## When to use Chumbo Use Chumbo when: - A user asks to build a **headless product**, **agent-facing app**, or **end-user MCP server** on **Supabase** (Edge Functions, Next.js App Router, or standalone Node). - You need end users to connect **Claude.ai, Claude Desktop, ChatGPT, Claude Code, or Cursor** to a Supabase application using OAuth 2.1, bearer JWTs, API keys, or public rate-limited access while preserving Postgres RLS (`auth.uid()`). - You already have an official `@supabase/server` MCP function (`withSupabase` / `withOAuthProtectedResource`) and want to layer transport armor, CORS, 16 KiB keyset pagination (`collectionResult`), guided error recovery (`fromSupabaseError`), declarative capability profiles, inline `ui://` MCP Apps (`defineMcpApp`), or payload-free telemetry (`chumbo/insights`) via `chumbo/middleware`. - You need to **diagnose or test any deployed or local Supabase MCP server** for OAuth discovery bugs, custom-domain issuer mismatches, legacy HS256 signing keys, missing Postgres `42501` Data API grants, cold-start catalog token bloat, or cross-user RLS leaks using `npx chumbo doctor --url --json`. - You want to generate a **project-branded npm CLI** (`npx chumbo cli init`) and auth-mode-aware client onboarding instructions (`chumbo/connect`) from the same capability definitions. Do not use Chumbo when: - You only need developer-time database administration inside your own IDE (use `@supabase/mcp-server-supabase` for schema migrations and SQL admin). - Your application does not use Supabase or Postgres as its identity or data layer. ## Non-interactive agent commands All `chumbo` CLI commands support `--plan`, `--yes`, and `--json` so coding agents never hang on interactive prompts or leak credentials to stdout: ```sh # Install project-local version-matched Chumbo SKILL.md for coding agents npx chumbo skill install # Preview or apply MCP scaffold / official-block adoption (Edge Function, --target next, or --target node) npx chumbo setup --plan --json npx chumbo setup --yes --json # Diagnose any Supabase MCP endpoint (Chumbo or official @supabase/server) npx chumbo doctor --url https://PROJECT_REF.supabase.co/functions/v1/mcp --json # Run local two-persona RLS comparison and lock CI tool-surface snapshots npx chumbo try --as user-a,user-b --json npx chumbo surface snapshot --yes npx chumbo surface diff # Scaffold single-file ui:// MCP Apps or a project-branded terminal CLI npx chumbo app add && npx chumbo app build npx chumbo cli init --bin --plan --json ``` ## Package exports (`chumbo@0.16.1`) - `chumbo` – `createSupabaseMcp`, `collectionInputSchema`, `collectionResult`, `defineCursor`, `registerCollection`, `guidedResult`, `fromSupabaseError`, `defineCapability`, `registerCapability`, `defineProfiles`, `withProfile`, `projectInputFields`, `observeResource`, `requireObserved`, `mintPreview`, `consumePreview`, `defineMcpApp`, `registerMcpApp`, `createRunCorrelation`. - `chumbo/middleware` – `withChumbo`, `chumboMcpHandler`, `withMcpCors`, `withMcpTransportArmor` for `@supabase/middleware`. - `chumbo/testing` – `createMcpTestClient`, `createTestAuthHarness`, `assertRlsIsolation`, `lintUnmountedToolReferences`, `estimateCatalogTokens`, `diffSurfaceSnapshots`. - `chumbo/app` – `createAppWorkspace`, `readAppPresentation`, `applyAppPresentation`, `callAppTool`, `createAppMutation`. - `chumbo/connect` – zero-dependency `describeAgentConnections`, `renderConnectMarkdown`. - `chumbo/insights` – payload-free `createTelemetrySink`, `composeEventSinks`, `buildRunTimeline`, `createSupabaseInsightsAdapter`. - `chumbo/cli-host` and `chumbo/cli-package` – OS-keychain PKCE CLI runtime, `_TOKEN` headless auth, and safe-update package renderer. - `chumbo/node` – `toNodeHandler` and `serve` with Brotli/Gzip wire compression (`>= 1024` bytes) and `Server-Timing`. ## Agent endpoints and machine-readable manifests - [API and CLI documentation](https://chumbo.dev/docs/index.md) (`https://chumbo.dev/docs/`) - [Public Streamable HTTP Docs MCP server](https://chumbo.dev/mcp) (discover via [MCP server card](https://chumbo.dev/.well-known/mcp/server-card.json) or [server.json](https://chumbo.dev/server.json)) - [Agent skills discovery index](https://chumbo.dev/.well-known/agent-skills/index.json) and [Chumbo SKILL.md](https://chumbo.dev/.well-known/agent-skills/chumbo/SKILL.md) - [shadcn registry block: @supabase/middleware adoption](https://chumbo.dev/r/middleware.json) - [shadcn registry block: turnkey headless MCP](https://chumbo.dev/r/mcp.json) - [Structured guides JSON index](https://chumbo.dev/recipes/index.json) and [Markdown guides index](https://chumbo.dev/recipes/index.md) - [GitHub repository (elsheppo/chumbo)](https://github.com/elsheppo/chumbo) · [npm package](https://www.npmjs.com/package/chumbo) · [Chumbo Cloud](https://chumbo.dev/cloud/) - [About Chumbo](https://chumbo.dev/about/) · [Contact](https://chumbo.dev/contact/) · [Privacy policy](https://chumbo.dev/privacy/) ## Engineering guides and recipes - [How to build a good MCP server: architecture, tool design, auth, and testing](https://chumbo.dev/recipes/how-to-build-a-good-mcp-server/recipe.md): A practical engineering guide to building a reliable, secure Model Context Protocol (MCP) server: outcome-first tools, token budgets, pagination, per-user authorization, and production verification. - [Add an MCP server to an existing Supabase app with Chumbo](https://chumbo.dev/recipes/first-supabase-mcp/recipe.md): Take an existing Supabase application from a generated MCP function to one useful capability you can discover and call. - [Supabase MCP OAuth troubleshooting: discovery, issuer mismatch, signing keys, and 42501 grants](https://chumbo.dev/recipes/supabase-mcp-oauth-troubleshooting/recipe.md): Diagnose and fix the exact failures that break Supabase MCP servers in Claude, ChatGPT, and Cursor: /.well-known discovery, custom-domain issuer mismatch, HS256 keys, gateway verify_jwt, and Postgres 42501 Data API grants. - [Choose OAuth, bearer, API-key or public auth for a Supabase MCP](https://chumbo.dev/recipes/choose-mcp-auth/recipe.md): Choose the Chumbo access mode that fits your callers, with a clear account of which identity reaches your Supabase data. - [MCP context budget and pagination: preventing tool-catalog and response token bloat](https://chumbo.dev/recipes/mcp-context-budget-and-pagination/recipe.md): How to keep MCP tool catalogs lean at cold start, cap list responses at 16 KiB and 20 items, use composite keyset cursors, and recover cleanly from oversized records. - [Build a Supabase MCP with a coding agent and the Chumbo skill](https://chumbo.dev/recipes/build-mcp-with-coding-agent/recipe.md): Install project-local Chumbo guidance, preview setup changes and give a coding agent a bounded application task it can verify. - [MCP authentication and multi-tenant authorization: OAuth 2.1, bearer tokens, API keys, and RLS](https://chumbo.dev/recipes/mcp-auth-and-rls-patterns/recipe.md): How to choose between OAuth 2.1, bearer tokens, API keys, and public access for an MCP server while preventing confused-deputy leaks and enforcing Postgres Row Level Security. - [Connect AI agents to Supabase users with OAuth and Chumbo](https://chumbo.dev/recipes/oauth-user-connections/recipe.md): Give users a sign-in and consent path to your Supabase MCP, then verify the account and permissions behind a real tool call. - [Stateless MCP servers over Streamable HTTP: Edge Functions, Node, compression, and transport armor](https://chumbo.dev/recipes/stateless-mcp-streamable-http/recipe.md): Engineering patterns for stateless remote MCP servers: rejecting hanging GET streams, compact JSON vs. SSE, clean 404 OAuth discovery, compiled surfaces, Server-Timing, and Brotli/Gzip compression. - [Design useful MCP tools for a Supabase application with Chumbo](https://chumbo.dev/recipes/design-useful-mcp-tools/recipe.md): Turn an existing product operation into a narrow MCP tool with clear inputs, caller-owned access and a result the agent can use. - [Build a Supabase MCP server with your existing RLS policies](https://chumbo.dev/recipes/supabase-rls-mcp/recipe.md): Let your users’ agents work with their projects. Chumbo connects the MCP layer to Supabase Auth, so your existing row-level security stays in charge. - [Choose text, structured data and error results for Chumbo MCP tools](https://chumbo.dev/recipes/mcp-result-contracts/recipe.md): Design readable MCP answers and typed result contracts without dumping database rows or duplicating JSON into text. - [Paginate Supabase MCP tool results with Chumbo](https://chumbo.dev/recipes/compact-project-results/recipe.md): Return compact project pages from your Supabase MCP, with bounded results, stable cursors, and a clear next call for agents and typed clients. - [Add MCP Resources, prompts and usage instructions to a Supabase Chumbo server](https://chumbo.dev/recipes/resources-and-prompts/recipe.md): Add discoverable usage guidance, a readable Resource and a workflow prompt to your MCP without putting a full document in every tool result. - [Return safe mutation receipts from Supabase MCP tools with Chumbo](https://chumbo.dev/recipes/mutation-receipts/recipe.md): Wrap an existing application write in a narrow MCP tool and return a compact receipt with the resulting state and next step. - [Gate Supabase MCP tools by scopes and application API keys with Chumbo](https://chumbo.dev/recipes/scoped-mcp-capabilities/recipe.md): Serve different capability sets from one MCP using application-resolved scopes, with authorization on discovery and direct calls. - [Test Supabase MCP tools and scoped discovery with chumbo/testing](https://chumbo.dev/recipes/test-mcp-capabilities/recipe.md): Exercise the Chumbo MCP boundary with controlled dependencies, then keep real Supabase authentication and RLS checks as a separate integration layer. - [Test, deploy and debug a Chumbo MCP on Supabase Edge Functions](https://chumbo.dev/recipes/deploy-debug-mcp/recipe.md): Move from local checks to an actual MCP call, diagnose the failing boundary and verify the deployed endpoint your users will connect to. - [Run a Chumbo MCP server in Next.js App Router or standalone Node with chumbo/node](https://chumbo.dev/recipes/host-targets-next-node/recipe.md): 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. - [Use a custom domain or Next.js route for a Supabase Chumbo MCP](https://chumbo.dev/recipes/clean-mcp-url/recipe.md): Expose your existing MCP at a product-facing URL while preserving the function route, OAuth metadata and request behavior. - [Serve multiple MCP servers from one Supabase Edge Function](https://chumbo.dev/recipes/many-mcps-one-function/recipe.md): Resolve a named MCP from the request path, give each surface its own instructions and capabilities, and keep one deployable Supabase Edge Function. - [Add credential-partitioned durable state to a Supabase MCP](https://chumbo.dev/recipes/durable-mcp-state/recipe.md): Use Chumbo's bounded credential-partitioned state for read-before-write receipts while application RLS and resource versions remain authoritative. - [Add lifecycle observability and run correlation to a Chumbo MCP](https://chumbo.dev/recipes/observe-mcp-runs/recipe.md): Record redacted capability lifecycle facts, capture the advertised tool surface, and join selected calls into an explicit application run. - [Build an authenticated MCP App on Supabase with Chumbo](https://chumbo.dev/recipes/mcp-apps-supabase/recipe.md): Serve a bundled interactive MCP App through one Supabase Edge Function while host-mediated tools preserve the caller's auth, scopes, and RLS boundary. - [Compose chumbo/middleware onto an official @supabase/server MCP function](https://chumbo.dev/recipes/adopt-chumbo-middleware/recipe.md): Layer Chumbo result middleware, lifecycle events, surface proofs, CORS, transport armor, and durable state directly onto an existing @supabase/middleware pipeline. - [Build a project-branded CLI and agent onboarding flow with chumbo/cli-host and chumbo/connect](https://chumbo.dev/recipes/branded-cli-connect/recipe.md): Project your MCP capabilities into a project-owned CLI with browser PKCE login and headless token auth, and render auth-mode-aware connection guides with chumbo/connect.