连接器指南阅读约 4 分钟24 个 MCP 工具7 种语言

Supabase 接入 MCP:从任意 AI 代理驱动 Supabase

让你的 AI 照看你的 Supabase 项目:列出项目并检查其健康状态,浏览 schema 和表,运行只读 SQL,读取日志、安全与性能顾问、Edge Functions、迁移、分支和 Storage 存储桶。通过 Management API 使用个人访问令牌。

HC作者:HelpCode 团队更新于 4 分钟阅读 在 GitHub 开源

无需信用卡 · 7 天试用 · 提供自托管方案

Supabase

Supabase

Let your AI look after your Supabase projects: list projects and check their health, explore schemas and tables, run read-only SQL, read logs, security and performance advisors, Edge Functions, migrations, branches and storage buckets. Through the Management API with a personal access token.

个工具

24

区域

INTL

类别

数据库

身份验证

Bearer Token

所需环境变量

SUPABASE_ACCESS_TOKEN
在 Cloud 上一键安装

7 天免费试用 · 无需信用卡

  • 7 天免费试用
    无需信用卡
  • 符合 GDPR,SOC 2 就绪
    数据驻留欧盟,审计日志
  • 在 GitHub 开源
    开源 · AGPL-3.0
  • 支持 ChatGPT、Claude、Gemini
    任何兼容 MCP 的客户端

跳过安装。2 分钟内即可运行。

在 cloud.anythingmcp.com 开始免费试用,一键添加 Supabase,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。

开始免费试用

摘要

让你的 AI 照看你的 Supabase 项目:列出项目并检查其健康状态,浏览 schema 和表,运行只读 SQL,读取日志、安全与性能顾问、Edge Functions、迁移、分支和 Storage 存储桶。通过 Management API 使用个人访问令牌。

试试这样问

Supabase 的示例提示

点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。

Supabase · 通过 MCP 实时
分享
Opus 4.7

Claude 是 AI,可能会出错。请核对回答。

💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → Supabase、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无 git clone、无本地服务器。

Supabase

让你的 AI 照看你的 Supabase 项目:列出项目并检查其健康状态,浏览 schema 和表,运行只读 SQL,读取日志、安全与性能顾问、Edge Functions、迁移、分支和 Storage 存储桶。通过 Management API 使用个人访问令牌。

