tuyentran4992
MCP Servertuyentran4992public

supabase mcp

通过 MCP 协议连接 LLMs 和 Supabase 数据库的 Python 服务。

Repository Info

0
Stars
0
Forks
0
Watchers
0
Issues
Python
Language
-
License

About This Server

通过 MCP 协议连接 LLMs 和 Supabase 数据库的 Python 服务。

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

Supabase MCP Server

MCP (Model Context Protocol) server kết nối LLMs như Claude với cơ sở dữ liệu Supabase. Server này cung cấp các công cụ để LLMs có thể truy vấn và quản lý dữ liệu trong Supabase thông qua giao thức MCP.

Tính năng

  • Kết nối với Supabase thông qua Python SDK
  • Đọc dữ liệu từ bảng với bộ lọc và sắp xếp linh hoạt
  • Tạo bản ghi mới trong bảng
  • Cập nhật bản ghi đã tồn tại
  • Xóa bản ghi theo bộ lọc
  • Sử dụng StdioTransport cho tích hợp MCP dễ dàng

Cài đặt

Yêu cầu

  • Python 3.10+
  • Supabase project với PostgreSQL
  • Supabase Service Role Key

Thiết lập môi trường

  1. Clone repository:
git clone <repository-url>
cd supabase-mcp-server
  1. Tạo và kích hoạt môi trường ảo:
python -m venv venv
# Linux/macOS
source venv/bin/activate
# Windows
venv\Scripts\activate
  1. Cài đặt dependencies:
pip install -r requirements.txt
  1. Thiết lập biến môi trường:

Tạo file .env trong thư mục gốc và thêm các biến sau:

SUPABASE_URL=your_supabase_project_url
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key

Thiết lập Supabase

  1. Đăng nhập vào Supabase Dashboard
  2. Vào SQL Editor
  3. Thực thi script trong src/supabase_mcp/setup/create_read_only_function.sql để tạo function thực thi truy vấn read-only

Sử dụng

Chạy MCP Server

python -m src.supabase_mcp.server

Kết nối với Claude hoặc các MCP clients khác

Cấu hình Cursor với Supabase MCP Server:

  1. Tạo thư mục .cursor trong dự án nếu chưa có
  2. Tạo file .cursor/mcp.json với nội dung:
{
  "mcpServers": {
    "supabase": {
      "command": "python",
      "args": ["-m", "src.supabase_mcp.server"]
    }
  }
}
  1. Mở Cursor và vào Settings/MCP để kiểm tra kết nối

Các công cụ có sẵn

Database Tools

  • read_rows: Đọc dữ liệu từ bảng với các bộ lọc tùy chọn, giới hạn số lượng và sắp xếp.

    • Các tham số: table_name, columns, filters, limit, order_by
  • create_records: Tạo một hoặc nhiều bản ghi mới trong bảng.

    • Các tham số: table_name, data
  • update_records: Cập nhật một hoặc nhiều bản ghi trong bảng dựa trên bộ lọc.

    • Các tham số: table_name, data, filters
  • delete_records: Xóa một hoặc nhiều bản ghi từ bảng dựa trên bộ lọc.

    • Các tham số: table_name, filters

Ví dụ sử dụng

Đọc dữ liệu từ bảng

Cho tôi biết 10 người dùng mới nhất trong hệ thống.

Claude sẽ sử dụng công cụ read_rows với:

  • table_name: "users"
  • limit: 10
  • order_by: {"created_at": "desc"}

Tạo bản ghi mới

Tạo một sản phẩm mới có tên "Smartphone XYZ", giá 999.99 và thuộc danh mục "Electronics".

Claude sẽ sử dụng công cụ create_records với:

  • table_name: "products"
  • data: {"name": "Smartphone XYZ", "price": 999.99, "category": "Electronics"}

Bảo mật

  • Server này sử dụng Service Role Key nên có toàn quyền với dự án Supabase
  • Cẩn thận khi thiết lập quyền truy cập và sử dụng MCP server
  • Chỉ sử dụng trong môi trường tin cậy
  • Nên triển khai các biện pháp xác thực và phân quyền bổ sung trong môi trường sản xuất

Đóng góp

Đóng góp và báo lỗi luôn được chào đón! Vui lòng gửi pull request hoặc tạo issue trên GitHub.

Giấy phép

MIT

Quick Start

1

Clone the repository

git clone https://github.com/tuyentran4992/supabase-mcp
2

Install dependencies

cd supabase-mcp
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownertuyentran4992
Reposupabase-mcp
LanguagePython
License-
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation