Redshift MCP Server
Enables AI assistants to interact with Amazon Redshift databases, providing capabilities to list schemas and tables, retrieve table DDL scripts, get table statistics, execute SQL queries, analyze tables, and get execution plans.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Redshift MCP Servershow me the top 10 customers by total sales"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Redshift MCP Server
A Model Context Protocol (MCP) server for Amazon Redshift that enables AI assistants to interact with Redshift databases.
Introduction
Redshift MCP Server is a Python-based implementation of the Model Context Protocol that provides tools and resources for interacting with Amazon Redshift databases. It allows AI assistants to:
List schemas and tables in a Redshift database
Retrieve table DDL (Data Definition Language) scripts
Get table statistics
Execute SQL queries
Analyze tables to collect statistics information
Get execution plans for SQL queries
Related MCP server: redshift-utils-mcp
Installation
Prerequisites
Python 3.13 or higher
Amazon Redshift cluster
Redshift credentials (host, port, username, password, database)
Install from source
# Clone the repository
git clone https://github.com/Moonlight-CL/redshift-mcp-server.git
cd redshift-mcp-server
# Install dependencies
uv syncConfiguration
The server requires the following environment variables to connect to your Redshift cluster:
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"You can set these environment variables directly or use a .env file.
Usage
Starting the server
# Start the server
uv run --with mcp python-dotenv redshift-connector mcp
mcp run src/redshift_mcp_server/server.pyIntegrating with AI assistants
To use this server with an AI assistant that supports MCP, add the following configuration to your MCP settings:
{
"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"
}
}
}
}Features
Resources
The server provides the following resources:
rs:///schemas- Lists all schemas in the databasers:///{schema}/tables- Lists all tables in a specific schemars:///{schema}/{table}/ddl- Gets the DDL script for a specific tablers:///{schema}/{table}/statistic- Gets statistics for a specific table
Tools
The server provides the following tools:
execute_sql- Executes a SQL query on the Redshift clusteranalyze_table- Analyzes a table to collect statistics informationget_execution_plan- Gets the execution plan with runtime statistics for a SQL query
Examples
Listing schemas
access_mcp_resource("redshift-mcp-server", "rs:///schemas")Listing tables in a schema
access_mcp_resource("redshift-mcp-server", "rs:///public/tables")Getting table DDL
access_mcp_resource("redshift-mcp-server", "rs:///public/users/ddl")Executing SQL
use_mcp_tool("redshift-mcp-server", "execute_sql", {"sql": "SELECT * FROM public.users LIMIT 10"})Analyzing a table
use_mcp_tool("redshift-mcp-server", "analyze_table", {"schema": "public", "table": "users"})Getting execution plan
use_mcp_tool("redshift-mcp-server", "get_execution_plan", {"sql": "SELECT * FROM public.users WHERE user_id = 123"})Development
Project structure
redshift-mcp-server/
├── src/
│ └── redshift_mcp_server/
│ ├── __init__.py
│ └── server.py
├── pyproject.toml
└── README.mdDependencies
mcp[cli]>=1.5.0- Model Context Protocol SDKpython-dotenv>=1.1.0- For loading environment variables from .env filesredshift-connector>=2.1.5- Python connector for Amazon Redshift
Available Tools
3 toolsanalyze_tableC
Analyze table to collect statistics information
| Name | Required | Description | Default |
|---|---|---|---|
| schema | Yes | Schema name | |
| table | Yes | Table name |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. The description mentions 'collect statistics information' but doesn't specify what statistics are collected (e.g., row count, column distributions, indexes), whether this is a read-only operation, performance implications, or output format. For a tool with no annotation coverage, this leaves critical behavioral traits undocumented, though it doesn't contradict any annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence: 'Analyze table to collect statistics information'. It's front-loaded with the core action and outcome, with no wasted words. While it could be more detailed for better tool selection, it's appropriately concise for its length, earning a high score for structure and brevity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (analysis operation with 2 parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what 'statistics information' entails, how results are returned, or behavioral aspects like performance. With no structured fields to compensate, the description should provide more context to ensure the agent can use the tool effectively, but it falls short.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, with clear documentation for 'schema' and 'table' parameters. The description doesn't add any parameter-specific semantics beyond what the schema provides, such as examples or constraints. However, with high schema coverage, the baseline score is 3, as the schema adequately documents parameters without needing extra description details.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states the tool's purpose as 'Analyze table to collect statistics information', which provides a clear verb ('analyze') and resource ('table') with a general outcome ('collect statistics information'). However, it doesn't differentiate from sibling tools like 'execute_sql' or 'get_execution_plan', leaving ambiguity about when to use this specific analysis tool versus executing SQL queries directly. The purpose is understandable but lacks specificity for tool selection.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'execute_sql' or 'get_execution_plan', nor does it specify contexts where table analysis is preferred over direct SQL execution or plan retrieval. Without any usage context or exclusions, the agent must infer when this tool is appropriate, which could lead to incorrect tool selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
execute_sqlC
Execute a SQL Query on the Redshift cluster
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The SQL to Execute |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal information. It doesn't address critical aspects such as whether the query is read-only or mutating data, authentication needs, rate limits, error handling, or the format of results. The description merely states what the tool does without revealing operational traits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly conveys the tool's function without unnecessary words. It is front-loaded with the core action and resource, making it easy to understand at a glance. Every part of the sentence earns its place by defining the tool's purpose clearly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool that executes SQL queries with no annotations and no output schema, the description is insufficient. It lacks details on behavioral aspects like data mutation risks, result formats, error conditions, and usage constraints. Given the complexity of SQL execution and the absence of structured data to compensate, the description does not provide enough context for safe and effective use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, with the 'sql' parameter documented as 'The SQL to Execute'. The description adds no additional meaning beyond this, such as SQL dialect specifics, query length limits, or supported operations. Given the high schema coverage, a baseline score of 3 is appropriate as the schema handles parameter documentation adequately.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Execute a SQL Query') and target resource ('on the Redshift cluster'), making the purpose unambiguous. It distinguishes from siblings like 'analyze_table' and 'get_execution_plan' by focusing on direct query execution rather than analysis or planning operations.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance is provided on when to use this tool versus alternatives. While the description implies it's for executing SQL queries, it doesn't specify scenarios where 'analyze_table' or 'get_execution_plan' might be more appropriate, nor does it mention prerequisites like database permissions or connection requirements.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_execution_planC
Get actual execution plan with runtime statistics for a SQL query
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The SQL query to analyze |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves an execution plan with runtime statistics, which suggests a read-only, analytical operation, but doesn't clarify permissions, performance impact, data returned format, or any side effects. This is inadequate for a tool that likely interacts with a database system.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that front-loads the core functionality ('Get actual execution plan with runtime statistics') and specifies the target ('for a SQL query'). There is zero waste, making it highly concise and well-structured for quick comprehension.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no annotations and no output schema, the description is incomplete for a tool that analyzes SQL queries. It lacks details on behavioral traits (e.g., read-only nature, performance implications), output format, and differentiation from siblings. This leaves significant gaps for an agent to understand the tool's full context and usage.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with the single parameter 'sql' documented as 'The SQL query to analyze'. The description adds no additional meaning beyond this, such as SQL dialect requirements, query length limits, or syntax specifics. Baseline 3 is appropriate as the schema handles parameter documentation adequately.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with a specific verb ('Get') and resource ('execution plan with runtime statistics'), and specifies the target ('for a SQL query'). It doesn't explicitly differentiate from sibling tools like 'execute_sql' or 'analyze_table', but the focus on 'actual execution plan with runtime statistics' implies analytical rather than execution functionality.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use this tool versus alternatives like 'execute_sql' or 'analyze_table' is provided. The description implies usage for SQL query analysis but doesn't specify contexts, prerequisites, or exclusions, leaving the agent to infer appropriate scenarios.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool has a clearly distinct purpose: analyze_table focuses on table statistics, execute_sql runs queries, and get_execution_plan provides query performance insights. There is no overlap in functionality, making it easy for an agent to select the right tool.
All tool names follow a consistent verb_noun pattern (analyze_table, execute_sql, get_execution_plan) with clear, descriptive verbs. The naming is uniform and predictable throughout the set.
With only 3 tools, the set feels thin for a database server like Redshift, which typically involves more operations such as data manipulation, schema management, or monitoring. While the tools cover core query execution and analysis, the scope seems limited.
There are significant gaps in the tool surface for a Redshift server. Missing are essential operations like creating/dropping tables, inserting/updating data, listing databases or tables, and user/permission management. This incomplete coverage will likely cause agent failures in broader database workflows.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
The BigQuery remote MCP server is a fully managed service that uses the Model Context Protocol to connect AI applications and LLMs to BigQuery data sources. It provides secure, standardized tools for AI agents to list datasets and tables, retrieve schemas, generate and execute SQL queries through natural language, and analyze data—enabling direct access to enterprise analytics data without requiring manual SQL coding.
A Model Context Protocol server for Wix AI tools
Xata MCP server lets AI agents interact with your Xata projects, and Postgres database branches.
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol server that enables AI assistants to securely interact with ClickHouse databases, supporting table exploration and SQL query execution through a controlled interface.18Apache 2.0
- AlicenseAqualityCmaintenance🤖 Enable AI assistants (Claude, Cursor) to monitor, diagnose, and query Amazon Redshift using this MCP server and the AWS Data API.76MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides AI assistants with comprehensive access to SQL databases, enabling schema inspection, query execution, and database operations with enterprise-grade security.467MIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI assistants to interact with Vertica databases through SQL queries, schema inspection, database documentation, and data export capabilities.1
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Moonlight-CL/redshift-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server