Skip to main content
Glama
vinodismyname

redshift-utils-mcp

Redshift Utils MCP サーバー

概要

このプロジェクトは、Amazon Redshift データベースと対話するために特別に設計された Model Context Protocol (MCP) サーバーを実装します。

これは、大規模言語モデル(LLM)やAIアシスタント(Claude、Cursor、カスタムアプリケーションなど)とRedshiftデータウェアハウス間のギャップを埋め、安全で標準化されたデータアクセスとインタラクションを実現します。これにより、ユーザーは自然言語またはAI駆動型のプロンプトを使用して、データのクエリ、データベース構造の理解、監視/診断操作を行うことができます。

このサーバーは、LLM 機能を構造化された安全な方法で Amazon Redshift データ環境に直接統合することを検討している開発者、データアナリスト、またはチーム向けです。

Related MCP server: Redshift MCP Server

目次

特徴

  • ✨セキュアな Redshift 接続 (データ API 経由): Boto3 経由で AWS Redshift データ API を使用して Amazon Redshift クラスターに接続し、環境変数を介して安全に管理される認証情報に AWS Secrets Manager を活用します。

  • 🔍**スキーマ検出:**指定されたスキーマ内のスキーマとテーブルを一覧表示するための MCP リソースを公開します。

  • 📊**メタデータと統計:**詳細なテーブル メタデータ、統計 (サイズ、行数、スキュー、統計の古さなど)、およびメンテナンス ステータスを収集するためのツール ( handle_inspect_table ) を提供します。

  • 📝読み取り専用クエリ実行: Redshift データベースに対して任意の SELECT クエリを実行するための安全な MCP ツール ( handle_execute_ad_hoc_query ) を提供し、LLM リクエストに基づいたデータ取得を可能にします。

  • 📈**クエリ パフォーマンス分析:**特定のクエリ ID の実行プラン、メトリック、履歴データを取得して分析するためのツール ( handle_diagnose_query_performance ) が含まれています。

  • 🔍**テーブル検査:**設計、ストレージ、健全性、使用状況など、テーブルの包括的な検査を実行するためのツール ( handle_inspect_table ) を提供します。

  • 🩺**クラスターのヘルスチェック:**さまざまな診断クエリを使用して、クラスターの基本的なヘルス評価または完全なヘルス評価を実行するツール ( handle_check_cluster_health ) を提供します。

  • 🔒**ロック診断:**現在のロック競合とブロックされているセッションを識別して報告するためのツール ( handle_diagnose_locks ) を提供します。

  • 📊ワークロード監視: WLM、上位クエリ、リソース使用量など、時間枠全体でクラスターのワークロード パターンを分析するためのツール ( handle_monitor_workload ) が含まれています。

  • 📝 **DDL 取得:**指定されたテーブルのSHOW TABLE出力 (DDL) を取得するためのツール ( handle_get_table_definition ) を提供します。

  • 🛡️**入力サニタイズ:**該当する場合は、Boto3 Redshift Data API クライアントを介してパラメーター化されたクエリを利用し、SQL インジェクションのリスクを軽減します。

  • 🧩**標準化された MCP インターフェース:**互換性のあるクライアント (Claude Desktop、Cursor IDE、カスタム アプリケーションなど) とのシームレスな統合のために、モデル コンテキスト プロトコル仕様に準拠しています。

前提条件

ソフトウェア:

  • Python 3.8以上

  • uv (推奨パッケージマネージャー)

  • Git(リポジトリのクローン作成用)

インフラストラクチャとアクセス:

  • Amazon Redshift クラスターへのアクセス。

  • Redshift Data API ( redshift-data:* ) を使用し、指定された Secrets Manager シークレット ( secretsmanager:GetSecretValue ) にアクセスする権限を持つ AWS アカウント。

  • AWS Secrets Manager に認証情報が保存されている Redshift ユーザーアカウント。このユーザーには、このサーバーで有効になっているアクション(例:データベースへのCONNECT 、ターゲットテーブルに対するSELECT 、 pg_class 、 pg_namespace 、 svv_all_schemas 、 svv_tables 、`svv_table_info` などの関連システムビューに対するSELECT )を実行するために必要な権限が Redshift 内で付与されている必要があります。最小権限の原則に基づいてロールを使用することを強くお勧めします。セキュリティに関する考慮事項を参照してください。

資格:

Redshift の接続情報は AWS Secrets Manager によって管理され、サーバーは Redshift Data API を使用して接続します。必要なのは以下のとおりです。

  • Redshift クラスター識別子。

  • クラスター内のデータベース名。

  • データベース認証情報 (ユーザー名とパスワード) を含む AWS Secrets Manager シークレットの ARN。

  • クラスターとシークレットが存在する AWS リージョン。

  • デフォルトの認証情報/リージョンを使用していない場合は、オプションで AWS プロファイル名を指定します。

これらの詳細は、構成セクションで詳述されているように、環境変数を介して構成されます。

構成

環境変数の設定: このサーバーは、AWS Data API 経由で Redshift クラスターに接続するために、以下の環境変数を必要とします。これらの環境変数は、シェル内で直接設定するか、systemd サービスファイル、Docker 環境ファイル、またはプロジェクトのルートディレクトリに.envファイルを作成することで設定できます( uvやpython-dotenvなどの.envからの読み込みをサポートするツールを使用している場合)。

シェルエクスポートの使用例:

export REDSHIFT_CLUSTER_ID="your-cluster-id"
export REDSHIFT_DATABASE="your_database_name"
export REDSHIFT_SECRET_ARN="arn:aws:secretsmanager:us-east-1:123456789012:secret:your-redshift-secret-XXXXXX"
export AWS_REGION="us-east-1" # Or AWS_DEFAULT_REGION
# export AWS_PROFILE="your-aws-profile-name" # Optional

.envファイルの例 ( .env.exampleを参照):

# .env file for Redshift MCP Server configuration
# Ensure this file is NOT committed to version control if it contains secrets. Add it to .gitignore.

REDSHIFT_CLUSTER_ID="your-cluster-id"
REDSHIFT_DATABASE="your_database_name"
REDSHIFT_SECRET_ARN="arn:aws:secretsmanager:us-east-1:123456789012:secret:your-redshift-secret-XXXXXX"
AWS_REGION="us-east-1" # Or AWS_DEFAULT_REGION
# AWS_PROFILE="your-aws-profile-name" # Optional

必須変数テーブル:

変数名

必須

説明

サンプル値

REDSHIFT_CLUSTER_ID

はい

Redshift クラスターの識別子。

my-redshift-cluster

REDSHIFT_DATABASE

はい

接続するデータベースの名前。

mydatabase

REDSHIFT_SECRET_ARN

はい

Redshift 認証情報の AWS Secrets Manager ARN。

arn:aws:secretsmanager:us-east-1:123456789012:secret:mysecret-abcdef

AWS_REGION

はい

Data API および Secrets Manager の AWS リージョン。

us-east-1

AWS_DEFAULT_REGION

いいえ

AWS リージョンを指定するためのAWS_REGIONの代替。

us-west-2

AWS_PROFILE

いいえ

認証情報ファイル (~/.aws/...) から使用する AWS プロファイル名。

my-redshift-profile

注意: Boto3 によって使用される AWS 認証情報 (環境、プロファイル、または IAM ロール経由) に、指定されたREDSHIFT_SECRET_ARNにアクセスし、Redshift Data API ( redshift-data:* ) を使用する権限があることを確認してください。

使用法

Claude Desktop / Anthropic Console との接続:

mcp.jsonファイルに以下の設定ブロックを追加してください。インストール方法と設定に応じて、 command 、 args 、 env 、 workingDirectory調整してください。

{
  "mcpServers": {
    "redshift-utils-mcp": {
      "command": "uvx",
      "args": ["redshift_utils_mcp"],
      "env": {
        "REDSHIFT_CLUSTER_ID":"your-cluster-id",
        "REDSHIFT_DATABASE":"your_database_name",
        "REDSHIFT_SECRET_ARN":"arn:aws:secretsmanager:...",
        "AWS_REGION": "us-east-1"
      }
  }
}

カーソル IDE との接続:

  1. 「使用方法 / クイックスタート」セクションの指示に従って、MCP サーバーをローカルで起動します。

  2. カーソルで、コマンド パレットを開きます (Cmd/Ctrl + Shift + P)。

  3. 「MCP サーバーに接続」と入力するか、MCP 設定に移動します。

  4. 新しいサーバー接続を追加します。

  5. stdioトランスポート タイプを選択します。

  6. サーバーの起動に必要なコマンドと引数を入力してください( uvx run redshift_utils_mcp )。実行するコマンドに必要な環境変数が利用可能であることを確認してください。

  7. カーソルはサーバーと利用可能なツール/リソースを検出する必要があります。

利用可能なMCPリソース

リソースURIパターン

説明

URIの例

/scripts/{script_path}

サーバーのsql_scriptsディレクトリから SQL スクリプト ファイルの生のコンテンツを取得します。

/scripts/health/disk_usage.sql

redshift://schemas

接続されたデータベース内のアクセス可能なすべてのユーザー定義スキーマを一覧表示します。

redshift://schemas

redshift://wlm/configuration

現在のワークロード管理 (WLM) 構成の詳細を取得します。

redshift://wlm/configuration

redshift://schema/{schema_name}/tables

指定された{schema_name}内のすべてのアクセス可能なテーブルとビューを一覧表示します。

redshift://schema/public/tables

リクエストを行う際は、 {script_path}と{schema_name}を実際の値に置き換えてください。スキーマ/テーブルへのアクセスは、 REDSHIFT_SECRET_ARNで設定されたRedshiftユーザーの権限に依存します。

利用可能なMCPツール

ツール名

説明

主要なパラメータ(必須*)

呼び出し例

handle_check_cluster_health

一連の診断 SQL スクリプトを使用して、Redshift クラスターのヘルス評価を実行します。

level (オプション)、 time_window_days (オプション)

use_mcp_tool("redshift-admin", "handle_check_cluster_health", {"level": "full"})

handle_diagnose_locks

クラスター内のアクティブなロック競合とブロックしているセッションを識別します。

min_wait_seconds (オプション)

use_mcp_tool("redshift-admin", "handle_diagnose_locks", {"min_wait_seconds": 10})

handle_diagnose_query_performance

プラン、メトリック、履歴データなど、特定のクエリの実行パフォーマンスを分析します。

query_id *

use_mcp_tool("redshift-admin", "handle_diagnose_query_performance", {"query_id": 12345})

handle_execute_ad_hoc_query

Redshift Data API 経由でユーザーが提供した任意の SQL クエリを実行します。エスケープハッチとして設計されています。

sql_query *

use_mcp_tool("redshift-admin", "handle_execute_ad_hoc_query", {"sql_query": "SELECT ..."})

handle_get_table_definition

特定のテーブルの DDL (データ定義言語) ステートメント ( SHOW TABLE ) を取得します。

schema_name 、 table_name

use_mcp_tool("redshift-admin", "handle_get_table_definition", {"schema_name": "public", ...})

handle_inspect_table

特定の Redshift テーブルに関する、設計、ストレージ、健全性、使用状況などの詳細情報を取得します。

schema_name 、 table_name

use_mcp_tool("redshift-admin", "handle_inspect_table", {"schema_name": "analytics", ...})

handle_monitor_workload

さまざまな診断スクリプトを使用して、指定された時間枠内のクラスターのワークロード パターンを分析します。

time_window_days (オプション)、 top_n_queries (オプション)

use_mcp_tool("redshift-admin", "handle_monitor_workload", {"time_window_days": 7})

やること

  • [ ] プロンプトオプションの改善

  • [ ] より多くの認証方法のサポートを追加

  • [ ] Redshift Serverlessのサポートを追加

貢献

貢献を歓迎します!以下のガイドラインに従ってください。

問題の検索/報告: GitHub Issuesページで既存のバグや機能リクエストをご確認ください。必要に応じて、お気軽に新しい問題をご報告ください。

MCPサーバー経由でデータベースアクセスを提供する場合、セキュリティは非常に重要です。以下の点にご留意ください。

🔒**認証情報の管理:**このサーバーは、Redshift Data API を介して AWS Secrets Manager を使用します。これは、環境変数や設定ファイルに直接認証情報を保存するよりも安全な方法です。Boto3 が使用する AWS 認証情報(環境、プロファイル、または IAM ロール経由)が安全に管理され、必要最小限の権限が付与されていることを確認してください。AWS 認証情報やシークレットを含む.envファイルはバージョン管理にコミットしないでください。

🛡️最小権限の原則: AWS Secrets Manager に認証情報が登録されている Redshift ユーザーには、サーバーの想定される機能に必要な最小限の権限を設定します。例えば、読み取りアクセスのみが必要な場合は、必要なスキーマ/テーブルに対してCONNECT権限とSELECT権限のみを付与し、必要なシステムビューに対してSELECT権限のみを付与します。 adminやクラスターのスーパーユーザーなどの高い権限を持つユーザーの使用は避けてください。

制限された Redshift ユーザーを作成し、権限を管理する方法については、公式 ( https://docs.aws.amazon.com/redshift/latest/mgmt/security.html ) を参照してください。

ライセンス

このプロジェクトはMITライセンスの下でライセンスされています。詳細は(LICENSE)ファイルをご覧ください。

参考文献

Available Tools

7 tools
handle_check_cluster_healthA

Performs a health assessment of the Redshift cluster.

Executes a series of diagnostic SQL scripts concurrently based on the
specified level ('basic' or 'full'). Aggregates raw results or errors
from each script into a dictionary.

Args:
    ctx: The MCP context object.
    level: Level of detail: 'basic' for operational status, 'full' for
           comprehensive table design/maintenance checks. Defaults to 'basic'.
    time_window_days: Lookback period in days for time-sensitive checks
                      (e.g., queue waits, commit waits). Defaults to 1.

Returns:
    A dictionary where keys are script names and values are either the raw
    list of dictionary results from the SQL query or an Exception object
    if that specific script failed.

Raises:
    DataApiError: If a critical error occurs during script execution that
                  prevents gathering results (e.g., config error). Individual
                  script errors are captured within the returned dictionary.
ParametersJSON Schema
NameRequiredDescriptionDefault
levelNobasic
time_window_daysNo

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and does well by disclosing key behavioral traits: concurrent execution of scripts, aggregation of results into a dictionary, error handling approach (individual script errors captured in dictionary vs. critical errors raised as DataApiError), and the distinction between basic and full diagnostic levels.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, execution behavior, args, returns, raises) and front-loaded with the core purpose. While comprehensive, some sentences could be more concise, such as the detailed explanation of the return dictionary which is slightly verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations, no output schema, and 0% schema description coverage, the description provides substantial context including purpose, parameters, return format, and error handling. However, it doesn't mention authentication requirements, rate limits, or potential side effects on the cluster, which would be helpful given the diagnostic nature.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage, so the description fully compensates by providing detailed semantic explanations for both parameters: 'level' options ('basic' for operational status, 'full' for comprehensive checks) and 'time_window_days' purpose (lookback period for time-sensitive checks like queue waits). It also mentions default values and provides concrete examples.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool 'performs a health assessment of the Redshift cluster' with specific verbs ('executes diagnostic SQL scripts', 'aggregates results') and distinguishes it from siblings by focusing on comprehensive cluster health rather than specific issues like locks, query performance, or table inspection.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context about when to use different levels ('basic' for operational status, 'full' for comprehensive checks) and mentions time-sensitive checks, but doesn't explicitly state when to choose this tool over sibling tools like handle_diagnose_query_performance or handle_monitor_workload for similar health-related tasks.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

handle_diagnose_locksA

Identifies active lock contention in the cluster.

Fetches all current lock information and then filters it based on the
optional target PID, target table name, and minimum wait time.
Formats the results into a list of contention details and a summary.

Args:
    ctx: The MCP context object.
    target_pid: Optional: Filter results to show locks held by or waited
                for by this specific process ID (PID).
    target_table_name: Optional: Filter results for locks specifically on
                       this table name (schema qualification recommended
                       if ambiguous).
    min_wait_seconds: Minimum seconds a lock must be in a waiting state
                      to be included. Defaults to 5.

Returns:
    A list of dictionaries, where each dictionary represents a row
    from the lock contention query result.

Raises:
    DataApiError: If fetching the initial lock information fails.
ParametersJSON Schema
NameRequiredDescriptionDefault
min_wait_secondsNo
target_pidNo
target_table_nameNo

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and does well by explaining the tool's multi-step behavior: fetching all lock information, applying optional filters, formatting results into list+summary structure, and potential error conditions (DataApiError). It doesn't mention permissions, rate limits, or side effects, leaving some behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and well-structured with clear sections (purpose, args, returns, raises). While efficient, the parameter explanations could be slightly more concise, and the purpose statement could be more front-loaded before diving into implementation details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a diagnostic tool with 3 parameters, no annotations, and no output schema, the description provides good coverage: clear purpose, parameter semantics, return format (list of dictionaries), and error conditions. It could improve by explaining the summary structure or providing example output, but overall it's reasonably complete given the context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by providing detailed semantic explanations for all three parameters: target_pid (filter by process ID), target_table_name (filter by table with schema qualification note), and min_wait_seconds (minimum waiting time with default). The descriptions add meaningful context beyond basic schema types.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

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 specific verbs ('identifies', 'fetches', 'filters', 'formats') and resource ('active lock contention in the cluster'). It distinguishes itself from siblings by focusing specifically on lock diagnostics rather than general health, performance, or table operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context through parameter explanations (filtering by PID, table name, wait time) but doesn't explicitly state when to use this tool versus alternatives like handle_check_cluster_health or handle_diagnose_query_performance. No explicit when-not-to-use guidance or named alternatives are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

handle_diagnose_query_performanceA

Analyzes a specific query's execution performance.

Fetches query text, execution plan, metrics, alerts, compilation info,
skew details, and optionally historical run data. Uses a formatting
utility to synthesize this into a structured report with potential issues
and recommendations.

Args:
    ctx: The MCP context object.
    query_id: The numeric ID of the Redshift query to analyze.
    compare_historical: Fetch performance data for previous runs of the
                       same query text. Defaults to True.

Returns:
    A dictionary conforming to DiagnoseQueryPerformanceResult structure:
    - On success: Contains detailed performance breakdown, issues, recommendations.
    - On query not found: Raises QueryNotFound exception.
    - On other errors: Raises DataApiError or similar for FastMCP to handle.

Raises:
    DataApiError: If a critical error occurs during script execution or parsing.
    QueryNotFound: If the specified query_id cannot be found in key tables.
ParametersJSON Schema
NameRequiredDescriptionDefault
compare_historicalNo
query_idYes

TDQS

A4.4/5.0
Behavior4/5

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 and does so well. It describes what data gets fetched, how it's synthesized into a structured report, and documents specific error conditions (QueryNotFound, DataApiError). It also mentions the formatting utility and the tool's ability to optionally fetch historical data. While it doesn't mention rate limits or authentication needs, it provides substantial behavioral context for a diagnostic tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and well-structured with clear sections: purpose statement, what it fetches, how it processes data, args documentation, returns documentation, and raises documentation. Every sentence earns its place, though the returns section could be slightly more concise. The information is front-loaded with the core purpose stated first.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a diagnostic tool with 2 parameters, no annotations, and no output schema, the description provides substantial context. It explains what data gets collected, how it's processed, parameter meanings, and error conditions. The main gap is the lack of detail about the exact structure of the returned dictionary or what specific metrics/alerts are examined, but given the tool's complexity, this is reasonably complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by providing detailed parameter semantics. It explains that query_id is 'the numeric ID of the Redshift query to analyze' and that compare_historical controls whether to 'fetch performance data for previous runs of the same query text' with its default value. This adds crucial meaning beyond the bare schema types (integer, boolean).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

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 specific verbs ('analyzes', 'fetches', 'synthesizes') and resources ('query's execution performance', 'query text, execution plan, metrics, alerts, compilation info, skew details, historical run data'). It distinguishes from sibling tools like handle_check_cluster_health or handle_diagnose_locks by focusing specifically on query performance analysis rather than cluster health or lock diagnosis.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool: when you need to analyze a specific query's performance with detailed metrics and recommendations. It doesn't explicitly state when NOT to use it or name specific alternatives among siblings, but the context is sufficiently clear for an agent to understand this is for query performance diagnosis rather than general cluster monitoring or table inspection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

handle_execute_ad_hoc_queryA

Executes an arbitrary SQL query provided by the user via Redshift Data API.

Designed as an escape hatch for advanced users or queries not covered by
specialized tools. Returns a structured dictionary indicating success
(with results) or failure (with error details).

Args:
    ctx: The MCP context object.
    sql_query: The exact SQL query string to execute.

Returns:
    A dictionary conforming to ExecuteAdHocQueryResult structure:
    - On success: {"status": "success", "columns": [...], "rows": [...], "row_count": ...}
    - On error: {"status": "error", "error_message": "...", "error_type": "..."}
    (Note: Actual return might be handled by FastMCP error handling for raised exceptions)

Raises:
    DataApiConfigError: If configuration is invalid.
    SqlExecutionError: If the SQL execution itself fails.
    DataApiTimeoutError: If the Data API call times out.
    DataApiError: For other Data API related errors or unexpected issues.
    ClientError: For AWS client-side errors.
ParametersJSON Schema
NameRequiredDescriptionDefault
sql_queryYes

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and does an excellent job disclosing behavioral traits. It describes the return structure in detail (success vs error cases), mentions potential exceptions raised (DataApiConfigError, SqlExecutionError, etc.), and notes that 'Actual return might be handled by FastMCP error handling for raised exceptions.' This provides comprehensive behavioral context beyond basic functionality.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and appropriately sized. It begins with the core purpose, then provides usage context, followed by parameter documentation, return value details, and exception information. Every section adds value, though the detailed exception list could be slightly condensed. Overall, it's efficiently organized with clear sections.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (executing arbitrary SQL queries via Redshift Data API) and the absence of both annotations and output schema, the description provides substantial context. It covers purpose, usage guidelines, parameter semantics, return structure, and potential exceptions. The main gap is lack of information about query limitations, performance implications, or security considerations for arbitrary SQL execution.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds significant meaning beyond the input schema. With 0% schema description coverage (schema only shows sql_query is a required string), the description explains that 'sql_query: The exact SQL query string to execute.' This clarifies the parameter's purpose and format. While it doesn't provide SQL syntax guidance, it adequately compensates for the schema's lack of documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Executes an arbitrary SQL query provided by the user via Redshift Data API.' It specifies the exact action (execute SQL query), the mechanism (Redshift Data API), and distinguishes it from specialized tools by calling it an 'escape hatch for advanced users or queries not covered by specialized tools.' This differentiates it from sibling tools like handle_get_table_definition or handle_inspect_table.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use this tool: 'Designed as an escape hatch for advanced users or queries not covered by specialized tools.' This provides clear guidance that this tool should be used when other specialized tools (the siblings listed) don't cover the needed functionality, establishing clear alternatives and usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

handle_get_table_definitionA

Retrieves the DDL (Data Definition Language) statement for a specific table.

Executes a SQL script designed to generate or retrieve the CREATE TABLE
statement for the given table.

Args:
    ctx: The MCP context object.
    schema_name: The schema name of the table.
    table_name: The name of the table.

Returns:
    A dictionary conforming to GetTableDefinitionResult structure:
    - On success: {"status": "success", "ddl": "<CREATE TABLE statement>"}
    - On table not found or DDL retrieval error:
      {"status": "error", "error_message": "...", "error_type": "..."}

Raises:
    TableNotFound: If the specified table is not found.
    DataApiError: If a critical, unexpected error occurs during execution.
ParametersJSON Schema
NameRequiredDescriptionDefault
schema_nameYes
table_nameYes

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and does well by detailing success/error return structures, specific exception types (TableNotFound, DataApiError), and the SQL script execution behavior. However, it doesn't mention performance characteristics, rate limits, or authentication requirements that would be helpful for a database tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, execution details, Args, Returns, Raises) and every sentence adds value. It's appropriately sized for a tool with 2 parameters and complex return behavior, with no redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 2 parameters, no annotations, and no output schema, the description provides excellent coverage of parameters, return values, and exceptions. The main gap is lack of guidance on when to use versus sibling tools, but otherwise it's quite complete for the tool's complexity level.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description provides explicit parameter documentation in the Args section, clearly explaining what schema_name and table_name represent. With 0% schema description coverage, this comprehensive parameter documentation fully compensates and adds significant value beyond the bare input schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Retrieves the DDL statement') and resource ('for a specific table'), distinguishing it from sibling tools like handle_execute_ad_hoc_query or handle_inspect_table. It explicitly mentions the SQL script execution aspect, providing precise functional context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when needing table DDL, but doesn't explicitly state when to use this tool versus alternatives like handle_inspect_table or handle_execute_ad_hoc_query. No guidance is provided on prerequisites, error handling expectations, or specific scenarios where this tool is preferred over siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

handle_inspect_tableA

Retrieves detailed information about a specific Redshift table.

Fetches table OID, then concurrently executes various inspection scripts
covering design, storage, health, usage, and encoding.

Args:
    ctx: The MCP context object.
    schema_name: The schema name of the table.
    table_name: The name of the table.

Returns:
    A dictionary where keys are script names and values are either the raw
    list of dictionary results from the SQL query, the extracted DDL string,
    or an Exception object if that specific script failed.
    - On success: Dictionary containing raw results or Exception objects for each script.
    - On table not found: Raises TableNotFound exception.
    - On critical errors (e.g., OID lookup failure): Raises DataApiError or similar.

Raises:
    DataApiError: If a critical error occurs during script execution.
    TableNotFound: If the specified table cannot be found via its OID.
ParametersJSON Schema
NameRequiredDescriptionDefault
schema_nameYes
table_nameYes

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and does so effectively. It discloses the concurrent execution of multiple scripts, the mixed return types (raw results, DDL strings, or Exception objects), and specific error conditions (TableNotFound, DataApiError). However, it omits details like rate limits, authentication needs, or performance implications.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, Args, Returns, Raises) and front-loaded key information. It avoids redundancy, but the Returns section is slightly verbose in detailing success/error cases; some details could be condensed without losing clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

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 provides substantial context: purpose, parameters, return structure, and error handling. It adequately covers the tool's complexity (2 params, mixed outputs). However, it lacks examples of return values or script names, which would enhance completeness for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It explicitly lists and explains the two parameters (schema_name and table_name) in the Args section, clarifying their roles in identifying the Redshift table. This adds meaningful context beyond the bare schema, though it could elaborate on format constraints (e.g., case sensitivity).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Retrieves detailed information') and resource ('about a specific Redshift table'), distinguishing it from siblings like handle_get_table_definition (which likely fetches only DDL) and handle_diagnose_query_performance (which focuses on queries rather than table metadata). The mention of 'various inspection scripts covering design, storage, health, usage, and encoding' provides concrete scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implicitly suggests usage when detailed table metadata is needed, but lacks explicit guidance on when to choose this over alternatives like handle_get_table_definition or handle_monitor_workload. It does not specify prerequisites or exclusions, though the error conditions hint at when-not scenarios (e.g., table not found).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

