supabase-mcp

Integrations

  • Acts as a bridge between MCP clients and Supabase services, providing database operations, storage management, edge function invocation, project/organization management, and user authentication/management

Supabase MCP 서버

Supabase 데이터베이스, 스토리지 및 에지 기능과의 상호 작용을 위한 포괄적인 도구를 제공하는 모델 컨텍스트 프로토콜(MCP) 서버입니다. 이 서버는 Supabase 서비스와 MCP 호환 애플리케이션 간의 원활한 통합을 지원합니다.

개요

Supabase MCP 서버는 MCP 클라이언트와 Supabase 서비스 제품군 간의 브리지 역할을 하며 다음을 제공합니다.

  • 풍부한 쿼리 기능을 갖춘 데이터베이스 작업
  • 파일 및 자산에 대한 스토리지 관리
  • 에지 함수 호출
  • 프로젝트 및 조직 관리
  • 사용자 인증 및 관리
  • 역할 기반 액세스 제어

건축학

서버는 TypeScript를 사용하여 구축되었으며 모듈식 아키텍처를 따릅니다.

지엑스피1

주요 구성 요소

  • 서버 클래스 : MCP 서버 인터페이스를 구현하고 모든 클라이언트 요청을 처리합니다.
  • 유형 정의 : 모든 작업에 대한 포괄적인 TypeScript 정의
  • 환경 구성 : 환경 변수를 통한 안전한 구성 관리
  • 오류 처리 : 자세한 오류 메시지를 통한 강력한 오류 처리

필수 조건

  • Node.js 16.x 이상
  • Supabase 프로젝트:
    • 프로젝트 URL
    • 서비스 역할 키(관리 작업용)
    • 액세스 토큰(관리 작업용)
  • MCP 호환 클라이언트

설치

Smithery를 통해 설치

Smithery 를 통해 Claude Desktop용 Supabase Server를 자동으로 설치하려면:

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 } } }

사용 가능한 도구

데이터베이스 작업

레코드 생성

특정 필드를 반환하는 기능을 지원하여 테이블에 새 레코드를 만듭니다.

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

예:

{ table: "users", data: { name: "John Doe", email: "john@example.com" }, returning: ["id", "created_at"] }
읽기_레코드

고급 필터링, 조인 및 필드 선택을 통해 레코드를 읽습니다.

