# Amazon Redshift MCP Server
Model Context Protocol (MCP) server for Amazon Redshift.
This MCP server provides tools to discover, explore, and query Amazon Redshift clusters and serverless workgroups. It enables AI assistants to interact with Redshift resources safely and efficiently through a comprehensive set of discovery and query execution tools.
## Features
- **Cluster Discovery**: Automatically discover both provisioned Redshift clusters and serverless workgroups
- **Metadata Exploration**: Browse databases, schemas, tables, and columns
- **Safe Query Execution**: Execute SQL queries in a READ ONLY mode (a safe READ WRITE support is planned to be implemnted in the future versions)
- **Multi-Cluster Support**: Work with multiple clusters and workgroups simultaneously
## Prerequisites
### Installation Requirements
1. Install `uv` from [Astral](https://docs.astral.sh/uv/getting-started/installation/) or the [GitHub README](https://github.com/astral-sh/uv#installation)
2. Install Python 3.10 or newer using `uv python install 3.10` (or a more recent version)
### AWS Client Requirements
1. **Credentials**: Configure AWS credentials via AWS CLI, or environment variables
2. **Region**: Configure AWS region using one of the following (in order of precedence):
- `AWS_REGION` environment variable (highest priority)
- `AWS_DEFAULT_REGION` environment variable
- Region specified in your AWS profile configuration
3. **Permissions**: Ensure your AWS credentials have the required permissions (see [Permissions](#permissions) section)
## Installation
| Cursor | VS Code |
|:------:|:-------:|
| [](https://cursor.com/en/install-mcp?name=awslabs.redshift-mcp-server&config=eyJjb21tYW5kIjoidXZ4IGF3c2xhYnMucmVkc2hpZnQtbWNwLXNlcnZlckBsYXRlc3QiLCJlbnYiOnsiQVdTX1BST0ZJTEUiOiJkZWZhdWx0IiwiQVdTX1JFR0lPTiI6InVzLWVhc3QtMSIsIkZBU1RNQ1BfTE9HX0xFVkVMIjoiSU5GTyJ9LCJkaXNhYmxlZCI6ZmFsc2UsImF1dG9BcHByb3ZlIjpbXX0%3D) | [](https://insiders.vscode.dev/redirect/mcp/install?name=Redshift%20MCP%20Server&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22awslabs.redshift-mcp-server%40latest%22%5D%2C%22env%22%3A%7B%22AWS_PROFILE%22%3A%22default%22%2C%22AWS_REGION%22%3A%22us-east-1%22%2C%22FASTMCP_LOG_LEVEL%22%3A%22INFO%22%7D%2C%22disabled%22%3Afalse%2C%22autoApprove%22%3A%5B%5D%7D) |
Configure the MCP server in your MCP client configuration (e.g., for Amazon Q Developer CLI, edit `~/.aws/amazonq/mcp.json`):
```json
{
"mcpServers": {
"awslabs.redshift-mcp-server": {
"command": "uvx",
"args": ["awslabs.redshift-mcp-server@latest"],
"env": {
"AWS_PROFILE": "default",
"AWS_DEFAULT_REGION": "us-east-1",
"FASTMCP_LOG_LEVEL": "INFO"
},
"disabled": false,
"autoApprove": []
}
}
}
```
### Windows Installation
For Windows users, the MCP server configuration format is slightly different:
```json
{
"mcpServers": {
"awslabs.redshift-mcp-server": {
"disabled": false,
"timeout": 60,
"type": "stdio",
"command": "uv",
"args": [
"tool",
"run",
"--from",
"awslabs.redshift-mcp-server@latest",
"awslabs.redshift-mcp-server.exe"
],
"env": {
"AWS_PROFILE": "your-aws-profile",
"AWS_DEFAULT_REGION": "us-east-1",
"FASTMCP_LOG_LEVEL": "ERROR"
}
}
}
}
```
or docker after a successful `docker build -t awslabs/redshift-mcp-server:latest .`:
```json
{
"mcpServers": {
"awslabs.redshift-mcp-server": {
"command": "docker",
"args": [
"run",
"--rm",
"--interactive",
"--env", "AWS_ACCESS_KEY_ID=[your data]",
"--env", "AWS_SECRET_ACCESS_KEY=[your data]",
"--env", "AWS_DEFAULT_REGION=[your data]",
"awslabs/redshift-mcp-server:latest"
]
}
}
}
```
### Environment Variables
- `AWS_REGION`: AWS region to use (overrides all other region settings)
- `AWS_DEFAULT_REGION`: Default AWS region (used if AWS_REGION not set and no region in profile)
- `AWS_PROFILE`: AWS profile to use (optional, uses default if not specified)
- `FASTMCP_LOG_LEVEL`: Logging level (`DEBUG`, `INFO`, `WARNING`, `ERROR`)
- `LOG_FILE`: Path to log file (optional, logs to stdout if not specified)
## Basic Usage
### Discovery Workflow
1. **Discover Clusters**: Find available Redshift resources
2. **List Databases**: Explore databases in a specific cluster
3. **Browse Database Structures**: Navigate through schemas, tables, columns
4. **Query Data**: Execute SQL queries safely with a natural language prompt
### Simple Examples
- "Show me all available Redshift clusters"
- "List databases in cluster 'my-redshift-cluster'"
- "What tables are in the 'public' schema of database 'analytics'?"
- "Execute: SELECT COUNT(*) FROM users WHERE created_date > '2024-01-01'"
### Advanced Examples
#### Natural Language Data Request
```log
> Show me the last 3 sales from the analytics Redshift cluster.
I'll help you retrieve the last 3 sales from your analytics Redshift cluster. Let me start by discovering your available Redshift clusters and then
explore the database structure to find the sales data.
...skipping the auto-discovery logs...
Here are the last 3 sales from your analytics Redshift cluster:
Most Recent Sales (from tickit.sales table):
1. Sale ID 102373 - December 31, 2008 at 12:58:19
• Price paid: $1,008.00
• Seller ID: 26190, Buyer ID: 35491
2. Sale ID 75861 - December 31, 2008 at 12:50:02
• Price paid: $372.00
• Seller ID: 43402, Buyer ID: 39545
3. Sale ID 56302 - December 31, 2008 at 12:08:14
• Price paid: $372.00
• Seller ID: 5760, Buyer ID: 5797
The data shows ticket sales from the TICKIT sample dataset, which appears to be for event ticket transactions. All three sales occurred on December 31, 2008, with the most recent sale being for $1,008 for 4 tickets.
> Briefly describe your actions.
I performed the following actions to retrieve the last 3 sales from your analytics Redshift cluster:
1. Discovered clusters - Listed all available Redshift clusters and identified redshift-cluster-analytics as your analytics cluster
2. Explored databases - Found two databases: dev and sample_data_dev
3. Located schemas - Checked the sample_data_dev database and found the tickit schema containing sample data
4. Found sales table - Identified the sales table within the tickit schema
5. Analyzed table structure - Examined the columns in the sales table (salesid, pricepaid, qtysold, saletime, etc.)
6. Executed query - Ran a SQL query to get the 3 most recent sales ordered by saletime DESC
The process involved using the Redshift MCP tools to systematically navigate the cluster structure and retrieve the requested sales data from the TICKIT sample dataset.
> Show me the query text which you executed to get the sales.
Here's the exact SQL query I executed to get the last 3 sales:
sql
SELECT salesid, listid, sellerid, buyerid, eventid, qtysold, pricepaid, commission, saletime
FROM tickit.sales
ORDER BY saletime DESC
LIMIT 3;
```
#### Cross-Cluster Data Comparison Request
```log
> How off is the analytics sales data from the ETL sales data based on the recent records in Redshift?
I'll help you analyze sales data from your Redshift ETL pipeline. To get started, I need to discover your Redshift environment and understand the data
structure.
...skipping auto-discovery logs...
# Sales Data Comparison: Analytics vs ETL
## Executive Summary
Sales data between Analytics cluster and ETL workgroup is perfectly synchronized with zero discrepancies found.
## Environment Overview
• **Analytics**: redshift-cluster-analytics (Provisioned, 2x dc2.large nodes)
• **ETL**: redshift-workgroup-etl (Serverless)
• **Database**: sample_data_dev.tickit.sales
## Data Comparison Results
### High-Level Metrics
| Metric | Analytics Cluster | ETL Workgroup | Status |
|-----------------|-------------------|-------------------|--------|
| Total Records | 172,456 | 172,456 | Match |
| Total Revenue | $110,765,431 | $110,765,431 | Match |
| Total Quantity | 345,349 | 345,349 | Match |
| Average Price | $642.28 | $642.28 | Match |
| Date Range | 2008-01-01 to 2008-12-31 | 2008-01-01 to 2008-12-31 | Match |
### Recent Sales (Q4 2008)
| Month | Analytics Revenue | ETL Revenue | Analytics Txns | ETL Txns | Status |
|----------|-------------------|---------------|----------------|----------|--------|
| Dec 2008 | $4,521,806 | $4,521,806 | 7,059 | 7,059 | Match |
| Nov 2008 | $9,044,905 | $9,044,905 | 14,261 | 14,261 | Match |
| Oct 2008 | $10,726,368 | $10,726,368 | 16,741 | 16,741 | Match |
## Key Findings
• Data Integrity: Perfect synchronization across all metrics
• Verification: Transaction-level details match exactly (verified 10 recent records)
> Briefly describe your actions.
I analyzed sales data from your Redshift environments by:
1. Discovered Infrastructure: Found 3 Redshift environments (analytics cluster, marketing cluster, ETL workgroup)
2. Explored Data Structure: Located sales data in sample_data_dev.tickit.sales table with 10 columns including salesid, pricepaid, qtysold, and saletime
3. Compared High-Level Metrics: Ran aggregate queries on both analytics cluster and ETL workgroup to compare total records (172,456), revenue ($110M), and date ranges
4. Analyzed Recent Data: Examined Q4 2008 monthly sales trends and verified the 10 most recent transactions from Dec 30-31, 2008
5. Performance Testing: Measured query execution times across different query types (6.7-19.5 seconds range)
6. Generated Report: Created a comprehensive comparison showing perfect data synchronization between environments with performance insights and recommendations
> Show me the text of the SQL queries you used.
Here are the SQL queries I executed during the analysis:
## 1. High-Level Metrics Query
sql
SELECT
COUNT(*) as total_records,
MIN(saletime) as earliest_sale,
MAX(saletime) as latest_sale,
SUM(pricepaid) as total_revenue,
SUM(qtysold) as total_quantity,
AVG(pricepaid) as avg_price
FROM tickit.sales;
## 2. Recent Monthly Sales Analysis
sql
SELECT
DATE_TRUNC('month', saletime) as sale_month,
COUNT(*) as transaction_count,
SUM(pricepaid) as monthly_revenue,
SUM(qtysold) as monthly_quantity,
AVG(pricepaid) as avg_transaction_value
FROM tickit.sales
WHERE saletime >= '2008-10-01'
GROUP BY DATE_TRUNC('month', saletime)
ORDER BY sale_month DESC
LIMIT 10;
## 3. Recent Transaction Details
sql
SELECT
salesid,
listid,
sellerid,
buyerid,
eventid,
qtysold,
pricepaid,
commission,
saletime
FROM tickit.sales
WHERE saletime >= '2008-12-30'
ORDER BY saletime DESC, salesid DESC
LIMIT 10;
```
## Tools
### list_clusters
Discovers all available Amazon Redshift clusters and serverless workgroups.
```python
list_clusters() -> list[RedshiftCluster]
```
**Returns**: List of cluster information including:
- Cluster identifier and type (provisioned/serverless)
- Status and connection details
- Configuration information (node type, encryption, etc.)
- Tags and metadata
### list_databases
Lists all databases in a specified Redshift cluster.
```python
list_databases(cluster_identifier: str, database_name: str = "dev") -> list[RedshiftDatabase]
```
**Parameters**:
- `cluster_identifier`: The cluster identifier from `list_clusters`
- `database_name`: Database to connect to for querying (default: "dev")
**Returns**: List of database information including:
- Database name and owner
- Database type (local/shared)
- Access control information
- Isolation level
### list_schemas
Lists all schemas in a specified database.
```python
list_schemas(cluster_identifier: str, schema_database_name: str) -> list[RedshiftSchema]
```
**Parameters**:
- `cluster_identifier`: The cluster identifier from `list_clusters`
- `schema_database_name`: Database name to list schemas for
**Returns**: List of schema information including:
- Schema name and owner
- Schema type (local/external/shared)
- Access permissions
- External schema details (if applicable)
### list_tables
Lists all tables in a specified schema.
```python
list_tables(cluster_identifier: str, table_database_name: str, table_schema_name: str) -> list[RedshiftTable]
```
**Parameters**:
- `cluster_identifier`: The cluster identifier from `list_clusters`
- `table_database_name`: Database name containing the schema
- `table_schema_name`: Schema name to list tables for
**Returns**: List of table information including:
- Table name and type (TABLE/VIEW/EXTERNAL TABLE)
- Access permissions
- Remarks and metadata
### list_columns
Lists all columns in a specified table.
```python
list_columns(
cluster_identifier: str,
column_database_name: str,
column_schema_name: str,
column_table_name: str
) -> list[RedshiftColumn]
```
**Parameters**:
- `cluster_identifier`: The cluster identifier from `list_clusters`
- `column_database_name`: Database name containing the table
- `column_schema_name`: Schema name containing the table
- `column_table_name`: Table name to list columns for
**Returns**: List of column information including:
- Column name and data type
- Nullable status and default values
- Numeric precision and scale
- Character length limits
- Ordinal position and remarks
### execute_query
Executes a SQL query against a Redshift cluster with safety protections.
```python
execute_query(cluster_identifier: str, database_name: str, sql: str) -> QueryResult
```
**Parameters**:
- `cluster_identifier`: The cluster identifier from `list_clusters`
- `database_name`: Database to execute the query against
- `sql`: SQL statement to execute (SELECT statements recommended)
**Returns**: Query result including:
- Column names and data types
- Result rows with proper type conversion
- Row count and execution time
- Query ID for reference
## Permissions
### AWS IAM Permissions
Your AWS credentials need the following IAM permissions:
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"redshift:DescribeClusters",
"redshift-serverless:ListWorkgroups",
"redshift-serverless:GetWorkgroup",
"redshift-data:ExecuteStatement",
"redshift-data:BatchExecuteStatement",
"redshift-data:DescribeStatement",
"redshift-data:GetStatementResult"
],
"Resource": "*"
}
]
}
```
### Database Permissions
In addition to AWS IAM permissions, you need appropriate database-level permissions:
- **Read Access**: `SELECT` permissions on tables/views you want to query
- **Schema Access**: `USAGE` permissions on schemas you want to explore
- **Database Access**: Connection permissions to databases you want to access
Raw data
{
"_id": null,
"home_page": null,
"name": "awslabs.redshift-mcp-server",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": null,
"author": "Amazon Web Services",
"author_email": "AWSLabs MCP <203918161+awslabs-mcp@users.noreply.github.com>, Sergey Konoplev <sergkono@amazon.com>",
"download_url": "https://files.pythonhosted.org/packages/eb/1c/e77ddaef4ab012110c70a2a916fda30adb362952d69adba5d16a776231c4/awslabs_redshift_mcp_server-0.0.7.tar.gz",
"platform": null,
"description": "# Amazon Redshift MCP Server\n\nModel Context Protocol (MCP) server for Amazon Redshift.\n\nThis MCP server provides tools to discover, explore, and query Amazon Redshift clusters and serverless workgroups. It enables AI assistants to interact with Redshift resources safely and efficiently through a comprehensive set of discovery and query execution tools.\n\n## Features\n\n- **Cluster Discovery**: Automatically discover both provisioned Redshift clusters and serverless workgroups\n- **Metadata Exploration**: Browse databases, schemas, tables, and columns\n- **Safe Query Execution**: Execute SQL queries in a READ ONLY mode (a safe READ WRITE support is planned to be implemnted in the future versions)\n- **Multi-Cluster Support**: Work with multiple clusters and workgroups simultaneously\n\n## Prerequisites\n\n### Installation Requirements\n\n1. Install `uv` from [Astral](https://docs.astral.sh/uv/getting-started/installation/) or the [GitHub README](https://github.com/astral-sh/uv#installation)\n2. Install Python 3.10 or newer using `uv python install 3.10` (or a more recent version)\n\n### AWS Client Requirements\n\n1. **Credentials**: Configure AWS credentials via AWS CLI, or environment variables\n2. **Region**: Configure AWS region using one of the following (in order of precedence):\n - `AWS_REGION` environment variable (highest priority)\n - `AWS_DEFAULT_REGION` environment variable\n - Region specified in your AWS profile configuration\n3. **Permissions**: Ensure your AWS credentials have the required permissions (see [Permissions](#permissions) section)\n\n## Installation\n\n| Cursor | VS Code |\n|:------:|:-------:|\n| [](https://cursor.com/en/install-mcp?name=awslabs.redshift-mcp-server&config=eyJjb21tYW5kIjoidXZ4IGF3c2xhYnMucmVkc2hpZnQtbWNwLXNlcnZlckBsYXRlc3QiLCJlbnYiOnsiQVdTX1BST0ZJTEUiOiJkZWZhdWx0IiwiQVdTX1JFR0lPTiI6InVzLWVhc3QtMSIsIkZBU1RNQ1BfTE9HX0xFVkVMIjoiSU5GTyJ9LCJkaXNhYmxlZCI6ZmFsc2UsImF1dG9BcHByb3ZlIjpbXX0%3D) | [](https://insiders.vscode.dev/redirect/mcp/install?name=Redshift%20MCP%20Server&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22awslabs.redshift-mcp-server%40latest%22%5D%2C%22env%22%3A%7B%22AWS_PROFILE%22%3A%22default%22%2C%22AWS_REGION%22%3A%22us-east-1%22%2C%22FASTMCP_LOG_LEVEL%22%3A%22INFO%22%7D%2C%22disabled%22%3Afalse%2C%22autoApprove%22%3A%5B%5D%7D) |\n\nConfigure the MCP server in your MCP client configuration (e.g., for Amazon Q Developer CLI, edit `~/.aws/amazonq/mcp.json`):\n\n```json\n{\n \"mcpServers\": {\n \"awslabs.redshift-mcp-server\": {\n \"command\": \"uvx\",\n \"args\": [\"awslabs.redshift-mcp-server@latest\"],\n \"env\": {\n \"AWS_PROFILE\": \"default\",\n \"AWS_DEFAULT_REGION\": \"us-east-1\",\n \"FASTMCP_LOG_LEVEL\": \"INFO\"\n },\n \"disabled\": false,\n \"autoApprove\": []\n }\n }\n}\n```\n\n### Windows Installation\n\nFor Windows users, the MCP server configuration format is slightly different:\n\n```json\n{\n \"mcpServers\": {\n \"awslabs.redshift-mcp-server\": {\n \"disabled\": false,\n \"timeout\": 60,\n \"type\": \"stdio\",\n \"command\": \"uv\",\n \"args\": [\n \"tool\",\n \"run\",\n \"--from\",\n \"awslabs.redshift-mcp-server@latest\",\n \"awslabs.redshift-mcp-server.exe\"\n ],\n \"env\": {\n \"AWS_PROFILE\": \"your-aws-profile\",\n \"AWS_DEFAULT_REGION\": \"us-east-1\",\n \"FASTMCP_LOG_LEVEL\": \"ERROR\"\n }\n }\n }\n}\n```\n\nor docker after a successful `docker build -t awslabs/redshift-mcp-server:latest .`:\n\n```json\n{\n \"mcpServers\": {\n \"awslabs.redshift-mcp-server\": {\n \"command\": \"docker\",\n \"args\": [\n \"run\",\n \"--rm\",\n \"--interactive\",\n \"--env\", \"AWS_ACCESS_KEY_ID=[your data]\",\n \"--env\", \"AWS_SECRET_ACCESS_KEY=[your data]\",\n \"--env\", \"AWS_DEFAULT_REGION=[your data]\",\n \"awslabs/redshift-mcp-server:latest\"\n ]\n }\n }\n}\n```\n\n### Environment Variables\n\n- `AWS_REGION`: AWS region to use (overrides all other region settings)\n- `AWS_DEFAULT_REGION`: Default AWS region (used if AWS_REGION not set and no region in profile)\n- `AWS_PROFILE`: AWS profile to use (optional, uses default if not specified)\n- `FASTMCP_LOG_LEVEL`: Logging level (`DEBUG`, `INFO`, `WARNING`, `ERROR`)\n- `LOG_FILE`: Path to log file (optional, logs to stdout if not specified)\n\n## Basic Usage\n\n### Discovery Workflow\n\n1. **Discover Clusters**: Find available Redshift resources\n2. **List Databases**: Explore databases in a specific cluster\n3. **Browse Database Structures**: Navigate through schemas, tables, columns\n4. **Query Data**: Execute SQL queries safely with a natural language prompt\n\n### Simple Examples\n\n- \"Show me all available Redshift clusters\"\n- \"List databases in cluster 'my-redshift-cluster'\"\n- \"What tables are in the 'public' schema of database 'analytics'?\"\n- \"Execute: SELECT COUNT(*) FROM users WHERE created_date > '2024-01-01'\"\n\n### Advanced Examples\n\n#### Natural Language Data Request\n\n```log\n> Show me the last 3 sales from the analytics Redshift cluster.\nI'll help you retrieve the last 3 sales from your analytics Redshift cluster. Let me start by discovering your available Redshift clusters and then\nexplore the database structure to find the sales data.\n\n...skipping the auto-discovery logs...\n\nHere are the last 3 sales from your analytics Redshift cluster:\n\nMost Recent Sales (from tickit.sales table):\n\n1. Sale ID 102373 - December 31, 2008 at 12:58:19\n \u2022 Price paid: $1,008.00\n \u2022 Seller ID: 26190, Buyer ID: 35491\n\n2. Sale ID 75861 - December 31, 2008 at 12:50:02\n \u2022 Price paid: $372.00\n \u2022 Seller ID: 43402, Buyer ID: 39545\n\n3. Sale ID 56302 - December 31, 2008 at 12:08:14\n \u2022 Price paid: $372.00\n \u2022 Seller ID: 5760, Buyer ID: 5797\n\nThe data shows ticket sales from the TICKIT sample dataset, which appears to be for event ticket transactions. All three sales occurred on December 31, 2008, with the most recent sale being for $1,008 for 4 tickets.\n\n> Briefly describe your actions.\nI performed the following actions to retrieve the last 3 sales from your analytics Redshift cluster:\n\n1. Discovered clusters - Listed all available Redshift clusters and identified redshift-cluster-analytics as your analytics cluster\n2. Explored databases - Found two databases: dev and sample_data_dev\n3. Located schemas - Checked the sample_data_dev database and found the tickit schema containing sample data\n4. Found sales table - Identified the sales table within the tickit schema\n5. Analyzed table structure - Examined the columns in the sales table (salesid, pricepaid, qtysold, saletime, etc.)\n6. Executed query - Ran a SQL query to get the 3 most recent sales ordered by saletime DESC\n\nThe process involved using the Redshift MCP tools to systematically navigate the cluster structure and retrieve the requested sales data from the TICKIT sample dataset.\n\n> Show me the query text which you executed to get the sales.\nHere's the exact SQL query I executed to get the last 3 sales:\n\nsql\nSELECT salesid, listid, sellerid, buyerid, eventid, qtysold, pricepaid, commission, saletime\nFROM tickit.sales\nORDER BY saletime DESC\nLIMIT 3;\n```\n\n#### Cross-Cluster Data Comparison Request\n\n```log\n> How off is the analytics sales data from the ETL sales data based on the recent records in Redshift?\nI'll help you analyze sales data from your Redshift ETL pipeline. To get started, I need to discover your Redshift environment and understand the data\nstructure.\n\n...skipping auto-discovery logs...\n\n# Sales Data Comparison: Analytics vs ETL\n\n## Executive Summary\nSales data between Analytics cluster and ETL workgroup is perfectly synchronized with zero discrepancies found.\n\n## Environment Overview\n\u2022 **Analytics**: redshift-cluster-analytics (Provisioned, 2x dc2.large nodes)\n\u2022 **ETL**: redshift-workgroup-etl (Serverless)\n\u2022 **Database**: sample_data_dev.tickit.sales\n\n## Data Comparison Results\n\n### High-Level Metrics\n| Metric | Analytics Cluster | ETL Workgroup | Status |\n|-----------------|-------------------|-------------------|--------|\n| Total Records | 172,456 | 172,456 | Match |\n| Total Revenue | $110,765,431 | $110,765,431 | Match |\n| Total Quantity | 345,349 | 345,349 | Match |\n| Average Price | $642.28 | $642.28 | Match |\n| Date Range | 2008-01-01 to 2008-12-31 | 2008-01-01 to 2008-12-31 | Match |\n\n### Recent Sales (Q4 2008)\n| Month | Analytics Revenue | ETL Revenue | Analytics Txns | ETL Txns | Status |\n|----------|-------------------|---------------|----------------|----------|--------|\n| Dec 2008 | $4,521,806 | $4,521,806 | 7,059 | 7,059 | Match |\n| Nov 2008 | $9,044,905 | $9,044,905 | 14,261 | 14,261 | Match |\n| Oct 2008 | $10,726,368 | $10,726,368 | 16,741 | 16,741 | Match |\n\n## Key Findings\n\u2022 Data Integrity: Perfect synchronization across all metrics\n\u2022 Verification: Transaction-level details match exactly (verified 10 recent records)\n\n> Briefly describe your actions.\nI analyzed sales data from your Redshift environments by:\n\n1. Discovered Infrastructure: Found 3 Redshift environments (analytics cluster, marketing cluster, ETL workgroup)\n2. Explored Data Structure: Located sales data in sample_data_dev.tickit.sales table with 10 columns including salesid, pricepaid, qtysold, and saletime\n3. Compared High-Level Metrics: Ran aggregate queries on both analytics cluster and ETL workgroup to compare total records (172,456), revenue ($110M), and date ranges\n4. Analyzed Recent Data: Examined Q4 2008 monthly sales trends and verified the 10 most recent transactions from Dec 30-31, 2008\n5. Performance Testing: Measured query execution times across different query types (6.7-19.5 seconds range)\n6. Generated Report: Created a comprehensive comparison showing perfect data synchronization between environments with performance insights and recommendations\n\n> Show me the text of the SQL queries you used.\nHere are the SQL queries I executed during the analysis:\n\n## 1. High-Level Metrics Query\nsql\nSELECT\n COUNT(*) as total_records,\n MIN(saletime) as earliest_sale,\n MAX(saletime) as latest_sale,\n SUM(pricepaid) as total_revenue,\n SUM(qtysold) as total_quantity,\n AVG(pricepaid) as avg_price\nFROM tickit.sales;\n\n## 2. Recent Monthly Sales Analysis\nsql\nSELECT\n DATE_TRUNC('month', saletime) as sale_month,\n COUNT(*) as transaction_count,\n SUM(pricepaid) as monthly_revenue,\n SUM(qtysold) as monthly_quantity,\n AVG(pricepaid) as avg_transaction_value\nFROM tickit.sales\nWHERE saletime >= '2008-10-01'\nGROUP BY DATE_TRUNC('month', saletime)\nORDER BY sale_month DESC\nLIMIT 10;\n\n## 3. Recent Transaction Details\nsql\nSELECT\n salesid,\n listid,\n sellerid,\n buyerid,\n eventid,\n qtysold,\n pricepaid,\n commission,\n saletime\nFROM tickit.sales\nWHERE saletime >= '2008-12-30'\nORDER BY saletime DESC, salesid DESC\nLIMIT 10;\n```\n\n## Tools\n\n### list_clusters\n\nDiscovers all available Amazon Redshift clusters and serverless workgroups.\n\n```python\nlist_clusters() -> list[RedshiftCluster]\n```\n\n**Returns**: List of cluster information including:\n\n- Cluster identifier and type (provisioned/serverless)\n- Status and connection details\n- Configuration information (node type, encryption, etc.)\n- Tags and metadata\n\n### list_databases\n\nLists all databases in a specified Redshift cluster.\n\n```python\nlist_databases(cluster_identifier: str, database_name: str = \"dev\") -> list[RedshiftDatabase]\n```\n\n**Parameters**:\n\n- `cluster_identifier`: The cluster identifier from `list_clusters`\n- `database_name`: Database to connect to for querying (default: \"dev\")\n\n**Returns**: List of database information including:\n\n- Database name and owner\n- Database type (local/shared)\n- Access control information\n- Isolation level\n\n### list_schemas\n\nLists all schemas in a specified database.\n\n```python\nlist_schemas(cluster_identifier: str, schema_database_name: str) -> list[RedshiftSchema]\n```\n\n**Parameters**:\n\n- `cluster_identifier`: The cluster identifier from `list_clusters`\n- `schema_database_name`: Database name to list schemas for\n\n**Returns**: List of schema information including:\n\n- Schema name and owner\n- Schema type (local/external/shared)\n- Access permissions\n- External schema details (if applicable)\n\n### list_tables\n\nLists all tables in a specified schema.\n\n```python\nlist_tables(cluster_identifier: str, table_database_name: str, table_schema_name: str) -> list[RedshiftTable]\n```\n\n**Parameters**:\n\n- `cluster_identifier`: The cluster identifier from `list_clusters`\n- `table_database_name`: Database name containing the schema\n- `table_schema_name`: Schema name to list tables for\n\n**Returns**: List of table information including:\n\n- Table name and type (TABLE/VIEW/EXTERNAL TABLE)\n- Access permissions\n- Remarks and metadata\n\n### list_columns\n\nLists all columns in a specified table.\n\n```python\nlist_columns(\n cluster_identifier: str,\n column_database_name: str,\n column_schema_name: str,\n column_table_name: str\n) -> list[RedshiftColumn]\n```\n\n**Parameters**:\n\n- `cluster_identifier`: The cluster identifier from `list_clusters`\n- `column_database_name`: Database name containing the table\n- `column_schema_name`: Schema name containing the table\n- `column_table_name`: Table name to list columns for\n\n**Returns**: List of column information including:\n\n- Column name and data type\n- Nullable status and default values\n- Numeric precision and scale\n- Character length limits\n- Ordinal position and remarks\n\n### execute_query\n\nExecutes a SQL query against a Redshift cluster with safety protections.\n\n```python\nexecute_query(cluster_identifier: str, database_name: str, sql: str) -> QueryResult\n```\n\n**Parameters**:\n\n- `cluster_identifier`: The cluster identifier from `list_clusters`\n- `database_name`: Database to execute the query against\n- `sql`: SQL statement to execute (SELECT statements recommended)\n\n**Returns**: Query result including:\n\n- Column names and data types\n- Result rows with proper type conversion\n- Row count and execution time\n- Query ID for reference\n\n## Permissions\n\n### AWS IAM Permissions\n\nYour AWS credentials need the following IAM permissions:\n\n```json\n{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Effect\": \"Allow\",\n \"Action\": [\n \"redshift:DescribeClusters\",\n \"redshift-serverless:ListWorkgroups\",\n \"redshift-serverless:GetWorkgroup\",\n \"redshift-data:ExecuteStatement\",\n \"redshift-data:BatchExecuteStatement\",\n \"redshift-data:DescribeStatement\",\n \"redshift-data:GetStatementResult\"\n ],\n \"Resource\": \"*\"\n }\n ]\n}\n```\n\n### Database Permissions\n\nIn addition to AWS IAM permissions, you need appropriate database-level permissions:\n\n- **Read Access**: `SELECT` permissions on tables/views you want to query\n- **Schema Access**: `USAGE` permissions on schemas you want to explore\n- **Database Access**: Connection permissions to databases you want to access\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "An AWS Labs Model Context Protocol (MCP) server for Redshift",
"version": "0.0.7",
"project_urls": {
"changelog": "https://github.com/awslabs/mcp/blob/main/src/redshift-mcp-server/CHANGELOG.md",
"docs": "https://awslabs.github.io/mcp/servers/redshift-mcp-server/",
"documentation": "https://awslabs.github.io/mcp/servers/redshift-mcp-server/",
"homepage": "https://awslabs.github.io/mcp/",
"repository": "https://github.com/awslabs/mcp.git"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "d8b51a9bef5284d9c555be1fa4cebde32a58a5a56e04f1303b6e46a166fb3a8f",
"md5": "6406372d0c2afcca27857f61d68d45a0",
"sha256": "ce2718dc8a17b4dd7f7062465e15e056116d264baf65ea7f99286f1b4ea13549"
},
"downloads": -1,
"filename": "awslabs_redshift_mcp_server-0.0.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6406372d0c2afcca27857f61d68d45a0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 27218,
"upload_time": "2025-08-27T21:17:22",
"upload_time_iso_8601": "2025-08-27T21:17:22.913027Z",
"url": "https://files.pythonhosted.org/packages/d8/b5/1a9bef5284d9c555be1fa4cebde32a58a5a56e04f1303b6e46a166fb3a8f/awslabs_redshift_mcp_server-0.0.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "eb1ce77ddaef4ab012110c70a2a916fda30adb362952d69adba5d16a776231c4",
"md5": "ec22122bfa37a490716271cb7f553048",
"sha256": "3ea2a56428afa51c42ce0fbb838a08e60e8218a697196c0b08475b63fc7592c3"
},
"downloads": -1,
"filename": "awslabs_redshift_mcp_server-0.0.7.tar.gz",
"has_sig": false,
"md5_digest": "ec22122bfa37a490716271cb7f553048",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 101305,
"upload_time": "2025-08-27T21:17:25",
"upload_time_iso_8601": "2025-08-27T21:17:25.214885Z",
"url": "https://files.pythonhosted.org/packages/eb/1c/e77ddaef4ab012110c70a2a916fda30adb362952d69adba5d16a776231c4/awslabs_redshift_mcp_server-0.0.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-27 21:17:25",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "awslabs",
"github_project": "mcp",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "awslabs.redshift-mcp-server"
}