MCP Configs2026年4月6日·1 分钟阅读

Supabase MCP — Postgres + Auth Server for AI Agents

MCP server for Supabase that gives AI agents access to PostgreSQL databases, authentication, storage, and edge functions. Query data, manage users, and build full-stack features. 4,000+ stars.

Agent 就绪

这个资产会安全暂存

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

Stage only · 17/100策略:需暂存
Agent 入口
任意 MCP/CLI Agent
类型
Mcp Config
安装
Stage only
信任
信任等级:Community
入口
Supabase MCP — Postgres + Auth Server for AI Agents
安全暂存命令
npx -y tokrepo@latest install b141b1a9-a134-4be5-9708-93d48ccc7ff4 --target codex

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

TL;DR
Supabase MCP connects AI agents to Supabase PostgreSQL databases, auth, storage, and edge functions via MCP.
§01

What it is

Supabase MCP is a Model Context Protocol server that connects AI agents to Supabase services. It provides access to PostgreSQL databases, authentication, file storage, and edge functions through the MCP tool interface.

Supabase MCP targets AI developers building agents that need to query databases, manage users, or interact with Supabase-hosted applications -- all through natural language commands in their AI client.

§02

How it saves time or tokens

Instead of writing SQL queries manually or building API integrations, developers can ask their AI agent to query data, create users, or manage storage directly. The MCP server handles the Supabase API calls and returns structured results. Token estimate is approximately 2400 tokens per session.

§03

How to use

  1. Add Supabase MCP to your .mcp.json:
{
  "mcpServers": {
    "supabase": {
      "command": "npx",
      "args": ["-y", "@supabase/mcp-server"],
      "env": {
        "SUPABASE_URL": "https://your-project.supabase.co",
        "SUPABASE_SERVICE_KEY": "eyJ..."
      }
    }
  }
}
  1. Get your keys from Supabase Dashboard > Settings > API.
  1. Restart your AI client and start querying your database.
§04

Example

-- Example queries the agent can execute via Supabase MCP:
-- 'Show me all users who signed up this week'
SELECT id, email, created_at
FROM auth.users
WHERE created_at >= NOW() - INTERVAL '7 days'
ORDER BY created_at DESC;

-- 'Count active projects by status'
SELECT status, COUNT(*) as total
FROM projects
WHERE deleted_at IS NULL
GROUP BY status;
§05

Related on TokRepo

§06

Common pitfalls

  • The SUPABASE_SERVICE_KEY has admin-level access. Never expose it in client-side code or public repositories.
  • MCP tool calls execute real queries against your database. Use a development project for testing before connecting production.
  • Row-level security (RLS) policies are bypassed when using the service key. Ensure your agent queries do not expose sensitive data.

常见问题

What Supabase services does the MCP server expose?+

The Supabase MCP server provides access to PostgreSQL queries (select, insert, update, delete), authentication user management, file storage operations, and edge function invocation.

Is the Supabase MCP server official?+

Yes. The @supabase/mcp-server package is published by Supabase and maintained as part of their official tooling for AI agent integrations.

Can Supabase MCP run SQL queries?+

Yes. The agent can execute arbitrary SQL queries against your Supabase PostgreSQL database. This includes SELECT, INSERT, UPDATE, DELETE, and DDL operations depending on the service key permissions.

Does Supabase MCP support real-time subscriptions?+

The MCP protocol is request-response based. Real-time subscriptions (Supabase Realtime) are not supported through MCP. Use the Supabase client SDK directly for real-time features.

How do I secure my Supabase MCP connection?+

Use environment variables for the service key, never commit it to version control. Consider using a read-only database role for the service key if write access is not needed.

引用来源 (3)
🙏

来源与感谢

Created by Supabase. Licensed under Apache 2.0.

supabase — ⭐ 78,000+

讨论

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

相关资产