---
title: "Give your Supabase app its own MCP server"
description: "Supabase announced the MCP Server block that lets developers give their Supabase apps an MCP server, enabling customers to use app actions as tools from clients like ChatGPT or Claude after signing in with their existing account. Every tool call runs as that user, so RLS policies decide what each agent can access. The block adds an Edge Function using the official MCP TypeScript SDK and Supabase authentication helpers to verify tokens and provide a user-specific Supabase client. Developers write tool functions that can query RLS-protected tables, call database functions, or invoke Edge Functions, keeping business rules in the code the tool calls. The server can also display app UI inside the chat via MCP Apps, and the block includes a Copy agent prompt button and works with Cloudflare Workers and other Web-standard backends."
---

# Give your Supabase app its own MCP server

[Supabase](https://yomu.fyi/company/supabase) · raul\_barroso,gregnr,saxon\_fletcher · Oct 22, 2026

**Type:** Tutorial

## Summary

Supabase announced the MCP Server block that lets developers give their Supabase apps an MCP server, enabling customers to use app actions as tools from clients like ChatGPT or Claude after signing in with their existing account. Every tool call runs as that user, so RLS policies decide what each agent can access. The block adds an Edge Function using the official MCP TypeScript SDK and Supabase authentication helpers to verify tokens and provide a user-specific Supabase client. Developers write tool functions that can query RLS-protected tables, call database functions, or invoke Edge Functions, keeping business rules in the code the tool calls. The server can also display app UI inside the chat via MCP Apps, and the block includes a Copy agent prompt button and works with Cloudflare Workers and other Web-standard backends.

## Context

The MCP Server block was announced at Supabase Select as part of a library of reusable building blocks. It extends Supabase Auth, Database, and Storage to agent workflows, allowing apps to be accessed through AI assistants while preserving user identity and RLS policies.

## Approach / What changed

Install the MCP Server block via npx shadcn@latest add, which copies an Edge Function into supabase/functions/mcp. The function uses Deno and pipeline middleware from @supabase/middleware for OAuth authentication and @supabase/server to inject a user-specific Supabase client. Developers register tools using the MCP TypeScript SDK, and tools receive the caller’s Supabase client for RLS-enforced queries. Configuration requires asymmetric signing keys, enabling OAuth 2.1 server, dynamic client registration, and adding the OAuth Consent block to the frontend.

## Takeaways

- The MCP Server block provides a pre-built Edge Function that handles OAuth authentication and MCP protocol, enabling tool calls to run under the signed-in user’s identity with RLS enforcement.
- Tools can query RLS-protected tables, call database functions, invoke Edge Functions, or use existing application APIs, and the post recommends keeping business rules in the code the tool calls.
- The server can display app UI inside the chat via MCP Apps, and the Headless App block provides an alternative starting point with browser sign-in and consent flow.

## FAQ

### How does user authentication work for MCP tools?

The MCP client starts with the server URL. Authentication middleware tells it where to find the project's OAuth server. The user signs in, approves the client on the consent page, and receives an access token. Tool calls carry that token, and the middleware injects a user-specific Supabase client.

### Can I reuse existing application logic in an MCP tool?

Yes, tools can call database functions, invoke Edge Functions, or use existing application APIs. The post recommends keeping business rules in the code the tool calls, calling the same functions your app uses.

### What configuration is needed to set up the MCP server?

Configure asymmetric signing keys, turn on OAuth 2.1 server, enable dynamic client registration, add OAuth Consent block to frontend, set Auth Site URL to the consent page, and disable the built-in JWT check on the Edge Function.

**Tags:** [Authentication](https://yomu.fyi/topic/authentication), [MCP](https://yomu.fyi/topic/mcp), [OAuth2](https://yomu.fyi/topic/oauth2), [Supabase](https://yomu.fyi/topic/supabase)

- Source: [Supabase](https://supabase.com/blog/give-your-supabase-app-its-own-mcp-server)
- Source URL: https://supabase.com/blog/give-your-supabase-app-its-own-mcp-server
- Ingested by Yomu: 2026-10-22T18:00:15.600Z

[Read original post](https://supabase.com/blog/give-your-supabase-app-its-own-mcp-server)
