Prerequisites
- Supabase CLI: Install from Supabase CLI Installation Guide
- Supabase Account
- Docker Required to solve bug https://github.com/orgs/supabase/discussions/32815
- Node.js/Bun: For building your MCP server
Quick Deployment
Deploy your MCP server to Supabase in one command using our automated deployment script:What the script does
The deployment script automatically:- ✅ Validates Supabase CLI installation and authentication
- ✅ Checks if the project is initialized and linked
- ✅ Patches
config.tomlwith your project ID - ✅ Builds your MCP application with the correct
MCP_URL - ✅ Copies build artifacts to the function directory
- ✅ Deploys the function to Supabase Edge Functions
- ✅ Uploads widgets to the storage bucket
Prerequisites for the script
- Supabase CLI installed (
npm install -g supabase) - Logged in to Supabase (
supabase login) - Docker running (for deployment)
Manual Deployment
Setting Up Your MCP Server for Supabase
1. Initialize a Supabase Project
If you don’t have a Supabase project yet:2. Create an Edge Function
supabase/functions/mcp-server/.
3. Adapt your MCP Server to use Deno (required for Supabase Edge Functions)
Widgets in the resources folder are automatically registered. Additional widgets can be registered manually. (see UI Widgets)Complete ExampleA full working example is available in the repository: Supabase Example
4. Widgets assets
Widget assets should be served from a CDN, for example Supabase Storage. Upload the content of the dist/resources/widgets folder to Supabase Storage and set the MCP_URL environment variable to the URL of the dist folder. E.g if you created a bucket called “widgets” in Supabase Storage:5. Build the mcp-use app
6. Copy the dist folder to the function directory
7. Configure the function in config.toml
8. Deploy the Function
Using the MCP Server
You can connect to the MCP Server from any MCP client. Below are examples for browser and Node.js using themcp-use library.
The MCP Server URL
Browser/Client-Side Usage
Node.js Usage
CORS Issues
- Ensure your CORS headers are correctly configured
- Check that the Accept header is included in requests
- Verify your Authorization header has the correct token