PolarHub
  • Agents
  • MCP Servers
  • Skills
  • PolarBear
PolarHub © 2026
MCP ServersdatabasesSupabase MCP工具
返回「databases」

Supabase MCP工具

modelscope·@DynamicEndpoints/supabase-mcp

databases0下载LocalModelScope

简介

一个提供与 Supabase 数据库、存储和边缘函数交互工具的 MCP 服务器。

MCP Server 详情

来自 ModelScope 索引

Supabase MCP 服务器

smithery 徽章 这是一个 Model Context Protocol (MCP) 服务器,提供了与 Supabase 数据库、存储和边缘函数交互的全面工具。该服务器实现了 Supabase 服务与 MCP 兼容应用程序之间的无缝集成。

<a href="https://glama.ai/mcp/servers/vwi6nt8i80"><img width="380" height="200" src="https://glama.ai/mcp/servers/vwi6nt8i80/badge" alt="supabase-mcp MCP 服务器" /></a>

概览

Supabase MCP 服务器充当 MCP 客户端与 Supabase 服务套件之间的桥梁,提供以下功能:

  • 带有丰富查询能力的数据库操作
  • 文件和资产的存储管理
  • 边缘函数调用
  • 项目和组织管理
  • 用户认证和管理
  • 基于角色的访问控制

架构

该服务器使用 TypeScript 构建,并遵循模块化架构:

supabase-server/
├── src/
│   ├── index.ts              # Main server implementation
│   └── types/
│       └── supabase.d.ts     # Type definitions
├── package.json
├── tsconfig.json
├── config.json.example       # Example configuration file
└── .env.example             # Environment variables template

关键组件

  • Server 类:实现 MCP 服务器接口并处理所有客户端请求
  • 类型定义:为所有操作提供全面的 TypeScript 定义
  • 环境配置:通过环境变量进行安全的配置管理
  • 错误处理:具有详细错误信息的强大错误处理

前提条件

  • Node.js 16.x 或更高版本
  • 一个包含以下内容的 Supabase 项目:
    • 项目 URL
    • 服务角色密钥(用于管理员操作)
    • 访问令牌(用于管理操作)
  • MCP 兼容的客户端

安装

通过 Smithery 安装

要通过 Smithery 自动安装适用于 Claude Desktop 的 Supabase 服务器:

npx -y @smithery/cli install supabase-server --client claude
  1. 克隆仓库:
git clone https://github.com/DynamicEndpoints/supabase-mcp.git
cd supabase-mcp
  1. 安装依赖项:
npm install
  1. 创建环境配置:
cp .env.example .env
  1. 配置环境变量:
SUPABASE_URL=your_project_url_here
SUPABASE_KEY=your_service_role_key_here
SUPABASE_ACCESS_TOKEN=your_access_token_here  # Required for management operations
  1. 创建服务器配置:
cp config.json.example config.json
  1. 构建服务器:
npm run build

配置

服务器通过环境变量和 config.json 文件支持广泛的配置选项。以下是配置选项的详细说明:

服务器配置

{
  "server": {
    "name": "supabase-server",    // Server name
    "version": "0.1.0",           // Server version
    "port": 3000,                 // Port number (if running standalone)
    "host": "localhost"           // Host address (if running standalone)
  }
}

Supabase 配置

{
  "supabase": {
    "project": {
      "url": "your_project_url",
      "key": "your_service_role_key",
      "accessToken": "your_access_token"
    },
    "storage": {
      "defaultBucket": "public",           // Default storage bucket
      "maxFileSize": 52428800,            // Max file size in bytes (50MB)
      "allowedMimeTypes": [               // Allowed file types
        "image/*",
        "application/pdf",
        "text/*"
      ]
    },
    "database": {
      "maxConnections": 10,               // Max DB connections
      "timeout": 30000,                   // Query timeout in ms
      "ssl": true                         // SSL connection
    },
    "auth": {
      "autoConfirmUsers": false,          // Auto-confirm new users
      "disableSignup": false,             // Disable public signups
      "jwt": {
        "expiresIn": "1h",               // Token expiration
        "algorithm": "HS256"              // JWT algorithm
      }
    }
  }
}

日志配置

{
  "logging": {
    "level": "info",                      // Log level
    "format": "json",                     // Log format
    "outputs": ["console", "file"],       // Output destinations
    "file": {
      "path": "logs/server.log",          // Log file path
      "maxSize": "10m",                   // Max file size
      "maxFiles": 5                       // Max number of files
    }
  }
}

安全配置

{
  "security": {
    "cors": {
      "enabled": true,
      "origins": ["*"],
      "methods": ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
      "allowedHeaders": ["Content-Type", "Authorization"]
    },
    "rateLimit": {
      "enabled": true,
      "windowMs": 900000,                 // 15 minutes
      "max": 100                          // Max requests per window
    }
  }
}

监控配置

{
  "monitoring": {
    "enabled": true,
    "metrics": {
      "collect": true,
      "interval": 60000                   // Collection interval in ms
    },
    "health": {
      "enabled": true,
      "path": "/health"                   // Health check endpoint
    }
  }
}