handle_monitor_workloadA

Analyzes cluster workload patterns over a specified time window.

Executes various SQL scripts concurrently to gather data on resource usage,
WLM performance, top queries, queuing, COPY performance, and disk-based
queries. Returns a dictionary containing the raw results (or Exceptions)
keyed by the script name.

Args:
    ctx: The MCP context object.
    time_window_days: Lookback period in days for the workload analysis.
                      Defaults to 2.
    top_n_queries: Number of top queries (by total execution time) to
                   consider for the 'top_queries.sql' script. Defaults to 10.

Returns:
    A dictionary where keys are script names (e.g., 'workload/top_queries.sql')
    and values are either a list of result rows (as dictionaries) or the
    Exception object if that script failed.

Raises:
    DataApiError: If a critical error occurs during configuration loading.
                  (Note: Individual script errors are returned in the result dict).
ParametersJSON Schema
NameRequiredDescriptionDefault
time_window_daysNo
top_n_queriesNo

TDQS

A4.2/5.0
Behavior4/5

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 effectively describes that the tool executes SQL scripts concurrently, returns a dictionary with raw results or exceptions, and handles individual script failures gracefully by including exceptions in the result dict. It also mentions that critical configuration errors raise DataApiError. However, it doesn't specify performance characteristics, rate limits, or authentication requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, execution details, args, returns, raises) and front-loaded with the core functionality. While comprehensive, some sentences could be more concise, such as the detailed explanation of the return dictionary structure which is somewhat verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a workload analysis tool with 2 parameters, no annotations, and no output schema, the description provides substantial context about behavior, parameters, return format, and error handling. It explains the concurrent execution of SQL scripts, the dictionary return structure with success/failure results, and different error scenarios. The main gap is lack of information about what specific workload metrics are analyzed beyond the general categories mentioned.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description provides excellent parameter semantics beyond the basic schema. While schema description coverage is 0%, the description clearly explains that time_window_days is the 'lookback period in days for workload analysis' with a default of 2, and top_n_queries determines 'number of top queries to consider' with a default of 10. This adds meaningful context about what these parameters control in the analysis.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool 'analyzes cluster workload patterns over a specified time window' with specific verbs (analyzes, executes, gathers) and resources (cluster workload, SQL scripts). It distinguishes from siblings like handle_check_cluster_health or handle_diagnose_query_performance by focusing on comprehensive workload analysis rather than specific health checks or query diagnostics.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for analyzing workload patterns over time, but doesn't explicitly state when to use this tool versus alternatives like handle_diagnose_query_performance or handle_execute_ad_hoc_query. There's no guidance on prerequisites, exclusions, or specific scenarios where this tool is preferred over sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 7 tool updatesv1.0.0
    • First observedhandle_check_cluster_health
    • First observedhandle_diagnose_locks
    • First observedhandle_diagnose_query_performance
    • First observedhandle_execute_ad_hoc_query
    • First observedhandle_get_table_definition
    • First observedhandle_inspect_table
    • First observedhandle_monitor_workload