设置

  1. 在 Supabase 控制台中,打开账户菜单 → Account preferences → Access Tokens(或直接访问 https://supabase.com/dashboard/account/tokens),然后点击 Generate new token。
  2. 最好使用 scoped token:选择 AI 可以查看的组织和项目,为每项能力授予 Read(只在需要修改的地方授予 Read-write)。这里的工具会用到 Projects、Project Settings、Database、Migrations、Backups、Edge Functions、API Keys(不需要 API Key Secrets)、Logs、Usage Analytics、Advisors、Storage、Development Branches 和 Organizations。
  3. 设置有效期(最长一年)并复制令牌。令牌以 sbp_ 开头,Supabase 只显示一次。
  4. 把令牌填入 SUPABASE_ACCESS_TOKEN,不要带 Bearer 字样,然后安装连接器。
  5. 先运行 supabase_list_projects:它会列出令牌能访问的每个项目及其状态和 ref。其他所有工具都需要这个 ref(即 https://<ref>.supabase.co 中的 20 个小写字母)。

之后更改访问权限:令牌创建后无法更改权限。要扩大或缩小权限,请创建一个新令牌并删除旧令牌。而旧版(不带权限范围的)令牌拥有你对所有组织的全部访问权限。

只读设置:为 scoped token 的每项能力只授予 Read。当 Database 只有 Read 权限时,连 supabase_execute_sql 也只能以只读方式运行 SQL。其他工具都不会修改数据:日常问题通过 supabase_run_read_only_sql 处理,它以只读数据库用户身份运行一条语句,超过 200 KB 的结果会被截断。

安装时默认关闭:supabase_execute_sql。它以 postgres 身份用完整权限运行 SQL,因此 DDL、写入和授权会立即生效且无法撤销。只有在 AI 需要修改数据库时才打开它;AI 会向你展示每条语句并等待你确认。需要纳入版本控制的 schema 变更,更适合放在你自己的迁移流程中。

项目所有者的视角:连接器通过 Supabase Management API 工作,而不是以应用用户身份访问,因此不经过项目的 REST API,也不受行级安全(row level security)约束。supabase_list_api_keys 会列出每个密钥的名称,但只返回公开密钥的值;secret 密钥和旧版 service_role 密钥会特意不带值列出,也没有任何工具能显示它们。Edge Functions 的代码同样不会被下载。

已暂停的项目:Free 计划的项目在一周无活动后会暂停,状态显示为 INACTIVE。在控制台中恢复项目之前,数据库相关工具都会失败。当应用报错时,先运行 supabase_get_project_health。

日志和顾问:如果不指定时间范围,supabase_query_logs 只搜索最近一分钟;时间范围最多 24 小时,并且必须在你的计划的日志保留期内(Free 为 1 天,Pro 为 7 天,Team 为 28 天)。supabase_get_security_advisors 和 supabase_get_performance_advisors 执行的检查与控制台的 Advisors 页面相同;先处理 ERROR 级别的问题,尤其是未启用行级安全就对外暴露的表。预览分支(supabase_list_branches)需要付费计划。

限制:Supabase 允许每个用户每个端点每分钟 120 个 Management API 请求(同一用户的所有令牌共享这个额度),日志和用量数据每分钟 30 个。超出后,Supabase 会在该分钟剩余时间内返回 429:等一分钟再试即可。

常见错误:401 "Invalid access token" 表示令牌错误、已过期或已被删除:请在 Access Tokens 中创建新令牌。403 表示令牌无权执行此操作:scoped token 会在 missing_permissions 中列出缺少的权限,请创建一个包含该权限的新令牌。404 表示项目 ref 未知,或项目不在令牌所属的组织中。查询日志时返回 402 表示组织的用量配额已用完。执行失败的 SQL 语句会返回 Postgres 的原始消息,例如表名没有加 schema(public.orders)时会返回 "relation "orders" does not exist"。

连接器不会创建、暂停、恢复或删除项目,不会部署 Edge Functions,不管理密钥、认证配置、自定义域名、网络限制或账单,也不会通过 PostgREST 读取你应用中的表。

前提条件: SUPABASE_ACCESS_TOKEN

本地安装连接器

curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d

打开 http://localhost:3000/connectors/store,选择 Supabase 并填入前提条件中列出的环境变量。

可用工具

ToolWhat it does
supabase_list_projectsList every project the token can reach: ref, name, organization_slug, region, status (ACTIVE_HEALTHY, INACTIVE when paused, COMING_UP…
supabase_list_organizationsList the organizations the token can reach, with their slug and name
supabase_get_organizationGet one organization by slug, including its plan (free, pro, team, enterprise)
supabase_get_projectGet one project: name, ref, organization, region, status, created_at and database host and Postgres version
supabase_get_project_healthCheck the health of a project's services: for each one name, status (ACTIVE_HEALTHY, COMING_UP, UNHEALTHY) and error or info
supabase_run_read_only_sqlRun one SQL statement as the read-only database user and return the rows as JSON objects
supabase_execute_sqlRun SQL with full rights (as postgres): DDL, inserts, updates, deletes, grants
supabase_list_schemasList the database's schemas with their owner and number of tables, leaving out Postgres' own (pg_*, information_schema)
supabase_list_tablesList the tables, views and materialized views of one or more schemas: schema, name, kind, whether row level security is on, estimated row…
supabase_describe_tableDescribe one table or view: columns (name, type, nullable, default, comment), constraints (primary key, foreign keys, unique, check, with…
supabase_list_extensionsList the Postgres extensions installed in the database: name, version and schema (on Supabase usually extensions)
supabase_list_migrationsList the migrations recorded for the database (by the Supabase CLI or the dashboard): version (timestamp) and name, oldest first
supabase_list_backupsList the project's database backups: whether point-in-time recovery is on, and each backup's status and time
supabase_generate_typescript_typesGenerate TypeScript types for the database schema, as the Supabase CLI does: one string with a Database type covering tables, views…
supabase_list_edge_functionsList the project's Edge Functions: slug, name, status, version, verify_jwt, entrypoint path and when they were created and updated (epoch…
supabase_get_edge_functionGet one Edge Function by slug: status, version, verify_jwt, entrypoint and import map paths, created and updated times
supabase_list_api_keysList the project's API keys: id, name, type (publishable, secret or legacy), prefix and description
supabase_query_logsQuery the project's logs with SQL (ClickHouse dialect) over one unified logs table: filter on source (edge_logs, postgres_logs, auth_logs…
supabase_get_api_usageGet request counts per time bucket for the project's REST, Auth, Storage and Realtime APIs over a recent interval
supabase_get_security_advisorsRun the security advisor (database linter) on the project: findings such as tables without row level security, exposed auth.users, mutable…
supabase_get_performance_advisorsRun the performance advisor on the project: findings such as unindexed foreign keys, unused or duplicate indexes, RLS policies that…
supabase_list_branchesList the project's preview branches (branching, a paid feature): id, name, project_ref of the branch, git_branch, pr_number, is_default…
supabase_get_branchGet one preview branch of a project by its name: its own project ref, git branch, pull request number, status and whether it is persistent
supabase_list_storage_bucketsList the project's Storage buckets: id, name, owner, whether public, and created and updated times

示例提示

  • “我的 Supabase 项目中哪些现在运行不正常?分别出了什么问题?”
  • “对 Acme Shop 项目运行安全顾问,告诉我哪些表在没有行级安全的情况下对外暴露。”
  • “上周 Acme Shop 项目的 public.orders 中每天创建了多少个订单?”
  • “显示 Acme Shop 日志中最近一小时的 Postgres 错误,并解释它们的原因。”

下一步

这份指南对你有帮助吗?

你的 Supabase 智能体只差一次点击。

安装连接器,粘贴密钥,向你的 AI 客户端提问。免费试用 7 天,无需信用卡。

相关指南

连接器

如何通过 MCP 将 Supabase 连接到 ChatGPT

让你的 AI 照看你的 Supabase 项目:列出项目并检查其健康状态,浏览 schema 和表,运行只读 SQL,读取日志、安全与性能顾问、Edge Functions、迁移、分支和 Storage 存储桶。通过 Management API 使用个人访问令牌。

连接器

如何通过 MCP 将 Supabase 连接到 Claude

让你的 AI 照看你的 Supabase 项目:列出项目并检查其健康状态,浏览 schema 和表,运行只读 SQL,读取日志、安全与性能顾问、Edge Functions、迁移、分支和 Storage 存储桶。通过 Management API 使用个人访问令牌。

连接器

如何通过 MCP 将 Supabase 连接到 Cursor

让你的 AI 照看你的 Supabase 项目:列出项目并检查其健康状态,浏览 schema 和表,运行只读 SQL,读取日志、安全与性能顾问、Edge Functions、迁移、分支和 Storage 存储桶。通过 Management API 使用个人访问令牌。

连接器

如何通过 MCP 将 Supabase 连接到 Gemini

让你的 AI 照看你的 Supabase 项目:列出项目并检查其健康状态,浏览 schema 和表,运行只读 SQL,读取日志、安全与性能顾问、Edge Functions、迁移、分支和 Storage 存储桶。通过 Management API 使用个人访问令牌。

连接器

如何通过 MCP 将 Supabase 连接到 Meta Muse

让你的 AI 照看你的 Supabase 项目:列出项目并检查其健康状态,浏览 schema 和表,运行只读 SQL,读取日志、安全与性能顾问、Edge Functions、迁移、分支和 Storage 存储桶。通过 Management API 使用个人访问令牌。

连接器

Canva 接入 MCP:从任意 AI 代理驱动 Canva

让你的 AI 在 Canva 中工作:查找和读取设计,创建新设计,将设计导出为 PDF、PNG、PowerPoint 或视频并获取下载链接,整理文件夹,通过链接上传图片,读取品牌模板,并在设计上发表评论。