# 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. ## Install Merge the JSON below into your `.mcp.json`: ## Quick Use Add to your `.mcp.json`: ```json { "mcpServers": { "supabase": { "command": "npx", "args": ["-y", "@supabase/mcp-server"], "env": { "SUPABASE_URL": "https://your-project.supabase.co", "SUPABASE_SERVICE_KEY": "eyJ..." } } } } ``` Get your keys from [supabase.com/dashboard](https://supabase.com/dashboard) > Settings > API. Restart Claude Code. --- ## Intro Supabase MCP is a Model Context Protocol server that connects AI agents to Supabase — the open-source Firebase alternative with PostgreSQL, authentication, storage, and edge functions — with 4,000+ GitHub stars. Your AI agent can query databases, manage user accounts, upload files, and invoke serverless functions through natural language. Best for developers building full-stack apps with Supabase who want AI-assisted database operations and backend development. Works with: Claude Code, Cursor, any MCP client. Setup time: under 2 minutes. --- ## Available Tools ### Database Operations ``` "Show all tables in the public schema" "Query the users table for accounts created this week" "Create a new products table with name, price, and category columns" "Add an index on the email column of the users table" ``` ### Authentication ``` "List all registered users" "Create a new user with email test@example.com" "Check the auth configuration for email verification" ``` ### Storage ``` "List all buckets and their sizes" "Upload this file to the avatars bucket" "Generate a signed URL for the report.pdf file" ``` ### Edge Functions ``` "List deployed edge functions" "Show the logs for the send-email function" ``` ### SQL Execution ``` "Run this SQL: SELECT count(*) FROM orders WHERE status = 'pending'" "Explain the query plan for the products listing query" ``` ## Use Cases ### AI-Powered Data Exploration ``` "Analyze the orders table — show revenue by month for the last quarter" → Agent writes and runs SQL, presents formatted results ``` ### Schema Design ``` "Design a schema for a blog platform with posts, comments, and tags" → Agent generates CREATE TABLE statements and relationships ``` ### Migration Generation ``` "Add a soft-delete column to all tables that don't have one" → Agent generates ALTER TABLE migrations ``` ### Key Stats - 4,000+ GitHub stars - Full PostgreSQL access - Auth, Storage, Edge Functions - SQL execution and schema management - Row Level Security aware ### FAQ **Q: What is Supabase MCP?** A: An MCP server that gives AI agents full access to Supabase services — PostgreSQL database, authentication, file storage, and edge functions. **Q: Is Supabase MCP free?** A: The MCP server is open-source. Supabase has a generous free tier. **Q: Is it safe to give the agent database access?** A: Use the service key for trusted environments. For production, use scoped API keys with Row Level Security. --- ## Source & Thanks > Created by [Supabase](https://github.com/supabase). Licensed under Apache 2.0. > > [supabase](https://github.com/supabase/supabase) — ⭐ 78,000+ Thanks to Supabase for making backend-as-a-service AI-accessible. --- ## 快速使用 将以下配置添加到 `.mcp.json`: ```json { "mcpServers": { "supabase": { "command": "npx", "args": ["-y", "@supabase/mcp-server"], "env": { "SUPABASE_URL": "https://你的项目.supabase.co", "SUPABASE_SERVICE_KEY": "eyJ..." } } } } ``` --- ## 简介 Supabase MCP 是一个将 AI Agent 连接到 Supabase 的 MCP 服务器,GitHub 4,000+ stars。查询 PostgreSQL 数据库、管理用户认证、上传文件和调用边缘函数。适合用 Supabase 构建全栈应用并想要 AI 辅助后端开发的团队。 --- ## 来源与感谢 > Created by [Supabase](https://github.com/supabase). Licensed under Apache 2.0. > > [supabase](https://github.com/supabase/supabase) — ⭐ 78,000+ --- Source: https://tokrepo.com/en/workflows/b141b1a9-a134-4be5-9708-93d48ccc7ff4 Author: MCP Hub