MCP: your app as an MCP server

With the mcp feature, every scaffolded app is itself an MCP server — Claude, ChatGPT, Gemini, Grok, Claude Code, Cursor and any other MCP client can read and write the app's data as the signed-in user, with interactive UI resources (SEP-1865). Enabling mcp automatically enables api-keys.

Endpoint

Convex:   <your convex site URL>/mcp    # e.g. https://brave-otter-123.convex.site/mcp
Supabase: deploy the mcp Edge Function:
          supabase functions deploy mcp --no-verify-jwt
          supabase secrets set APP_URL=<your deployed frontend URL>

The app's own MCP page (nav: MCP) shows the exact endpoint, a copyable client config, the connected apps, and the live tool list — it reads the same metadata the server serves, so it can never drift.

OAuth 2.1 for chat apps

Chat apps (Claude, ChatGPT, Gemini, Grok) paste the endpoint as a custom connector. The built-in OAuth 2.1 flow — dynamic client registration + PKCE + a consent screen — asks the user to approve access. Approved connections appear on the MCP page under Connected apps with active token counts and a Disconnect button (revocation).

API keys for dev tools

Dev tools send Authorization: Bearer <api key> instead. Create a key on the app's API Keys page — the browser generates the key and its SHA-256 hash; only the hash and a display prefix ever reach the server, and the server resolves presented keys via an internal-only hash lookup (no public probing).

.mcp.json client config

{
  "mcpServers": {
    "my-idea": {
      "type": "http",
      "url": "https://brave-otter-123.convex.site/mcp",
      "headers": { "Authorization": "Bearer <your api key>" }
    }
  }
}
# Claude Code one-liner:
claude mcp add --transport http my-idea https://brave-otter-123.convex.site/mcp

Adding tools

On Convex, add tools for your own tables in convex/mcp.ts; the tool metadata lives in convex/mcpToolList.ts and the MCP page's tool list updates itself. On Supabase, tools live in src/lib/mcpTools.ts and the server is supabase/functions/mcp.