Prerequisites
To get the most out of this guide, you’ll need to:
1. Create a Supabase MCP Server
Use the following endpoint to create a new remote Supabase MCP server instance:
Request
curl --request POST \
--url https://api.klavis.ai/mcp-server/instance/create \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"serverName": "Supabase",
"userId": "<YOUR_USER_ID>",
"platformName": "<YOUR_PLATFORM_NAME>"
}'
Response
{
"serverUrl": "https://supabase-mcp-server.klavis.ai/sse?instance_id=<instance-id>",
"instanceId": "<instance-id>"
}
serverUrl specifies the endpoint of the Supabase MCP server, which you can connect and use this MCP Server with your Supabase databases and services.
instanceId is used for authentication and identification of your server instance.
2. Supabase OAuth Flow (Recommended)
If you want to enable your MCP server to access your private Supabase infomation:
Option 1: API Call
curl --request POST \
--url https://supabase-mcp-server.klavis.ai/sse?instance_id=<instance-id>/configure \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"supabase_url": "<YOUR_SUPABASE_URL>",
"supabase_key": "<YOUR_SUPABASE_API_KEY>"
}'
Option 2: Browser Redirect
Simply copy and paste the following URL into your web browser for oauth flow, replacing <YOUR_INSTANCE_ID>
with your actual instance ID:
Option 3: Set Auth Token
Instead of OAuth, you can also set your Supabase personal access token by calling our endpoint below:
curl --request POST \
--url https://api.klavis.ai/mcp-server/instance/set-auth-token \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"instanceId": "<string>",
"authToken": "<string>"
}'
Response
{
"success": true,
"message": "<string>"
}