Redshift MCP Server

by Moonlight-CL
Apache 2.0

Redshift MCP 서버

Amazon Redshift용 MCP(Model Context Protocol) 서버로, AI 어시스턴트가 Redshift 데이터베이스와 상호 작용할 수 있도록 해줍니다.

소개

Redshift MCP 서버는 Amazon Redshift 데이터베이스와 상호 작용하기 위한 도구와 리소스를 제공하는 모델 컨텍스트 프로토콜(Model Context Protocol) 의 Python 기반 구현입니다. 이를 통해 AI 비서가 다음과 같은 작업을 수행할 수 있습니다.

  • Redshift 데이터베이스의 스키마 및 테이블 나열
  • 테이블 DDL(데이터 정의 언어) 스크립트 검색
  • 테이블 통계 가져오기
  • SQL 쿼리 실행
  • 통계 정보를 수집하기 위해 테이블을 분석합니다.
  • SQL 쿼리에 대한 실행 계획 가져오기

설치

필수 조건

  • Python 3.13 이상
  • Amazon Redshift 클러스터
  • Redshift 자격 증명(호스트, 포트, 사용자 이름, 비밀번호, 데이터베이스)

소스에서 설치

지엑스피1

구성

서버에는 Redshift 클러스터에 연결하기 위해 다음과 같은 환경 변수가 필요합니다.

RS_HOST=your-redshift-cluster.region.redshift.amazonaws.com RS_PORT=5439 RS_USER=your_username RS_PASSWORD=your_password RS_DATABASE=your_database RS_SCHEMA=your_schema # Optional, defaults to "public"

이러한 환경 변수를 직접 설정하거나 .env 파일을 사용할 수 있습니다.

용법

서버 시작

# Start the server uv run --with mcp python-dotenv redshift-connector mcp mcp run src/redshift_mcp_server/server.py

AI 어시스턴트와 통합

MCP를 지원하는 AI 어시스턴트와 함께 이 서버를 사용하려면 MCP 설정에 다음 구성을 추가하세요.

{ "mcpServers": { "redshift": { "command": "uv", "args": ["--directory", "src/redshift_mcp_server", "run", "server.py"], "env": { "RS_HOST": "your-redshift-cluster.region.redshift.amazonaws.com", "RS_PORT": "5439", "RS_USER": "your_username", "RS_PASSWORD": "your_password", "RS_DATABASE": "your_database", "RS_SCHEMA": "your_schema" } } } }

특징

자원

서버는 다음과 같은 리소스를 제공합니다.

  • rs:///schemas - 데이터베이스의 모든 스키마를 나열합니다.
  • rs:///{schema}/tables - 특정 스키마의 모든 테이블을 나열합니다.
  • rs:///{schema}/{table}/ddl - 특정 테이블에 대한 DDL 스크립트를 가져옵니다.
  • rs:///{schema}/{table}/statistic - 특정 테이블에 대한 통계를 가져옵니다.

도구

서버는 다음과 같은 도구를 제공합니다.

  • execute_sql - Redshift 클러스터에서 SQL 쿼리를 실행합니다.
  • analyze_table - 통계 정보를 수집하기 위해 테이블을 분석합니다.
  • get_execution_plan - SQL 쿼리에 대한 런타임 통계와 함께 실행 계획을 가져옵니다.

예시

스키마 나열

access_mcp_resource("redshift-mcp-server", "rs:///schemas")

스키마에 테이블 나열

access_mcp_resource("redshift-mcp-server", "rs:///public/tables")

테이블 DDL 가져오기

access_mcp_resource("redshift-mcp-server", "rs:///public/users/ddl")

SQL 실행

use_mcp_tool("redshift-mcp-server", "execute_sql", {"sql": "SELECT * FROM public.users LIMIT 10"})

테이블 분석

use_mcp_tool("redshift-mcp-server", "analyze_table", {"schema": "public", "table": "users"})

실행 계획 얻기

use_mcp_tool("redshift-mcp-server", "get_execution_plan", {"sql": "SELECT * FROM public.users WHERE user_id = 123"})

개발

프로젝트 구조

redshift-mcp-server/ ├── src/ │ └── redshift_mcp_server/ │ ├── __init__.py │ └── server.py ├── pyproject.toml └── README.md

종속성

  • mcp[cli]>=1.5.0 - 모델 컨텍스트 프로토콜 SDK
  • python-dotenv>=1.1.0 - .env 파일에서 환경 변수를 로드하기 위해
  • redshift-connector>=2.1.5 - Amazon Redshift용 Python 커넥터
-
security - not tested
A
license - permissive license
-
quality - not tested

AI 어시스턴트가 Amazon Redshift 데이터베이스와 상호 작용하여 스키마 탐색, 쿼리 실행, 통계 수집을 수행할 수 있도록 하는 모델 컨텍스트 프로토콜 서버입니다.

  1. Introduction
    1. Installation
      1. Prerequisites
      2. Install from source
    2. Configuration
      1. Usage
        1. Starting the server
        2. Integrating with AI assistants
      2. Features
        1. Resources
        2. Tools
      3. Examples
        1. Listing schemas
        2. Listing tables in a schema
        3. Getting table DDL
        4. Executing SQL
        5. Analyzing a table
        6. Getting execution plan
      4. Development
        1. Project structure
        2. Dependencies

      Related MCP Servers

      • -
        security
        F
        license
        -
        quality
        A Model Context Protocol server that integrates with Amazon Braket, allowing AI assistants to access, control, and interpret results from quantum computing resources.
        Last updated -
        TypeScript
      • A
        security
        A
        license
        A
        quality
        A Model Context Protocol server that provides a standardized interface for AI models to interact with NASA's vast array of data sources including APOD, Mars Rover photos, satellite imagery, and space weather data.
        Last updated -
        24
        104
        23
        TypeScript
        ISC License
        • Apple
        • Linux
      • -
        security
        F
        license
        -
        quality
        A Model Context Protocol server that provides persistent task management capabilities for AI assistants, allowing them to create, update, and track tasks beyond their usual context limitations.
        Last updated -
        1
        TypeScript
      • A
        security
        A
        license
        A
        quality
        A Model Context Protocol server that enables AI agents to interact with Alibaba Cloud DataWorks through standardized interfaces, allowing seamless management of DataWorks resources and operations via the DataWorks Open API.
        Last updated -
        169
        446
        15
        TypeScript
        Apache 2.0

      View all related MCP servers

      ID: vvnws2k0dd