Redshift MCP Server

Redshift MCP Server

Enables interacting with Amazon Redshift databases through SQL queries, schema exploration, and execution plan analysis.

Category
访问服务器

README

Redshift MCP Server

A Model Context Protocol (MCP) server for interacting with Amazon Redshift databases.

Features

  • Run SQL queries on Redshift
  • Explain SQL query execution plans
  • List tables and views within a schema
  • List all schemas within the database
  • Test connection to Redshift

Prerequisites

  • Python 3.10+
  • Amazon Redshift database credentials

Installation

Installation Requirements

  1. Install uv from Astral or the GitHub README
  2. Install Python 3.10 or newer using uv python install 3.10 (or a more recent version)

Configure for Amazon Q or Claude

To add this MCP server to your Amazon Q or Claude, add the following to your MCP config file. With Amazon Q, create (if does not yet exist) a file named .amazonq/mcp.json under the same directory that is running q chat. Then add the following config:

{
  "mcpServers": {
    "redshift": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "--with", "<path-to-redshift-mcp-server>", "redshift-mcp-server"
      ],
      "env": {
        "FASTMCP_LOG_LEVEL": "ERROR"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Setup Your Credentials

⚠️ SECURITY WARNING ⚠️

NEVER commit credential files to version control or include them in Docker images!

Set up your Redshift credentials using environment variables:

# Linux/macOS
export REDSHIFT_HOST=<your-redshift-host>
export REDSHIFT_PORT=5439  # Default Redshift port
export REDSHIFT_DATABASE=<your-database-name>
export REDSHIFT_USER=<your-username>
export REDSHIFT_PASSWORD=<your-password>

# Windows (Command Prompt)
set REDSHIFT_HOST=<your-redshift-host>
set REDSHIFT_PORT=5439
set REDSHIFT_DATABASE=<your-database-name>
set REDSHIFT_USER=<your-username>
set REDSHIFT_PASSWORD=<your-password>

# Windows (PowerShell)
$env:REDSHIFT_HOST = "<your-redshift-host>"
$env:REDSHIFT_PORT = "5439"
$env:REDSHIFT_DATABASE = "<your-database-name>"
$env:REDSHIFT_USER = "<your-username>"
$env:REDSHIFT_PASSWORD = "<your-password>"

Development

  1. Clone this repository:

    git clone https://github.com/tuanknguyen/redshift-mcp-server.git
    cd redshift-mcp-server
    
  2. Create and activate a virtual environment:

    # Create the venv
    uv venv
    
    # Activate it
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    
  3. Install the project:

    # Install the project and its dependencies
    uv pip install -e .
    
    # Or for development
    uv pip install -e ".[dev]"
    

Configuration

Set the following environment variables with your Redshift connection details:

export REDSHIFT_HOST=<your-redshift-host>
export REDSHIFT_PORT=5439  # Default Redshift port
export REDSHIFT_DATABASE=<your-database-name>
export REDSHIFT_USER=<your-username>
export REDSHIFT_PASSWORD=<your-password>

Optional environment variables:

export FASTMCP_LOG_LEVEL=INFO  # Set log level (DEBUG, INFO, WARNING, ERROR)

Development Mode

For development and testing with the MCP Inspector:

mcp dev redshift-mcp-server

Available Tools

  • run_query(query: str) - Execute a SQL query against Redshift
  • explain_query(query: str) - Get the execution plan for a SQL query
  • list_tables_in_schema(schema_name: str) - List all tables and views in a specific schema
  • list_schemas() - List all schemas in the database
  • test_redshift_connection() - Test connectivity to the Redshift database

Connection Testing

The MCP server automatically tests the connection when starting up. If the connection test fails, the server will not start and will raise an error.

You can also run a standalone connection test using:

python test_connection.py

Best Practices

  • Use list_schemas and list_tables_in_schema to explore the database structure
  • For large queries, consider using explain_query first to understand execution plans
  • Always include appropriate WHERE clauses to limit result sets
  • Use column names explicitly instead of SELECT * for better performance
  • Consider adding LIMIT clauses to prevent returning too many rows

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选