TDQS

A4.3/5.0

Scored across 7 tools

Disambiguation5/5

Each tool has a distinct purpose with clear boundaries: cluster health assessment, lock diagnosis, query performance analysis, ad-hoc query execution, table definition retrieval, table inspection, and workload monitoring. There is no functional overlap between tools, and the descriptions clearly differentiate their specific use cases.

Naming Consistency3/5

All tools follow a 'handle_verb_noun' prefix pattern, which provides some consistency. However, the verb choices are mixed ('check', 'diagnose', 'execute', 'get', 'inspect', 'monitor'), making the naming somewhat inconsistent in terms of action semantics. The structure is predictable but the verb selection lacks uniformity.

Tool Count5/5

With 7 tools, this server is well-scoped for Redshift cluster diagnostics and management. Each tool serves a specific, valuable function in the domain, and there are no redundant or trivial tools. The count is appropriate for covering key operational and troubleshooting tasks without being overwhelming.

Completeness4/5

The toolset covers essential diagnostic and operational areas for Redshift: health checks, lock analysis, query performance, ad-hoc queries, table definitions, table inspection, and workload monitoring. Minor gaps exist, such as lack of tools for cluster configuration changes, user/role management, or backup operations, but core diagnostic workflows are well-covered.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    A
    maintenance
    Model Context Protocol (MCP) server that integrates Redash with AI assistants like Claude, allowing them to query data, manage visualizations, and interact with dashboards through natural language.
    4
    67
    4,035 npm
    105
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    A Model Context Protocol server that enables AI assistants to interact with Amazon Redshift databases, allowing for schema exploration, query execution, and statistics collection.
    3
    2
    Apache 2.0