MCP Configs2026年3月31日·1 分钟阅读

Supabase MCP — Database & Auth for AI Agents

Official Supabase MCP server. Connect AI agents to Supabase for database queries, auth management, storage, edge functions, and real-time subscriptions. 2.6K+ stars.

Agent 就绪

这个资产会安全暂存

这个资产会先安全暂存。复制的指令会要求 Agent 读取暂存文件,并在激活脚本、MCP 配置或全局配置前先确认。

Stage only · 17/100策略:需暂存
Agent 入口
任意 MCP/CLI Agent
类型
Mcp Config
安装
Stage only
信任
信任等级:Community
入口
Supabase MCP — Database & Auth for AI Agents
安全暂存命令
npx -y tokrepo@latest install e54d5caa-6a9d-449d-aef7-5e7cf8de2781 --target codex

先暂存文件;激活前需要读取暂存 README 和安装计划。

TL;DR
Official Supabase MCP server lets AI agents query databases, manage auth, access storage, and call edge functions in your Supabase project.
§01

What it is

Supabase MCP is the official Model Context Protocol server built by Supabase. It lets AI coding assistants like Claude Code or Cursor interact with your Supabase project directly -- running SQL queries, managing authentication, accessing file storage, calling edge functions, and subscribing to real-time changes.

It targets developers who build applications on Supabase and want their AI agent to understand their database schema, write queries, debug issues, and manage backend resources without context-switching to the Supabase dashboard.

§02

How it saves time or tokens

Instead of manually describing your database schema to the AI or copy-pasting query results, the MCP server gives the agent direct access. The agent can inspect your tables, understand relationships, write and test SQL queries, and even create database migrations. This eliminates the schema-description overhead that wastes both your time and prompt tokens.

§03

How to use

  1. Add the Supabase MCP server to your editor configuration:
{
  "mcpServers": {
    "supabase": {
      "command": "npx",
      "args": [
        "-y",
        "@supabase/mcp-server-supabase@latest",
        "--access-token",
        "sbp_YOUR_TOKEN"
      ]
    }
  }
}
  1. Generate a personal access token at https://supabase.com/dashboard/account/tokens.
  2. Restart your AI editor.
  3. Ask the agent to interact with your Supabase project:
'Show me the schema of the users table and suggest an index for the email column.'
§04

Example

CapabilityWhat the agent can do
DatabaseRead schema, run SQL, create migrations
AuthList users, check policies, debug RLS
StorageList buckets, manage files
Edge FunctionsList and invoke functions
Real-timeConfigure subscriptions
§05

Related on TokRepo

§06

Common pitfalls

  • The personal access token grants broad access to your Supabase project. Use a token scoped to development projects, not production, when experimenting with AI agents.
  • Row Level Security (RLS) policies apply to SQL queries run through the MCP server. If your queries return empty results, check that the token's role has the necessary permissions.
  • Schema changes made by the agent (CREATE TABLE, ALTER TABLE) are applied immediately. Review generated migrations before letting the agent execute them.

常见问题

Is this the official Supabase MCP server?+

Yes. This MCP server is built and maintained by Supabase under the @supabase npm organization. It is the official integration for connecting AI agents to Supabase projects. It follows the Model Context Protocol standard and works with any MCP-compatible editor.

Can the agent modify my production database?+

The agent can run any SQL that the access token permits, including writes and schema changes. To protect production data, use a token scoped to your development or staging project. Never use a production token during development or experimentation with AI agents.

Does it support Supabase Edge Functions?+

Yes. The MCP server can list your deployed edge functions and invoke them. This lets the AI agent trigger serverless functions as part of its workflow. You can use this to test edge functions, debug issues, or chain function calls during development.

How does RLS interact with the MCP server?+

The MCP server connects using your personal access token, which typically has service_role or anon level access depending on configuration. RLS policies are enforced based on this role. If you want the agent to see data as a specific user, configure the token accordingly.

Can I use this with self-hosted Supabase?+

The MCP server is designed for Supabase Cloud projects authenticated via personal access tokens. For self-hosted Supabase, you would need to configure the server to point to your self-hosted instance, which may require additional setup. Check the repository documentation for self-hosted configuration options.

引用来源 (3)
🙏

来源与感谢

Created by Supabase. Licensed under Apache 2.0. supabase-community/supabase-mcp — 2,600+ GitHub stars

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产