Supabase MCP 服务器
模型上下文协议 (MCP) 服务器,使 AI 工具能够与 Supabase 数据库交互。该服务器提供用于读取、创建、更新和删除 Supabase 表中记录的工具。
特征
通过过滤和列选择从任何 Supabase 表中读取行
在表中创建单个或多个记录
根据过滤条件更新记录
根据过滤条件删除记录
人工智能模型理解的全面工具描述
使用 Pydantic 进行类型安全的请求/响应处理
Docker 支持,轻松部署
先决条件
Python 3.9+
Docker 和 Docker Compose
具有服务角色密钥的 Supabase 项目
兼容 FastMCP 的 AI IDE
安装
克隆存储库:
使用您的 Supabase 凭证创建一个
.env
文件:
构建并启动容器:
该服务器将在http://localhost:8000
上可用。
Docker 管理命令
Docker 问题故障排除
如果容器启动失败:
# Check logs docker-compose logs -f # Check container status docker-compose ps # Remove and rebuild docker-compose down docker-compose up --build如果遇到端口冲突:
# Stop any existing containers using port 8000 docker-compose down # Or modify the port in docker-compose.yml # ports: # - "8000:8000" # Change the first number to an available port如果环境变量未加载:
# Verify .env file exists and has correct values cat .env # Check environment variables in container docker-compose exec mcp-server env
在 AI IDE 中配置 MCP
常规配置步骤
打开你的 AI IDE 的设置/首选项
导航至 MCP 或 AI 设置部分
添加一个新的 MCP 服务器,配置如下:
IDE 特定指令
光标
打开设置(⌘,或 Ctrl+,)
前往“AI”部分
在“MCP 服务器”下,点击“添加服务器”
使用上面的配置
重新启动 Cursor 以应用更改
带有 AI 扩展的 VS Code
打开命令面板(⌘⇧P 或 Ctrl+Shift+P)
搜索“MCP”或“AI 设置”
添加新的 MCP 服务器配置
使用上面的配置
重新加载 VS Code 窗口
带有 AI 插件的 JetBrains IDE
打开设置(⌘ 或 Ctrl+Alt+S)
导航至“工具”→“AI”→“MCP 服务器”
点击“+”添加新服务器
使用上面的配置
重新启动 IDE 以应用更改
验证 MCP 连接
检查 IDE 的状态栏以了解 MCP 服务器状态
寻找绿色指示灯或“MCP 已连接”消息
尝试使用需要数据库访问的 AI 功能
检查 Docker 日志是否存在任何连接问题:
docker-compose logs -f
用法
启动 MCP 服务器:
配置您的 AI 工具以使用 MCP 服务器:
可用工具
读取行
从 Supabase 表中读取行,并可选择过滤和列。
使用示例:
创建记录
在 Supabase 表中创建一个或多个记录。
使用示例:
更新记录
根据过滤条件更新 Supabase 表中的记录。
使用示例:
删除记录
根据过滤条件从 Supabase 表中删除记录。
使用示例:
安全注意事项
始终在安全的环境中使用服务角色密钥
切勿在客户端代码中公开服务角色密钥
在 Supabase 中使用适当的行级安全策略
考虑对生产用途实施速率限制
贡献
分叉存储库
创建功能分支
提交你的更改
推送到分支
创建拉取请求
执照
麻省理工学院
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
模型上下文协议服务器,使 AI 工具能够与 Supabase 数据库交互,提供读取、创建、更新和删除 Supabase 表中记录的工具。
Related MCP Servers
- AsecurityFlicenseAqualityA Model Context Protocol (MCP) server that provides programmatic access to the Supabase Management API. This server allows AI models and other clients to manage Supabase projects and organizations through a standardized interface.Last updated -8147
- -securityFlicense-qualityA Model Context Protocol server that enables querying feature suggestions from a Supabase database, allowing AI tools like Cursor and Claude to access and display feature request data.Last updated -
- -securityFlicense-qualityA Model Context Protocol server that allows AI models to log and retrieve contact events with various authorities (police, fire, medical, etc.) with rate limiting and persistent storage via Supabase.Last updated -1
- -securityAlicense-qualityA Model Context Protocol server that provides AI assistants with comprehensive access to SQL databases, enabling schema inspection, query execution, and database operations with enterprise-grade security.Last updated -12MIT License