{ 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" }] }
업데이트_레코드

필터링 및 반환 기능을 사용하여 레코드를 업데이트합니다.

{ 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"] }
삭제_레코드

필터링 및 반환 기능을 사용하여 레코드를 삭제합니다.

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

예:

{ table: "posts", filter: { status: "draft" }, returning: ["id", "title"] }

저장 작업

업로드_파일

구성 가능한 옵션을 사용하여 Supabase 저장소에 파일을 업로드합니다.

{ bucket: string; path: string; file: File | Blob; options?: { cacheControl?: string; contentType?: string; upsert?: boolean; }; }

예:

{ bucket: "avatars", path: "users/123/profile.jpg", file: imageBlob, options: { contentType: "image/jpeg", upsert: true } }
다운로드_파일

Supabase Storage에서 파일을 다운로드하세요.

{ bucket: string; path: string; }

예:

{ bucket: "documents", path: "reports/annual-2023.pdf" }

에지 함수

호출_함수

매개변수와 사용자 정의 옵션을 사용하여 Supabase Edge Functions를 호출합니다.

{ function: string; params?: Record<string, any>; options?: { headers?: Record<string, string>; responseType?: 'json' | 'text' | 'arraybuffer'; }; }

예:

{ function: "process-image", params: { url: "https://example.com/image.jpg", width: 800 }, options: { responseType: "json" } }

사용자 관리

사용자 목록

페이지 분할 기능을 통해 사용자 목록을 표시합니다.

{ page?: number; per_page?: number; }
사용자 생성

메타데이터로 새로운 사용자를 만듭니다.

{ email: string; password: string; data?: Record<string, any>; }
업데이트_사용자

사용자 세부 정보를 업데이트합니다.

{ user_id: string; email?: string; password?: string; data?: Record<string, any>; }
사용자 삭제

사용자를 삭제합니다.

{ user_id: string; }
사용자 역할 할당

사용자에게 역할을 할당합니다.

{ user_id: string; role: string; }
사용자 역할 제거

사용자에게서 역할을 제거합니다.

{ user_id: string; role: string; }

오류 처리

서버는 일반적인 시나리오에 대한 자세한 오류 메시지를 제공합니다.

  • 잘못된 매개변수
  • 인증 실패
  • 권한 문제
  • 속도 제한
  • 네트워크 오류
  • 데이터베이스 제약 조건

오류는 표준화된 형식으로 반환됩니다.

{ code: ErrorCode; message: string; details?: any; }

개발

테스트 실행

npm test

건물

npm run build

린팅

npm run lint

실행 평가

evals 패키지는 index.ts 파일을 실행하는 mcp 클라이언트를 로드하므로 테스트 사이에 다시 빌드할 필요가 없습니다. npx 명령 앞에 접두사를 붙여 환경 변수를 로드할 수 있습니다. 전체 문서는 여기에서 확인할 수 있습니다.

OPENAI_API_KEY=your-key npx mcp-eval src/evals/evals.ts src/index.ts

기여하다

  1. 저장소를 포크하세요
  2. 기능 브랜치 생성
  3. 변경 사항을 커밋하세요
  4. 지점으로 밀어 넣기
  5. 풀 리퀘스트 만들기

특허

MIT 라이선스 - 자세한 내용은 라이선스를 참조하세요.

지원하다

지원을 원하시면 다음을 클릭하세요.

  1. 기존 문제/해결책에 대한 이슈를 확인하세요
  2. 자세한 재생산 단계를 포함하는 새로운 이슈를 생성합니다.
  3. 관련 오류 메시지와 환경 세부 정보를 포함합니다.

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

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.

Supabase 데이터베이스, 스토리지 및 에지 기능과 상호 작용하기 위한 도구를 제공하는 MCP 서버입니다.

  1. Overview
    1. Architecture
      1. Key Components
    2. Prerequisites
      1. Installation
        1. Installing via Smithery
      2. Configuration
        1. Server Configuration
        2. Supabase Configuration
        3. Logging Configuration
        4. Security Configuration
        5. Monitoring Configuration
      3. MCP Integration
        1. Available Tools
          1. Database Operations
          2. Storage Operations
          3. Edge Functions
          4. User Management
        2. Error Handling
          1. Development
            1. Running Tests
            2. Building
            3. Linting
            4. Running evals
          2. Contributing
            1. License
              1. Support

                Related MCP Servers

                • A
                  security
                  F
                  license
                  A
                  quality
                  A 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 5 months ago
                  8
                  84
                  27
                  JavaScript
                • A
                  security
                  A
                  license
                  A
                  quality
                  This server enables interaction with Supabase PostgreSQL databases through the MCP protocol, allowing seamless integration with Cursor and Windsurf IDEs for secure and validated database management.
                  Last updated 16 days ago
                  11
                  649
                  Python
                  Apache 2.0
                  • Apple
                  • Linux
                • -
                  security
                  A
                  license
                  -
                  quality
                  An MCP server that connects to Supabase PostgreSQL databases, exposing table schemas as resources and providing tools for data analysis through SQL queries.
                  Last updated 3 days ago
                  JavaScript
                  MIT License
                • A
                  security
                  A
                  license
                  A
                  quality
                  MCP server that allows interaction with PocketBase databases, enabling record operations (fetch, list, create, update), file management, and schema migrations through natural language.
                  Last updated 11 days ago
                  20
                  8
                  TypeScript
                  MIT License
                  • Linux
                  • Apple

                View all related MCP servers

                ID: vwi6nt8i80