How to integrate Supabase MCP with Mastra AI

Connect Mastra AI to Supabase MCP. Create a new secret api key for your project, list all third-party auth providers configured, and more using natural language, with authentication handled for you.

Supabase logoSupabase
Oauth2Api Key

Supabase is an open-source backend platform offering scalable Postgres databases, authentication, storage, and real-time APIs. It lets developers build modern apps without managing infrastructure.

230 Tools

Introduction

This guide walks you through connecting Supabase to Mastra AI using the Composio tool router. By the end, you'll have a working Supabase agent that can run SQL queries, apply database migrations, deploy edge functions, manage projects and branches, and generate TypeScript types through natural language commands.

This guide will help you understand how to give your Mastra AI agent real control over a Supabase account through Composio's Supabase MCP server.

Before we dive in, let's take a quick look at the key ideas and tools involved.

Also integrate Supabase with

TL;DR

Here's what you'll learn:
  • Set up your environment so Mastra, OpenAI, and Composio work together
  • Create a Tool Router session in Composio that exposes Supabase tools
  • Connect Mastra's MCP client to the Composio generated MCP URL
  • Fetch Supabase tool definitions and attach them as a toolset
  • Build a Mastra agent that can reason, call tools, and return structured results
  • Run an interactive CLI where you can chat with your Supabase agent

What is Mastra AI?

Mastra AI is a TypeScript framework for building AI agents with tool support. It provides a clean API for creating agents that can use external services through MCP.

Key features include:

  • MCP Client: Built-in support for Model Context Protocol servers
  • Toolsets: Organize tools into logical groups
  • Step Callbacks: Monitor and debug agent execution
  • OpenAI Integration: Works with OpenAI models via @ai-sdk/openai

What is the Supabase MCP server, and what's possible with it?

The Supabase MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Supabase account. It provides structured and secure access to your projects, Postgres databases, authentication settings, storage buckets, and Edge Functions, so your agent can manage projects, run queries, apply migrations, maintain functions, and monitor services on your behalf.

  • Project and organization management: Have your agent list, create, rename, inspect, or delete Supabase projects, and list or create organizations.
  • Database queries and migrations: Direct your agent to inspect tables and schemas, run read-only or advanced SQL queries, apply migrations, review migration history, and generate TypeScript types.
  • Edge Function management: Let the agent create, update, deploy, inspect, list, and invoke Edge Functions, including retrieving their source code when needed.
  • Authentication and secret administration: Instruct your agent to review or update authentication settings, manage project secrets, retrieve API keys, update API key details, and manage signing keys.
  • Project operations and monitoring: Have your agent check service health, review project logs, list database branches and storage buckets, and inspect project status.

What is the Composio tool router, and how does it fit here?

What is Composio SDK?

Composio's Composio SDK helps agents find the right tools for a task at runtime. You can plug in multiple toolkits (like Gmail, HubSpot, and GitHub), and the agent will identify the relevant app and action to complete multi-step workflows. This can reduce token usage and improve the reliability of tool calls. Read more here: Getting started with Composio SDK

The tool router generates a secure MCP URL that your agents can access to perform actions.

How the Composio SDK works

The Composio SDK follows a three-phase workflow:

  1. Discovery: Searches for tools matching your task and returns relevant toolkits with their details.
  2. Authentication: Checks for active connections. If missing, creates an auth config and returns a connection URL via Auth Link.
  3. Execution: Executes the action using the authenticated connection.

Step-by-step Guide

Step by step09 STEPS
1

Prerequisites

Before starting, make sure you have:
  • Node.js 18 or higher
  • A Composio account with an active API key
  • An OpenAI API key
  • Basic familiarity with TypeScript
2

Getting API Keys for OpenAI and Composio

OpenAI API Key
  • Go to the OpenAI dashboard and create an API key.
  • You need credits or a connected billing setup to use the models.
  • Store the key somewhere safe.
Composio API Key
  • Log in to the Composio dashboard.
  • Go to Settings and copy your API key.
  • This key lets your Mastra agent talk to Composio and reach Supabase through MCP.
3

Install dependencies

bash
npm install @composio/core @mastra/core @mastra/mcp @ai-sdk/openai dotenv

Install the required packages.

What's happening:

  • @composio/core is the Composio SDK for creating MCP sessions
  • @mastra/core provides the Agent class
  • @mastra/mcp is Mastra's MCP client
  • @ai-sdk/openai is the model wrapper for OpenAI
  • dotenv loads environment variables from .env
4

Set up environment variables

bash
COMPOSIO_API_KEY=your_composio_api_key_here
COMPOSIO_USER_ID=your_user_id_here
OPENAI_API_KEY=your_openai_api_key_here

Create a .env file in your project root.

What's happening:

  • COMPOSIO_API_KEY authenticates your requests to Composio
  • COMPOSIO_USER_ID tells Composio which user this session belongs to
  • OPENAI_API_KEY lets the Mastra agent call OpenAI models
5

Import libraries and validate environment

typescript
import "dotenv/config";
import { openai } from "@ai-sdk/openai";
import { Agent } from "@mastra/core/agent";
import { MCPClient } from "@mastra/mcp";
import { Composio } from "@composio/core";
import * as readline from "readline";

import type { AiMessageType } from "@mastra/core/agent";

const openaiAPIKey = process.env.OPENAI_API_KEY;
const composioAPIKey = process.env.COMPOSIO_API_KEY;
const composioUserID = process.env.COMPOSIO_USER_ID;

if (!openaiAPIKey) throw new Error("OPENAI_API_KEY is not set");
if (!composioAPIKey) throw new Error("COMPOSIO_API_KEY is not set");
if (!composioUserID) throw new Error("COMPOSIO_USER_ID is not set");

const composio = new Composio({
  apiKey: composioAPIKey as string,
});
What's happening:
  • dotenv/config auto loads your .env so process.env.* is available
  • openai gives you a Mastra compatible model wrapper
  • Agent is the Mastra agent that will call tools and produce answers
  • MCPClient connects Mastra to your Composio MCP server
  • Composio is used to create a Tool Router session
6

Create a Tool Router session for Supabase

typescript
async function main() {
  const session = await composio.create(
    composioUserID as string,
    {
      toolkits: ["supabase"],
    },
  );

  const composioMCPUrl = session.mcp.url;
  console.log("Supabase MCP URL:", composioMCPUrl);
What's happening:
  • create spins up a short-lived MCP HTTP endpoint for this user
  • The toolkits array contains "supabase" for Supabase access
  • session.mcp.url is the MCP URL that Mastra's MCPClient will connect to
7

Configure Mastra MCP client and fetch tools

typescript
const mcpClient = new MCPClient({
    id: composioUserID as string,
    servers: {
      nasdaq: {
        url: new URL(composioMCPUrl),
        requestInit: {
          headers: session.mcp.headers,
        },
      },
    },
    timeout: 30_000,
  });

console.log("Fetching MCP tools from Composio...");
const composioTools = await mcpClient.getTools();
console.log("Number of tools:", Object.keys(composioTools).length);
What's happening:
  • MCPClient takes an id for this client and a list of MCP servers
  • The headers property includes the x-api-key for authentication
  • getTools fetches the tool definitions exposed by the Supabase toolkit
8

Create the Mastra agent

typescript
const agent = new Agent({
    name: "supabase-mastra-agent",
    instructions: "You are an AI agent with Supabase tools via Composio.",
    model: "openai/gpt-5",
  });
What's happening:
  • Agent is the core Mastra agent
  • name is just an identifier for logging and debugging
  • instructions guide the agent to use tools instead of only answering in natural language
  • model uses openai("gpt-5") to configure the underlying LLM
9

Set up interactive chat interface

typescript
let messages: AiMessageType[] = [];

console.log("Chat started! Type 'exit' or 'quit' to end.\n");

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  prompt: "> ",
});

rl.prompt();

rl.on("line", async (userInput: string) => {
  const trimmedInput = userInput.trim();

  if (["exit", "quit", "bye"].includes(trimmedInput.toLowerCase())) {
    console.log("\nGoodbye!");
    rl.close();
    process.exit(0);
  }

  if (!trimmedInput) {
    rl.prompt();
    return;
  }

  messages.push({
    id: crypto.randomUUID(),
    role: "user",
    content: trimmedInput,
  });

  console.log("\nAgent is thinking...\n");

  try {
    const response = await agent.generate(messages, {
      toolsets: {
        supabase: composioTools,
      },
      maxSteps: 8,
    });

    const { text } = response;

    if (text && text.trim().length > 0) {
      console.log(`Agent: ${text}\n`);
        messages.push({
          id: crypto.randomUUID(),
          role: "assistant",
          content: text,
        });
      }
    } catch (error) {
      console.error("\nError:", error);
    }

    rl.prompt();
  });

  rl.on("close", async () => {
    console.log("\nSession ended.");
    await mcpClient.disconnect();
    process.exit(0);
  });
}

main().catch((err) => {
  console.error("Fatal error:", err);
  process.exit(1);
});
What's happening:
  • messages keeps the full conversation history in Mastra's expected format
  • agent.generate runs the agent with conversation history and Supabase toolsets
  • maxSteps limits how many tool calls the agent can take in a single run
  • onStepFinish is a hook that prints intermediate steps for debugging

Complete Code

Here's the complete code to get you started with Supabase and Mastra AI:

typescript
import "dotenv/config";
import { openai } from "@ai-sdk/openai";
import { Agent } from "@mastra/core/agent";
import { MCPClient } from "@mastra/mcp";
import { Composio } from "@composio/core";
import * as readline from "readline";

import type { AiMessageType } from "@mastra/core/agent";

const openaiAPIKey = process.env.OPENAI_API_KEY;
const composioAPIKey = process.env.COMPOSIO_API_KEY;
const composioUserID = process.env.COMPOSIO_USER_ID;

if (!openaiAPIKey) throw new Error("OPENAI_API_KEY is not set");
if (!composioAPIKey) throw new Error("COMPOSIO_API_KEY is not set");
if (!composioUserID) throw new Error("COMPOSIO_USER_ID is not set");

const composio = new Composio({ apiKey: composioAPIKey as string });

async function main() {
  const session = await composio.create(composioUserID as string, {
    toolkits: ["supabase"],
  });

  const composioMCPUrl = session.mcp.url;

  const mcpClient = new MCPClient({
    id: composioUserID as string,
    servers: {
      supabase: {
        url: new URL(composioMCPUrl),
        requestInit: {
          headers: session.mcp.headers,
        },
      },
    },
    timeout: 30_000,
  });

  const composioTools = await mcpClient.getTools();

  const agent = new Agent({
    name: "supabase-mastra-agent",
    instructions: "You are an AI agent with Supabase tools via Composio.",
    model: "openai/gpt-5",
  });

  let messages: AiMessageType[] = [];

  const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
    prompt: "> ",
  });

  rl.prompt();

  rl.on("line", async (input: string) => {
    const trimmed = input.trim();
    if (["exit", "quit"].includes(trimmed.toLowerCase())) {
      rl.close();
      return;
    }

    messages.push({ id: crypto.randomUUID(), role: "user", content: trimmed });

    const { text } = await agent.generate(messages, {
      toolsets: { supabase: composioTools },
      maxSteps: 8,
    });

    if (text) {
      console.log(`Agent: ${text}\n`);
      messages.push({ id: crypto.randomUUID(), role: "assistant", content: text });
    }

    rl.prompt();
  });

  rl.on("close", async () => {
    await mcpClient.disconnect();
    process.exit(0);
  });
}

main();

Conclusion

You've built a Mastra AI agent that can interact with Supabase through Composio's Tool Router. You can extend this further by:
  • Adding other toolkits like Gmail, Slack, or GitHub
  • Building a web-based chat interface around this agent
  • Using multiple MCP endpoints to enable cross-app workflows
TOOLS

Supported Tools

Every Supabase action and event your agent gets out of the box.

Accept Invite External Jit Access

Accept an invitation for JIT database access.

Create project api key

Creates a publishable or secret API key for an existing Supabase project, optionally with a description.

Delete an API key from the project

Permanently deletes a specific API key (identified by `id`) from a Supabase project (identified by `ref`), revoking its access.

Delete third party auth config

Removes a third-party authentication provider (e.

Get a third-party integration

Retrieves the detailed configuration for a specific third-party authentication (TPA) provider, identified by `tpa_id`, within an existing Supabase project specified by `ref`.

List third-party auth integrations for project

Lists all configured third-party authentication provider integrations for an existing Supabase project (using its `ref`), suitable for read-only auditing or verifying current authentication settings.

Update an API key for the project

Updates the description of an existing Supabase project API key without regenerating the key string.

Append Resumable Upload

Append data to a TUS resumable upload.

Append Resumable Upload Signed

Append data to a signed resumable upload.

Apply a database migration

Applies a tracked SQL database migration to a Supabase project, for schema changes or other DDL/DML operations.

Apply Project Addon

Apply or update billing addons and compute instance size.

Authorize Jit Access

Authorize user-to-role mappings for JIT access.

Beta activate custom hostname for project

Activates a previously configured custom hostname for a Supabase project, assuming DNS settings are verified externally.

Activate vanity subdomain for project

Activates a vanity subdomain for the specified Supabase project (e.

Authorize user through OAuth

Requests Supabase OAuth 2.

Check vanity subdomain availability

Checks whether a vanity subdomain is available for a Supabase project without reserving or assigning it.

Setup read replica for project

Provisions a read-only replica for a Supabase project in a specified supported AWS region to enhance read performance and reduce latency.

Enable project database webhooks

Enables database webhooks for the Supabase project `ref`, triggering real-time notifications for INSERT, UPDATE, or DELETE events.

Beta get project's custom hostname config

Retrieves a Supabase project's custom hostname configuration, including its status, SSL certificate, and ownership verification, noting that availability may depend on the project's plan.

Retrieve network bans for project

Retrieves the list of banned IPv4 addresses for a Supabase project using its unique project reference string; this is a read-only operation.

Get project network restrictions

Retrieves a Supabase project's network restriction settings, including IPv4 and IPv6 CIDR allowlists, entitlement, and application status.

Get project pgsodium config

Retrieves the PGSodium configuration, including the root encryption key, for an existing Supabase project identified by its `ref`.

Get project SSL enforcement configuration

Retrieves the SSL enforcement configuration for a specified Supabase project, indicating if SSL connections are mandated for its database.

Get current vanity subdomain config

Fetches the current vanity subdomain configuration for a Supabase project, including its status and any custom domain name.

Remove project network bans

Removes specified IPv4 addresses from a Supabase project's network ban list, granting immediate access; IPs not currently banned are ignored.

Remove read replica

Initiates removal of a specified read replica database from a Supabase project.

Execute project database query

Executes PostgreSQL queries against a Supabase project's database for data retrieval, modification, or schema operations.

Beta update project network restrictions

Updates network access restrictions (IPv4/IPv6 CIDR lists) for a Supabase project.

Upgrade the project's PostgreSQL version

Initiates an asynchronous upgrade of a Supabase project's PostgreSQL database to a specified `target_version` from a selected `release_channel`, returning a `tracking_id` to monitor status; the `target_version` must be available in the chosen channel.

Cancel Project Restoration

Cancel project restoration.

Copy Storage Object

Copy an object.

Count action runs

Counts the number of action runs for a Supabase project using a HEAD request.

Count Function Results

Count rows from a known exposed table-valued function using HEAD, without a body.

Count Table Rows

Count matching rows in an exposed table or view without downloading rows.

Create new project

Creates a new Supabase project, requiring a unique name (no dots) within the organization; project creation is asynchronous.

Bulk create secrets

Bulk creates secrets for a Supabase project.

Create a database branch

Creates a new, isolated database branch from an existing Supabase project (identified by `ref`), useful for setting up separate environments like development or testing, which can optionally be linked to a Git branch.

Create a function

Creates a new serverless Edge Function for a Supabase project (identified by `ref`), requiring valid JavaScript/TypeScript in `body` and a project-unique `slug` identifier.

Create CLI login role

Creates a temporary CLI login role for database access with specified permissions; use when setting up CLI authentication for development or administrative tasks.

Create an organization

Creates a new Supabase organization, which serves as a top-level container for projects, billing, and team access.

Create project signing key

Create a new JWT signing key for a Supabase project, with an optional initial standby or in-use status.

Create Resumable Upload

Create a TUS resumable upload.

Create Resumable Upload Signed

Create a signed TUS resumable upload.

Create Signed Download Url

Generate a time-limited download capability for an object.

Create Signed Download Urls

Generate time-limited download capabilities for multiple objects.

Create Signed Upload URL

Create a two-hour signed authorization for uploading a Storage object.

Create SSO provider configuration

Creates a new SAML 2.

Create Storage Bucket

Create a Storage bucket.

Create a new third-party auth integration

Call this to add a new third-party authentication method (OIDC or JWKS) to a Supabase project for integrating external identity providers (e.

Delete all branches

Disables preview branching for a Supabase project, which deletes all remaining branches.

Delete Bucket Lifecycle

Delete bucket lifecycle configuration.

Delete custom hostname config

Deletes an active custom hostname configuration for the project identified by `ref`, reverting to the default Supabase-provided hostname; this action immediately makes the project inaccessible via the custom domain and requires subsequent updates to client, OAuth, and DNS settings.

Delete branch by id

Permanently and irreversibly deletes a specific, non-default database branch by its `branch_id`, without affecting other branches.

Delete edge function

Deletes an Edge Function from a Supabase project by its slug.

Delete an edge function by slug

Permanently deletes a specific Edge Function (by `function_slug`) from a Supabase project (by `ref`); this action is irreversible and requires prior existence of both project and function.

Delete Invite External Jit Access

Delete an external user's JIT invitation.

Delete Jit Access

Delete JIT access by user ID.

Delete CLI login roles

[Beta] Deletes existing login roles used by the Supabase CLI for the specified project.

Delete a project

Permanently and irreversibly deletes a Supabase project and all associated resources, including databases, storage, and configurations.

Delete vanity subdomain for project

Permanently and irreversibly deletes an active vanity subdomain configuration for the specified Supabase project, reverting it to its default Supabase URL.

Bulk delete secrets

Deletes one or more secrets from a Supabase project by their names.

Remove an SSO provider

Deletes a specific SSO provider by its ID (`provider_id`) from a Supabase project (`ref`), which disables it and returns its details; ensure this action will not inadvertently lock out users.

Delete Storage Bucket

Delete a bucket.

Delete Storage Object

Delete a Storage object.

Delete Storage Objects

Delete multiple objects.

Delete Table Rows

Permanently delete matching rows from an exposed Supabase table or view.

Deploy function

Deploys Edge Functions to a Supabase project using multipart upload.

Disable preview branching

Disables the preview branching feature for an existing Supabase project, identified by its unique reference ID (`ref`).

Disable project readonly mode

Temporarily disables a Supabase project's read-only mode for 15 minutes to allow write operations (e.

Download private object

Downloads an object from a private Supabase Storage bucket and returns its bytes as base64 with selected metadata.

Download Public Object

Retrieve an object from a public bucket.

Download Signed Object

Retrieve an object using a presigned URL.

Download Storage Object

Retrieve a Storage object.

Empty Storage Bucket

Empty a bucket.

Exchange auth code for access and refresh token

(Beta) Implements the OAuth 2.

Generate TypeScript types

Generates and retrieves TypeScript types from a Supabase project's database; any schemas specified in `included_schemas` must exist in the project.

Get action run status

Retrieves the status and details of a specific action run, including its steps, timestamps, and configuration.

Get action run logs

Retrieves the execution logs for a specific action run by its ID.

Get project auth config

Retrieves a Supabase project's authentication settings for read-only inspection, including supported provider configurations, MFA policies, email and SMS templates, security settings, and hooks.

Get Authenticated Image Headers

Get authenticated image transformation headers.

Get Authenticated Object Headers

Retrieve authenticated object information headers.

Get Authenticated Object Info

Retrieve authenticated object information.

Get Authenticated Object Info Headers

Get authenticated object information headers.

Get Available Regions

Tool to get the list of available regions for creating a new Supabase project.

Get Backup Schedule

Get the project's backup schedule.

Get a database branch

Retrieves detailed information about a specific database branch by its name and project reference.

Get Bucket Lifecycle

Get bucket lifecycle configuration.

Get Bucket Lifecycle Headers

Get bucket lifecycle response headers.

Get database branch config

Retrieves the read-only configuration and status for a Supabase database branch, typically for monitoring or verifying its settings.

Get Database Disk

Get database disk attributes.

Get Database Openapi

Get the project's PostgREST OpenAPI specification.

Get Disk Utilization

Get disk utilization.

Retrieve a function

Retrieves detailed information, metadata, configuration, and status for a specific Edge Function using its project reference ID and function slug.

Retrieve a function body

Retrieves the body of a specified Supabase Edge Function using its project reference and function slug.

Get API Health Status

Checks the Supabase API for availability, helping diagnose connectivity issues.

Get Jit Access

Get user-to-role mappings for JIT database access.

Get JIT access config

Retrieves a Supabase project's just-in-time (JIT) access configuration state using the beta endpoint.

Get a migration

Retrieves a specific database migration entry from the migration history using its version identifier.

Get information about an organization

Fetches comprehensive details for a specific Supabase organization using its unique slug.

Get Organization Entitlements

Get organization entitlements.

Get Profile

Get the user's profile.

Get project

Retrieves detailed information about a Supabase project by reference ID, including its status, database configuration, organization, region, and creation timestamp.

Get project API key

Retrieves details of a specific API key for a Supabase project by its UUID.

Get project API keys

Retrieves all API keys for an existing Supabase project, specified by its unique reference ID (`ref`); this is a read-only operation.

Get project config

Retrieve a project's consolidated effective database, pooler, Auth, Data API, Realtime, and Storage configuration.

Get Project Disk Autoscale Config

Get disk autoscale configuration.

Get Project Function Combined Stats

Get combined function statistics.

Get project logs

Retrieves the unified logs stream for a Supabase project, including database, API, and edge function logs, for monitoring and debugging.

Get project metrics

Retrieve a Supabase project's Prometheus/OpenMetrics exposition.

Get project PgBouncer config

Retrieves the active PgBouncer configuration (PostgreSQL connection pooler) for a Supabase project, used for performance tuning, auditing, or getting the connection string.

Get project postgres config

Retrieves the current read-only PostgreSQL database configuration for a specified Supabase project's `ref`, noting that some advanced or security-sensitive details might be omitted from the response.

Get project's PostgREST config

Retrieves the PostgREST configuration for a specific Supabase project.

Get project's read-only mode status

Retrieves the read-only mode status for a specified Supabase project to check its operational state; this action does not change the read-only state.

Get project signing keys

Tool to list all signing keys for a Supabase project.

Get project Supavisor configuration

Retrieves the Supavisor (connection pooler) configuration for a specified Supabase project, identified by its reference ID.

Get Project Upgrade Eligibility

Checks a Supabase project's eligibility for an upgrade, verifying compatibility and identifying potential issues; this action does not perform the actual upgrade.

Get project upgrade status

Retrieves the latest status of a Supabase project's database upgrade for monitoring purposes; does not initiate or modify upgrades.

Get Project Usage Api Count

Get project usage API counts.

Get Project Usage Request Count

Get project usage API request counts.

Get Public Image Headers

Get public image transformation headers.

Get Public Object Headers

Get public object information headers.

Get Public Object Info

Get public object information.

Get Realtime Config

Get Realtime configuration.

Get TUS resumable upload base options

Handles OPTIONS request for TUS Resumable uploads to discover server capabilities.

Get TUS resumable upload options

Handles OPTIONS request for TUS Resumable uploads to discover server capabilities.

Get Resumable Upload Status

Get resumable upload offset and metadata.

Get Resumable Upload Status Signed

Get signed resumable upload offset and metadata.

Get Signed Image Headers

Get signed image transformation headers.

Get Signed Object Headers

Get headers for a presigned object retrieval.

Get project's auth config

Retrieves a project's authentication configuration, including provider, MFA, email, SMS, JWT and security settings.

Get project's service health status

Retrieves the current health status for a Supabase project, for specified services or all services if the 'services' list is omitted.

Get a specific SQL snippet

Retrieves a specific SQL snippet by its unique identifier.

Get a SSO provider by its UUID

Retrieves configuration details for a project's SAML Single Sign-On provider by UUID.

Get Storage Bucket

Get bucket details.

Get Storage Bucket Headers

Get bucket response headers.

Get Storage Bucket List Headers

Get bucket-list response headers.

Get Storage Config

Get project Storage configuration.

Get Storage Health

Check the Storage service health, distinct from Management API health.

Get Storage Health Headers

Get Storage service health response headers.

Get Storage Object Headers

Retrieve object information headers.

Get Storage Object Info

Retrieve object information.

Get Storage Object Info Headers

Get object information headers.

Get Table Schemas

Retrieve column details, types, primary and unique constraints, and optionally foreign keys for multiple database tables.

OPTIONS for resumable upload sign

Send an OPTIONS request to the TUS resumable upload signing endpoint.

OPTIONS for resumable upload sign

Send an OPTIONS request to a TUS resumable upload signing endpoint for a specified path.

Insert Table Rows

Insert rows or upsert on primary/UNIQUE keys in an exposed table or view.

Invite External Jit Access

Invite an external user for JIT database access.

Invoke Database Function

Invoke a known exposed Postgres function with named JSON arguments.

Invoke Edge Function

Tool to invoke a deployed Supabase Edge Function over HTTPS.

Invoke Read Only Function

Invoke a known exposed Postgres function using GET in a read-only transaction.

List Action Runs

List one page of action runs for a project.

List all organizations

Lists organizations associated with the authenticated Supabase account, returning their IDs, slugs, and names.

List all projects

Lists Supabase projects for the authenticated user, including project ID, name, organization ID, region, status, database information, and creation time.

List project database backups

Lists all database backups for a Supabase project, providing details on existing backups but not creating new ones or performing restores; availability may depend on plan and configuration.

List database branches

Lists all database branches for a specified Supabase project, providing information about each branch's status, configuration, and metadata.

List all buckets

Retrieves a list of all storage buckets for a Supabase project, without returning bucket contents or access policies.

List all database branches

Lists all database branches for a specified Supabase project, used for isolated development and testing of schema changes; ensure the project reference ID is valid.

List all functions

Lists metadata for all Edge Functions in a Supabase project (specified by 'ref'), excluding function code or logs; the project must exist.

List Jit Access

List all user-to-role mappings for JIT access.

List migration history

Retrieves the list of applied database migration versions for a Supabase project.

List members of an organization

Retrieves all members of a Supabase organization, identified by its unique slug, including their user ID, username, email, role, and MFA status.

List Organization Projects

List one page of projects for an organization.

List Project Addons

List billing addons and compute instance selections.

List Project Restore Versions

List available restore versions for a project.

List project secrets

Retrieves all secrets (environment variables) for a Supabase project by its reference ID.

List all secrets

Retrieves all secrets for a Supabase project using its reference ID; secret values in the response may be masked.

List SQL snippets for the logged in user

Retrieves the first page of SQL snippets for the logged-in user, optionally filtered by Supabase project.

List all SSO providers

Lists all configured Single Sign-On (SSO) providers for a Supabase project, requiring the project reference ID (`ref`) of an existing project.

List Storage Buckets

List Storage buckets through the data-plane API.

List Storage Objects

Search for objects under a prefix.

List Storage Objects V2

Search for objects under a prefix using list v2.

List Database Tables

Lists tables and optionally views in Supabase database schemas, providing an overview of database structure.

Merge a database branch

Initiates a merge of a database branch into its target database.

Modify Database Disk

Modify database disk configuration.

Move Storage Object

Move an object.

Oauth Authorize Project Claim

Initiate OAuth authorization to claim a project.

Patch a migration

[Beta] Patches an existing entry in the project's migration history, updating the name or rollback script.

Patch project network restrictions

Updates project's network restrictions by incrementally adding or removing IPv4/IPv6 CIDR blocks.

Pause Project

Pause a project, making its services unavailable until it is restored.

Post Resumable Upload

Create a TUS upload through the wildcard creation route (an alias of base POST).

Post Resumable Upload Signed

Create a signed TUS upload through the wildcard creation route (an alias of base POST).

Purge Bucket Cache

Purge cache for a bucket or its transformations.

Purge Object Cache

Purge cache for an object or its transformations.

Purge Storage Cache

Purge cache for the tenant or tenant transformations.

Push a database branch

Pushes a database branch, applying migrations and changes to the specified branch.

Remove Project Addon

Remove billing addons or revert compute sizing.

Render Authenticated Image

Render an authenticated image with transformations.

Render Public Image

Render a public image with transformations.

Render Signed Image

Render a signed image with transformations.

Replace Bucket Lifecycle

Replace bucket lifecycle configuration.

Reset a database branch

Resets an existing Supabase database branch, identified by `branch_id`, to its initial clean state, irreversibly deleting all its current data and schema changes.

Restart Project

Restart a project, temporarily interrupting its services.

Restore Branch

Restore a scheduled branch deletion.

Restore database PITR backup

Restores a Supabase project's database to a specific Unix timestamp using Point-in-Time Recovery (PITR), overwriting the current state; requires a paid plan with PITR and physical backups enabled.

Restore Project

Restore the given project.

Rollback Migrations

Rollback database migrations and remove them from history.

Execute read-only database query

Run a read-only SQL query against a Supabase project as supabase_read_only_user.

Select From Table

Select rows from a Supabase/PostgREST table or view, with column selection, filtering, sorting, and pagination.

Shutdown Realtime

Shut down the project Realtime service connections, disconnecting active clients.

Terminate Resumable Upload

Terminate a TUS resumable upload.

Terminate Resumable Upload Signed

Terminate a signed resumable upload.

Update Action Run Status

Update the status of an action run.

Update a function

Updates an existing Supabase Edge Function's properties, including its name, slug, source code, JWT settings, and import map, using its project reference and function slug.

Update API key

Updates an existing Supabase project API key's name, description, or JWT template without regenerating the key.

Update Backup Schedule

Update the project's backup schedule.

Update branch configuration

Updates the configuration of a Supabase database branch, allowing modification of its name, associated Git branch, notification URL, persistence settings, and status.

Update database branch config

Updates a Supabase database branch's configuration, including its name, associated Git branch, persistence, and status.

Update database password

Updates the database password for a Supabase project.

Bulk update functions

Bulk updates Edge Functions in a Supabase project with configurations such as status and version.

Update Jit Access

Update a user mapping for JIT access.

Update JIT access config

[Beta] Update a Supabase project's just-in-time (JIT) access configuration.

Update pgsodium root key

Updates a Supabase project's pgsodium root encryption key.

Update a project

Updates a Supabase project's configuration (currently supports updating the project name).

Update project's auth config

Update Supabase project Auth configuration via the Management API.

Update project's custom hostname configuration

Updates the custom hostname for a Supabase project, requiring subsequent DNS changes for SSL certificate issuance and domain ownership.

Update project legacy API keys

Deprecated by the provider; no sunset date or replacement is announced.

Update project's postgres config

Updates specified PostgreSQL configuration parameters for an existing Supabase project (`ref`) to optimize database performance; note that unspecified parameters remain unchanged, and caution is advised as incorrect settings can impact stability or require a restart.

Update project's PostgREST config

Updates PostgREST configuration settings (e.

Update database pooler config

Updates Supavisor (database pooler) configuration, including default pool size and pool mode, for an existing Supabase project identified by its reference.

Update Realtime Config

Update Realtime configuration.

Update SSL enforcement config

Updates the SSL enforcement configuration (enable/disable) for a specified Supabase project's database.

Update an SSO provider by its UUID

Updates an existing SSO provider's SAML metadata, associated email domains, or attribute mappings for a Supabase project, identified by `ref` and `provider_id`.

Update Storage Bucket

Update bucket properties.

Update Storage Config

Update project Storage configuration.

Update Storage Object

Update the object at an existing key.

Update Table Rows

Update matching rows in an exposed Supabase table or updatable view.

Upload Signed Object

Upload an object using a presigned URL.

Upload Storage Object

Upload a new object.

Upsert migration

Tool to upsert a database migration without applying it.

Reverify custom hostname

Re-verifies DNS and SSL configurations for an existing custom hostname associated with a Supabase project.

FAQ

Frequently asked questions

With a standalone Supabase MCP server, the agents and LLMs can only access a fixed set of Supabase tools tied to that server. However, with the Composio Tool Router, agents can dynamically load tools from Supabase and many other apps based on the task at hand, all through a single MCP endpoint.

Yes, you can. Mastra AI fully supports MCP integration. You get structured tool calling, message history handling, and model orchestration while Tool Router takes care of discovering and serving the right Supabase tools.

Yes, absolutely. You can configure which Supabase scopes and actions are allowed when connecting your account to Composio. You can also bring your own OAuth credentials or API configuration so you keep full control over what the agent can do.

All sensitive data such as tokens, keys, and configuration is fully encrypted at rest and in transit. Composio is SOC 2 Type 2 compliant and follows strict security practices so your Supabase data and credentials are handled as safely as possible.

Start with Supabase.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Supabase tool your agent needs.Free to start.

Start building