# Supabase 官方 MCP 服务器 — Postgres SQL、RLS 审核和边缘日志 (`supabase-mcp`)

> 管理 Supabase 分支、执行作用域 PostgreSQL 查询、检查行级安全策略并通过 STDIO 生成 TypeScript 数据库类型。

- **Canonical URL:** https://syndipath.com/zh/mcp/supabase-mcp
- **Runtime:** `npm` | **Transport:** STDIO | **License:** Apache-2.0 | **Package:** `@supabase/mcp-server-supabase`
- **Upvotes:** 884 | **GitHub Stars:** 8940 | **Weekly Installs:** 68200
- **Security Note:** HTTP-200 在 NPM 注册中心（@supabase/mcp-server-supabase）上验证；通过 npx 在工作区范围的 STDIO 会话中运行。

## Quick CLI Setup
```bash
# Run directly via Node npx
npx -y @supabase/mcp-server-supabase

# Add to Claude Code CLI
claude mcp add -e SUPABASE_ACCESS_TOKEN=${SUPABASE_ACCESS_TOKEN} supabase-mcp -- npx -y @supabase/mcp-server-supabase
```

## MCP Manifest (`mcp.json`)
```json
{
  "mcpServers": {
    "supabase-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@supabase/mcp-server-supabase"
      ],
      "env": {
        "SUPABASE_ACCESS_TOKEN": "${SUPABASE_ACCESS_TOKEN}"
      }
    }
  }
}
```

## Exposed MCP Tools
- `supabase_mcp_query(sql_or_filter: string, limit?: number)`: Manage Supabase branches, execute scoped PostgreSQL queries, inspect Row-Level Security policies, and generate TypeScript database type.
- `supabase_mcp_inspect_schema(namespace?: string)`: Enumerates tables, collections, column types, and active index definitions.
