Labsco
vinodismyname logo

Redshift Utils MCP Server

โ˜… 6

from vinodismyname

Perform database actions on Amazon Redshift via its Data API.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredAdvanced setup

Redshift Utils MCP Server

Overview

This project implements a Model Context Protocol (MCP) server designed specifically to interact with Amazon Redshift databases.

It bridges the gap between Large Language Models (LLMs) or AI assistants (like those in Claude, Cursor, or custom applications) and your Redshift data warehouse, enabling secure, standardized data access and interaction. This allows users to query data, understand database structure, and monitoring/diagnostic operations using natural language or AI-driven prompts.

This server is for developers, data analysts, or teams looking to integrate LLM capabilities directly with their Amazon Redshift data environment in a structured and secure manner.

Table of Contents

Features

  • โœจ Secure Redshift Connection (via Data API): Connects to your Amazon Redshift cluster using the AWS Redshift Data API via Boto3, leveraging AWS Secrets Manager for credentials managed securely via environment variables.
  • ๐Ÿ” Schema Discovery: Exposes MCP resources for listing schemas and tables within a specified schema.
  • ๐Ÿ“Š Metadata & Statistics: Provides a tool (handle_inspect_table) to gather detailed table metadata, statistics (like size, row counts, skew, stats staleness), and maintenance status.
  • ๐Ÿ“ Read-Only Query Execution: Offers a secure MCP tool (handle_execute_ad_hoc_query) to execute arbitrary SELECT queries against the Redshift database, enabling data retrieval based on LLM requests.
  • ๐Ÿ“ˆ Query Performance Analysis: Includes a tool (handle_diagnose_query_performance) to retrieve and analyze the execution plan, metrics, and historical data for a specific query ID.
  • ๐Ÿ” Table Inspection: Provides a tool (handle_inspect_table) to perform a comprehensive inspection of a table, including design, storage, health, and usage.
  • ๐Ÿฉบ Cluster Health Check: Offers a tool (handle_check_cluster_health) to perform a basic or full health assessment of the cluster using various diagnostic queries.
  • ๐Ÿ”’ Lock Diagnosis: Provides a tool (handle_diagnose_locks) to identify and report on current lock contention and blocking sessions.
  • ๐Ÿ“Š Workload Monitoring: Includes a tool (handle_monitor_workload) to analyze cluster workload patterns over a time window, covering WLM, top queries, and resource usage.
  • ๐Ÿ“ DDL Retrieval: Offers a tool (handle_get_table_definition) to retrieve the SHOW TABLE output (DDL) for a specified table.
  • ๐Ÿ›ก๏ธ Input Sanitization: Utilizes parameterized queries via the Boto3 Redshift Data API client where applicable to mitigate SQL injection risks.
  • ๐Ÿงฉ Standardized MCP Interface: Adheres to the Model Context Protocol specification for seamless integration with compatible clients (e.g., Claude Desktop, Cursor IDE, custom applications).

TO DO

  • Improve Prompt Options
  • Add support for more credential methods
  • Add Support for Redshift Serverless

References