请参阅 config.json.example 以获取完整的示例配置文件。

MCP 集成

将服务器添加到您的 MCP 设置中(cline_mcp_settings.json):

{
  "mcpServers": {
    "supabase": {
      "command": "node",
      "args": ["path/to/supabase-server/build/index.js"],
      "env": {
        "SUPABASE_URL": "your_project_url",
        "SUPABASE_KEY": "your_service_role_key",
        "SUPABASE_ACCESS_TOKEN": "your_access_token"
      },
      "config": "path/to/config.json"  // Optional: path to configuration file
    }
  }
}

可用工具

数据库操作

create_record

在表中创建新记录,并支持返回特定字段。

{
  table: string;
  data: Record<string, any>;
  returning?: string[];
}

示例:

{
  table: "users",
  data: {
    name: "John Doe",
    email: "john@example.com"
  },
  returning: ["id", "created_at"]
}

read_records

读取带有高级过滤、连接和字段选择的记录。

{
  table: string;
  select?: string[];
  filter?: Record<string, any>;
  joins?: Array<{
    type?: 'inner' | 'left' | 'right' | 'full';
    table: string;
    on: string;
  }>;
}

示例:

{
  table: "posts",
  select: ["id", "title", "user.name"],
  filter: { published: true },
  joins: [{
    type: "left",
    table: "users",
    on: "posts.user_id=users.id"
  }]
}

update_record

更新带有过滤和返回功能的记录。

{
  table: string;
  data: Record<string, any>;
  filter?: Record<string, any>;
  returning?: string[];
}

示例:

{
  table: "users",
  data: { status: "active" },
  filter: { email: "john@example.com" },
  returning: ["id", "status", "updated_at"]
}

delete_record

删除带有过滤和返回功能的记录。

{
  table: string;
  filter?: Record<string, any>;
  returning?: string[];
}
``…

相关 MCP Servers(来自「databases」)

千牛安全审计

审计 npm 包依赖项以查找安全漏洞,提供详细的报告和修复建议,并集成 MCP。

@qianniuspace/mcp-security-audit

Claude 数据库连接器

通过API层将克劳德桌面版直接连接到数据库,使其能够探索数据库结构、编写SQL查询、分析数据集和创建报告。该API层还包含用于表探索和查询执行的工具。

@runekaagaard/mcp-alchemy

DBCode数据库管理工具

DBCode 是一个 Visual Studio Code 扩展,允许你管理许多数据库,包括 PostgreSQL、MySQL、SQL Server、DuckDB、Redis、MongoDB 等更多数据库。 DBCode 提供了运行 MCP 服务器的选项,可以访问这些数据库、它们的模式以及执行查询的能力。

@dbcodeio/public

DMS-数据库安全访问

AI 首选的统一数据访问通道,支持30多种数据源(阿里云全系/主流数据库/数仓)的安全访问。

@aliyun/alibabacloud-dms-mcp-server

Doris模型控制面板服务

后端服务,实现了模型控制面板协议,可连接到 Apache Doris 数据库,允许用户执行 SQL 查询、管理元数据,并且有可能利用大语言模型(LLMs)完成自然语言到 SQL 的转换等任务。

@apache/doris-mcp-server

Excel服务器

提供对Excel文件的操纵功能。此服务器启用工作簿创建、数据操纵、格式设置和高级Excel功能。

@haris-musa/excel-mcp-server

自动安装

点击按钮会唤起 PolarBear 客户端,并把当前 MCP Server 的 Markdown 详情文档地址传给客户端。

/api/mcps/dynamicendpoints-supabase-mcp/markdown
打开 PolarBear 安装查看 Markdown 文档

手动安装

在 PolarBear 或其他支持 MCP 的客户端中,新建 MCP Server,并参考下方来源或安装提示配置。

supabase-server/ ├── src/ │ ├── index.ts # Main server implementation │ └── types/ │ └── supabase.d.ts # Type definitions ├── package.json ├── tsconfig.json ├── config.json.example # Example configuration file └── .env.example # Environment variables template ``` ### 关键组件 - **Server 类**:实现 MCP 服务器接口并处理所有客户端请求 - **类型定义**:为所有操作提供全面的 TypeScript 定义 - **环境配置**:通过环境变量进行安全的配置管理 - **错误处理**:具有详细错误信息的强大错误处理 ## 前提条件 - Node.js 16.x 或更高版本 - 一个包含以下内容的 Supabase 项目: - 项目 URL - 服务角色密钥(用于管理员操作) - 访问令牌(用于管理操作) - MCP 兼容的客户端 ## 安装 ### 通过 Smithery 安装 要通过 [Smithery](https://smithery.ai/server/supabase-server) 自动安装适用于 Claude Desktop 的 Supabase 服务器:

基本信息

分类
databases / cloud-storage
运行方式
No
许可证
MIT License
详情文件
dynamicendpoints-supabase-mcp.md