Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Supabase 5 min read Announcement mediumAdept

Give your Supabase app its own MCP server

Supabase apps can expose their own MCP server so customers use the app from ChatGPT, Claude or other MCP clients, signed in with their existing account. An installable MCP Server block generates an Edge Function with an MCP handler, OAuth middleware and per-file tools. Supabase Auth acts as the OAuth 2.1 server, and `withSupabase({ auth: 'user' })` gives each tool a user-scoped client, so Postgres RLS policies govern what an agent can reach without a service role key. Setup requires asymmetric signing keys, dynamic client registration, a consent page and `verify_jwt = false` on the function; MCP Apps can render reused React components inside the chat.

Assumes: Supabase Auth and RLSOAuth 2.1 basicsModel Context Protocol

Related posts

  • Supabase MCP Server

    Supabase mediumAdept

    Supabase ships an official MCP server with 20+ tools that let AI clients like Cursor and Claude create projects, manage tables via migrations, run SQL, create database branches, fetch config and logs, and generate TypeScript types. Setup is a JSON config running the npx package with a personal access token. MCP standardizes tool implementations so clients can use any compliant server, and it also defines resources and prompts, which most clients don't yet support. The roadmap covers deploying Edge Functions, OAuth-based authorization from the 2025-03-26 spec, more token-efficient schema discovery than querying information_schema, and confirmation before destructive operations.

  • Build "Sign in with Your App" using Supabase Auth

    Supabase mediumAdept

    Supabase Auth can now act as an OAuth 2.1 and OpenID Connect identity provider, letting a project offer "Sign in with [Your App]" to third-party apps, MCP-based AI agents, partner integrations and enterprise SSO. It uses the authorization code flow with PKCE, issues JWT access tokens carrying a client_id claim alongside the usual user_id and role, and also provides ID tokens, a UserInfo endpoint, refresh tokens, a JWKS endpoint and discovery documents at /.well-known/oauth-authorization-server and /.well-known/openid-configuration. MCP clients can register themselves through dynamic client registration. Existing login methods, Custom Access Token Hooks and Row Level Security all apply to OAuth tokens, so RLS policies can limit each client to specific data by checking the client_id claim. Granular scopes are planned but not yet available.

  • Introducing @supabase/server

    Supabase mediumAdept

    @supabase/server, now in public beta, replaces the repeated setup code found across 25,000 analyzed Edge Functions: client creation, JWT verification, claims parsing, CORS and auth wiring. A withSupabase wrapper (or createSupabaseContext for custom error handling) takes a declarative auth mode such as 'user', 'none', 'secret', 'publishable' or a combination. It rejects unauthorized requests before the handler runs and supplies a context with a user-scoped RLS client, a service-role admin client and verified claims. It handles the new asymmetric JWT signing keys and API keys internally, so migrating needs no jose or JWKS setup. It returns a standard Request-to-Response handler that runs on Edge Functions, Vercel, Cloudflare Workers, Bun and Hono, and exposes lower-level primitives for per-route auth.

  • Building ChatGPT Apps with Supabase Edge Functions and mcp-use

    Supabase mediumAdept

    ChatGPT apps built on OpenAI's Apps SDK consist of an MCP server backend and an iframe-rendered web component, and mcp-use lets that MCP server run on Supabase Edge Functions by using Hono instead of the Express-based official SDK. The walkthrough builds a database explorer exposing list-tables, show-table, execute-SQL and Supabase-status tools, each returning React widgets. It distinguishes display-only widgets, which are auto-registered as tools and fetch data client-side, from data-returning widgets, where the server sends separate props to the UI and output to the LLM. It closes with deployment via an mcp-use script and connecting the endpoint in ChatGPT developer mode.

  • Every app needs an MCP server, and you can build it with Neon

    Neon easyNovice

    An MCP server lets users drive an app from AI assistants like ChatGPT, Claude and Cursor through tools the app defines, which keeps authorization and validation in app code instead of exposing the UI or raw database access. A production server needs a public HTTPS endpoint, OAuth 2.1 with Client ID Metadata Documents to identify users, per-user database access, and tool annotations to be listed in plugin stores. Neon's pitch covers each piece: Neon Functions host the server next to Postgres, Managed Better Auth's OAuth provider plugin issues tokens whose `sub` matches user IDs in the same database, and branches isolate development. A demo app (a 5x5 shared grid with a single paint_square tool) shows the whole build done through prompts to a coding agent.

The quest for software engineering knowledge.

Look:
Layout: