Supabase

by Supabase

Recommended SSE
1.4k stars
1 downloads
Not rated
GitHub Website

About

Official Supabase MCP server for managing Supabase projects, databases, auth, storage, edge functions, and SQL workflows from AI agents.

Details

Author
Supabase
Repository
supabase/mcp
GitHub stars
1,418
Downloads
1
License
Apache License 2.0
Transport
SSE
Categories
Developer Tools, Database, Other, Infrastructure, Automation, AI, File Management, Cloud Service

- Tools grouped into account, database, knowledge base, debugging, development, edge functions, branching, and storage.
- Read‑only mode restricts the server to non‑mutating queries.
- Project‑scoped mode limits access to a single Supabase project.
- Feature groups let you enable only the tools you need.
- Supports OAuth 2.1 (cloud version) and works with most MCP clients.
- Pre‑1.0 – breaking changes may occur between versions.

Setting up with Highlight

Follow these steps to add this server as a custom Highlight plugin:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Supabase
    Command (node, npx, python, etc.) node
    Arguments
    • Argument 1 mcp.js

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

To configure the Supabase MCP server on your client, visit our setup documentation. You can also generate a custom MCP URL for your project by visiting the MCP connection tab in the Supabase dashboard.

Your MCP client will automatically prompt you to log in to Supabase during setup. Be sure to choose the organization that contains the project you wish to work with.

Most MCP clients require the following information:

{
  "mcpServers": {
    "supabase": {
      "type": "http",
      "url": "https://mcp.supabase.com/mcp"
    }
  }
}

If you don't see your MCP client listed in our documentation, check your client's MCP documentation and copy the above MCP information into their expected format (json, yaml, etc).

See the Supabase MCP Server docs for the full list of available tools and configuration options.

The docs also feature an interactive URL builder to populate configuration options for you.

The @supabase/mcp-server-supabase package exports createToolSchemas() to populate input and output schemas for Vercel AI SDK's MCP client. This allows Supabase MCP tools to be treated as static tools with client-side validation and inferred TypeScript types for their inputs and outputs.

import { createToolSchemas } from '@supabase/mcp-server-supabase';
import { createMCPClient } from '@ai-sdk/mcp';
import { streamText } from 'ai';

const mcpClient = await createMCPClient({
transport: {
type: 'http',
url: 'https://mcp.supabase.com/mcp',
},
});

const tools = await mcpClient.tools({
schemas: createToolSchemas(),
});

const result = streamText({ model, tools, prompt: '...' });

for (const step of await result.steps) {
for (const toolResult of step.staticToolResults) {
if (toolResult.toolName === 'get_project_url') {
toolResult.input; // { project_id: string }
toolResult.output; // { url: string }
}
}
}

createToolSchemas() accepts similar filtering options as the MCP server's URL parameters:

- features: Restrict to specific feature groups (e.g. ['database', 'docs']). Defaults to all default feature groups.
- projectScoped: When true, omits project_id from tool input schemas and excludes account-level tools — use when connecting to a server configured with project_ref. Defaults to false.
- readOnly: When true, excludes mutating tools — use when connecting to a server configured with read_only=true. Defaults to false.

const mcpClient = await createMCPClient({
  transport: {
    type: 'http',
    url: 'https://mcp.supabase.com/mcp?project_ref=<project-ref>&read_only=true&features=database,docs',
  },
});

const tools = await mcpClient.tools({
schemas: createToolSchemas({
features: ['database', 'docs'],
projectScoped: true,
readOnly: true,
}),
});

> [!NOTE]
> This server does not send structuredContent in MCP tool results. AI SDK falls back to parsing JSON from content text.

For more information, see Schema Definition and Typed Tool Outputs in the AI SDK docs.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "supabase": {
            "command": "node",
            "args": [
                "mcp.js"
            ],
            "env": {},
            "cwd": "path/to/your/project",
            "shell": false
        }
    }
}

Macos

{
    "command": "node",
    "args": [
        "mcp.js"
    ],
    "env": [],
    "cwd": "path/to/your/project",
    "shell": false
}

Windows

{
    "command": "node",
    "args": [
        "mcp.js"
    ],
    "env": [],
    "cwd": "path\\to\\your\\project",
    "shell": false
}

Linux

{
    "command": "node",
    "args": [
        "mcp.js"
    ],
    "env": [],
    "cwd": "/path/to/your/project",
    "shell": false
}
- **Manage database tables**— Ask your assistant to create, alter, or drop tables in your Supabase project through MCP tools like`create_table`and`alter_table`. - **Query project data**— Instruct your AI to run read-only SQL queries against your database, fetching rows, filtering results, or inspecting schema without writing code. - **Fetch project configuration**— Have your assistant retrieve project settings, connection details, or environment info using tools such as`get_project_url`to streamline setup tasks. - **Restrict tool access by feature**— Configure your MCP connection to limit available tools to specific feature groups (e.g.,`database`or`docs`) or enable read-only mode for safer AI interactions. - **Integrate with AI SDK clients**— Use`createToolSchemas()`to generate typed input/output schemas for Vercel AI SDK's MCP client, enabling static tool validation in your apps. Connect your Supabase projects to Cursor, Claude, Windsurf, and other AI assistants. The[Model Context Protocol(MCP) standardizes how Large Language Models (LLMs) talk to external services like Supabase. It connects AI assistants directly with your Supabase project and allows them to perform tasks like managing tables, fetching config, and querying data. See the](https://modelcontextprotocol.io/introduction)[full list of tools. Before setting up the MCP server, we recommend you read our](https://supabase.com/mcp#available-tools)[security best practicesto understand the risks of connecting an LLM to your Supabase projects and how to mitigate them. To configure the Supabase MCP server on your client, visit our](https://supabase.com/docs/guides/ai-tools/mcp#security-risks)[setup documentation. You can also generate a custom MCP URL for your project by visiting the](https://supabase.com/docs/guides/getting-started/mcp#step-2-configure-your-ai-tool)[MCP connection tabin the Supabase dashboard. Your MCP client will automatically prompt you to log in to Supabase during setup. Be sure to choose the organization that contains the project you wish to work with. Most MCP clients require the following information: ``` `{ "mcpServers": { "supabase": { "type": "http", "url": "https://mcp.supabase.com/mcp" } } }` ``` If you don't see your MCP client listed in our documentation, check your client's MCP documentation and copy the above MCP information into their expected format (json, yaml, etc). If you're running Supabase locally with](https://supabase.com/dashboard/project/_?showConnect=true&amp;connectTab=mcp)[Supabase CLI, you can access the MCP server at`http://localhost:54321/mcp`. Currently, the MCP Server in CLI environments offers a limited subset of tools and no OAuth 2.1. For](https://supabase.com/docs/guides/local-development/cli/getting-started)[self-hosted Supabase, check the](https://supabase.com/docs/guides/self-hosting/docker)[Enabling MCP serverpage. Currently, the MCP Server in self-hosted environments offers a limited subset of tools and no OAuth 2.1. See the](https://supabase.com/docs/guides/self-hosting/enable-mcp)[Supabase MCP Serverdocs for the full list of](https://supabase.com/mcp)[available toolsand](https://supabase.com/mcp#available-tools)[configuration options. The docs also feature an interactive URL builder to populate configuration options for you. The`@supabase/mcp-server-supabase`package exports`createToolSchemas()`to populate input and output schemas for Vercel AI SDK's](https://supabase.com/mcp#configuration-options)[MCP client. This allows Supabase MCP tools to be treated as static tools with client-side validation and inferred TypeScript types for their inputs and outputs. ``` `import { createToolSchemas } from '@supabase/mcp-server-supabase'; import { createMCPClient } from '@ai-sdk/mcp'; import { streamText } from 'ai'; const mcpClient = await createMCPClient({ transport: { type: 'http', url: 'https://mcp.supabase.com/mcp', }, }); const tools = await mcpClient.tools({ schemas: createToolSchemas(), }); const result = streamText({ model, tools, prompt: '...' }); for (const step of await result.steps) { for (const toolResult of step.staticToolResults) { if (toolResult.toolName === 'get_project_url') { toolResult.input; // { project_id: string } toolResult.output; // { url: string } } } }` ``` `createToolSchemas()`accepts similar filtering options as the MCP server's URL parameters: - `features`: Restrict to specific](https://ai-sdk.dev/docs/ai-sdk-core/mcp-tools)[feature groups(e.g.`](https://supabase.com/mcp#configuration-options)['database', 'docs']`). Defaults to all default feature groups. - `projectScoped`: When`true`, omits`project_id`from tool input schemas and excludes account-level tools — use when connecting to a server configured with`project_ref`. Defaults to`false`. - `readOnly`: When`true`, excludes mutating tools — use when connecting to a server configured with`read_only=true`. Defaults to`false`. ``` `const mcpClient = await createMCPClient({ transport: { type: 'http', url: 'https://mcp.supabase.com/mcp?project_ref=<project-ref>&read_only=true&features=database,docs', }, }); const tools = await mcpClient.tools({ schemas: createToolSchemas({ features: ['database', 'docs'], projectScoped: true, readOnly: true, }), });` ``` [!NOTE] This server does not send`structuredContent`in MCP tool results. AI SDK falls back to parsing JSON from`content`text. For more information, see[Schema Definitionand](https://ai-sdk.dev/docs/ai-sdk-core/mcp-tools#schema-definition)[Typed Tool Outputsin the AI SDK docs. The`@supabase/mcp-server-supabase`package exports`createSupabaseMcpHandler()`to serve the tools over HTTP from your own endpoint. It accepts the same`SupabaseMcpServerOptions`as`createSupabaseMcpServer()`, most importantly`platform`. The handler speaks the current protocol revision only. It is created with`legacy: 'reject'`, so a client that only speaks the 2025-era protocol receives an HTTP 400 instead of being served. When`platform`carries a per-request credential, create the handler per request and close it when the response finishes. The handler closes over the`platform`you supply, so a shared one serves every request with that platform. A long-lived handler is fine when the`platform`is meant to be shared, a service-account token for example. Create it once and`close()`it at shutdown rather than per response, since`close()`tears down the subscription router and refuses later requests. ``` `import { createServer } from 'node:http'; import { toNodeHandler } from '@modelcontextprotocol/node'; import { createSupabaseMcpHandler } from '@supabase/mcp-server-supabase'; import { createSupabaseApiPlatform } from '@supabase/mcp-server-supabase/platform/api'; const server = createServer((req, res) => { const accessToken = getAccessTokenFromRequest(req); // your own auth const handler = createSupabaseMcpHandler({ platform: createSupabaseApiPlatform({ accessToken }), }); // `close()` aborts in-flight exchanges, so close on `res` finishing rather // than when the handler resolves, which would cut streaming responses short. res.on('close', () => { handler.close().catch((error) => console.error(error)); }); toNodeHandler(handler)(req, res).catch((error) => console.error(error)); });` ``` `toNodeHandler`comes from`@modelcontextprotocol/node`, which is not a dependency of this package. Install it alongside. The PostgREST MCP server allows you to connect your own users to your app via REST API. See more details on its](https://ai-sdk.dev/docs/ai-sdk-core/mcp-tools#typed-tool-outputs)[project README. - ](https://github.com/supabase-community/supabase-mcp/blob/HEAD/packages/mcp-server-postgrest)[**Model Context Protocol**: Learn more about MCP and its capabilities. - ](https://modelcontextprotocol.io/introduction)[**From development to production**: Learn how to safely promote changes to production environments. See](https://github.com/supabase-community/supabase-mcp/blob/HEAD/docs/production.md)[CONTRIBUTINGfor details on how to contribute to this project. This project is licensed under Apache 2.0. See the](https://github.com/supabase-community/supabase-mcp/blob/HEAD/CONTRIBUTING.md)[LICENSEfile for details. Supabase runs an official remote MCP server — connect over a hosted URL instead of installing this one locally. Production-grade MCP server for Databricks: SQL Warehouses, Jobs API, multi-workspace support. Open source MCP server specializing in easy, fast, and secure tools for Databases. Query Streams securely connects MCP clients to live databases through the Query Streams Cloud Network, with no VPNs, inbound ports, or complex setup. Interact with the SingleStore database platform An MCP server for querying and interacting with AWS Athena. Visual no-code generator that turns any database into multiple scoped MCP servers — one per access group, with PII masking and fail-closed query scoping built in. A read-only MCP server for SAP HANA XS Advanced, powered by the CData JDBC Driver. Integrate with CockroachDB, a cloud-native, distributed SQL database. Securely access BigQuery datasets with intelligent caching, schema tracking, and query analytics via Supabase integration. Interact with Neon Postgres databases using natural language to manage projects, branches, queries, and migrations via the Neon API.](https://github.com/supabase-community/supabase-mcp/blob/HEAD/LICENSE)
No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.