Skip to main content
Glama
Supabase MCP Server

Supabase MCP Server

by NightTrek

Supabase MCP 서버

Supabase 데이터베이스와 상호 작용하기 위한 모델 컨텍스트 프로토콜(MCP) 서버입니다. 이 서버는 MCP 인터페이스를 통해 테이블 쿼리 및 TypeScript 유형 생성 도구를 제공합니다.

특징

  • 쿼리 테이블 : 다음을 지원하여 모든 테이블에 대한 쿼리를 실행합니다.

    • 스키마 선택

    • 열 필터링

    • 여러 연산자가 있는 Where 절

    • 쪽수 매기기

    • 오류 처리

  • 유형 생성 : 데이터베이스에 대한 TypeScript 유형을 생성합니다.

    • 모든 스키마(public, auth, api 등) 지원

    • 로컬 및 원격 Supabase 프로젝트 모두에서 작동합니다.

    • 콘솔에 직접 출력

    • 자동 프로젝트 참조 감지

Related MCP server: SchemaFlow MCP Server

필수 조건

  1. Node.js(v16 이상)

  2. Supabase 프로젝트(로컬 또는 호스팅)

  3. Supabase CLI(유형 생성용)

설치

  1. 저장소를 복제합니다.

지엑스피1

  1. 종속성 설치:

npm install
  1. Supabase CLI를 설치합니다(유형 생성에 필요):

# Using npm
npm install -g supabase

# Or using Homebrew on macOS
brew install supabase/tap/supabase

구성

  1. Supabase 자격증을 받으세요:

    • 호스팅 프로젝트의 경우:

      1. Supabase 프로젝트 대시보드로 이동하세요

      2. 프로젝트 설정 > API로 이동하세요.

      3. 프로젝트 URL과 service_role 키를 복사하세요(anon 키가 아님)

    • 로컬 프로젝트의 경우:

      1. 로컬 Supabase 인스턴스를 시작하세요

      2. 로컬 URL을 사용하세요(일반적으로 http://localhost:54321 )

      3. 로컬 service_role 키를 사용하세요

  2. 환경 변수 구성:

# Create a .env file (this will be ignored by git)
echo "SUPABASE_URL=your_project_url
SUPABASE_KEY=your_service_role_key" > .env
  1. 서버를 빌드하세요:

npm run build

Claude Desktop과 통합

  1. Claude Desktop 설정 열기:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

    • Windows: %APPDATA%\Claude\claude_desktop_config.json

    • 리눅스: ~/.config/Claude/claude_desktop_config.json

  2. 서버 구성을 추가합니다.

{
  "mcpServers": {
    "supabase": {
      "command": "node",
      "args": ["/absolute/path/to/supabase-mcp-server/build/index.js"],
      "env": {
        "SUPABASE_URL": "your_project_url",
        "SUPABASE_KEY": "your_service_role_key"
      }
    }
  }
}

VSCode 확장 프로그램과의 통합

  1. VSCode 설정 열기:

    • macOS: ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

    • Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json

    • 리눅스: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

  2. 서버 구성을 추가합니다(Claude Desktop과 동일한 형식).

사용 예

테이블 쿼리

// Query with schema selection and where clause
<use_mcp_tool>
<server_name>supabase</server_name>
<tool_name>query_table</tool_name>
<arguments>
{
  "schema": "public",
  "table": "users",
  "select": "id,name,email",
  "where": [
    {
      "column": "is_active",
      "operator": "eq",
      "value": true
    }
  ]
}
</arguments>
</use_mcp_tool>

유형 생성

// Generate types for public schema
<use_mcp_tool>
<server_name>supabase</server_name>
<tool_name>generate_types</tool_name>
<arguments>
{
  "schema": "public"
}
</arguments>
</use_mcp_tool>

사용 가능한 도구

쿼리_테이블

스키마 선택과 WHERE 절 지원을 사용하여 특정 테이블을 쿼리합니다.

매개변수:

  • schema (선택 사항): 데이터베이스 스키마(기본값은 public)

  • table (필수): 쿼리할 테이블의 이름

  • select (선택 사항): 쉼표로 구분된 열 목록

  • where (선택 사항): 다음 조건을 포함하는 조건 배열:

    • column : 열 이름

    • operator : eq, neq, gt, gte, lt, lte, like, ilike, is 중 하나

    • value : 비교할 값

생성_유형

Supabase 데이터베이스 스키마에 대한 TypeScript 유형을 생성합니다.

매개변수:

  • schema (선택 사항): 데이터베이스 스키마(기본값은 public)

문제 해결

유형 생성 문제

  1. Supabase CLI가 설치되어 있는지 확인하세요.

supabase --version
  1. 로컬 프로젝트의 경우:

    • 로컬 Supabase 인스턴스가 실행 중인지 확인하세요.

    • service_role 키가 올바른지 확인하세요

  2. 호스팅 프로젝트의 경우:

    • 프로젝트 참조가 올바른지 확인하세요(URL에서 추출)

    • anon 키가 아닌 service_role 키를 사용하고 있는지 확인하세요.

쿼리 문제

  1. 스키마와 테이블 이름을 확인하세요

  2. select 및 where 절에서 열 이름 확인

  3. service_role 키에 필요한 권한이 있는지 확인하세요.

기여하다

  1. 저장소를 포크하세요

  2. 기능 브랜치를 만듭니다: git checkout -b feature/my-feature

  3. 변경 사항을 커밋하세요: git commit -am 'Add my feature'

  4. 브랜치에 푸시: git push origin feature/my-feature

  5. 풀 리퀘스트 제출

특허

MIT 라이센스 - 자세한 내용은 라이센스 파일을 참조하세요.

Available Tools

2 tools
generate_typesB

Generate TypeScript types for your Supabase database schema

Inputs: schema.

query_tableC

Query a specific table with schema selection and where clause support

Inputs: table (required), schema, select, where.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools have clearly distinct purposes: generate_types focuses on TypeScript type generation from the database schema, while query_table handles data retrieval from specific tables with filtering. There is no overlap or ambiguity between these functions.

    Naming Consistency5/5

    Both tools follow a consistent verb_noun naming pattern (generate_types and query_table), using snake_case throughout. The naming is predictable and readable without any deviations.

    Tool Count2/5

    With only 2 tools, the server feels under-scoped for a Supabase integration, which typically involves operations like create, update, delete, and schema management beyond just querying and type generation. This limited set may hinder agent workflows.

    Completeness2/5

    The server lacks essential CRUD operations (e.g., insert, update, delete) and other Supabase features like authentication or real-time subscriptions, making it severely incomplete for typical database interactions. Agents will face significant gaps in functionality.

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Implements the Model Context Protocol to provide LLMs with tools for interacting with Supabase databases, supporting operations like reading, creating, updating, and deleting records with filtering and pagination capabilities.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides AI-IDEs with real-time access to PostgreSQL and Supabase database schemas through the Model Context Protocol, enabling smarter code generation in tools like Cursor, Windsurf, and VS Code + Cline.
      10
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      A Model Context Protocol server that enables interaction with self-hosted Supabase instances, allowing developers to query database schemas, manage migrations, inspect statistics, and interact with Supabase features directly from MCP-compatible development environments.
      21
      1
      ISC
    • A
      license
      Not graded
      quality
      D
      maintenance
      Connects AI assistants to Supabase projects to manage databases, execute SQL queries, and handle project configurations. It enables tasks like table management, edge function deployment, and log retrieval through the Model Context Protocol.
      Apache 2.0