Skip to main content
Glama
Redash MCP Server

Redash MCP Server

by yuki9541134

Redash MCPサーバー

Redash APIのMCPサーバーで、クエリの実行、結果の取得などの機能を提供します。

ツール

  1. execute_query_and_wait

    • SQLクエリを実行し、結果が利用可能になるまで待機します

    • 入力パラメータ:

      • query (文字列): 実行するSQLクエリ

      • data_source_id (数値, 任意): クエリを実行するデータソースのID

      • max_age (数値, 任意): キャッシュ有効期限(秒)

    • 戻り値: 利用可能になったクエリ結果

  2. list_data_sources

    • 利用可能なすべてのデータソースを一覧表示します

    • 入力パラメータ: なし

    • 戻り値: データソースの配列

  3. get_data_source

    • 特定のデータソースに関する詳細を取得します

    • 入力パラメータ:

      • data_source_id (数値): データソースのID

    • 戻り値: データソースの詳細情報

  4. get_query

    • クエリIDにより保存済みクエリの詳細を取得します(SQLテキスト含む)

    • 入力パラメータ:

      • query_id (数値): クエリID

    • 戻り値: 保存済みクエリの詳細情報

  5. search_queries

    • キーワードで保存済みクエリを検索します

    • 入力パラメータ:

      • q (文字列): 検索キーワード

      • page (数値, 任意): ページ番号

      • page_size (数値, 任意): ページサイズ

    • 戻り値: 検索にマッチした保存済みクエリの一覧

  6. get_query_result

    • クエリ結果IDにより既存のクエリ結果を取得します(再実行なし)

    • 入力パラメータ:

      • query_result_id (数値): クエリ結果ID

    • 戻り値: クエリ結果

  7. get_saved_query_result

    • クエリIDにより保存済みクエリの最新キャッシュ結果を取得します

    • 入力パラメータ:

      • query_id (数値): クエリID

    • 戻り値: 保存済みクエリの最新キャッシュ結果

Related MCP server: Redash MCP Server

セットアップ

APIキー

Redash APIキーを取得してください。

  1. Redashにログイン

  2. 「Edit Profile」をクリック

  3. APIキーをコピーする

環境変数

以下の環境変数が必要です:

  • REDASH_API_KEY: RedashのAPIキー

  • REDASH_BASE_URL: RedashのURL(例: https://redash.example.com)

  • DATA_SOURCE_ID(任意): デフォルトのデータソースID(execute_query_and_wait で data_source_id を省略した場合に使用)

  • PORT(任意): HTTPサーバーのポート番号(デフォルト: 3000、Streamable HTTP / SSE で使用)

インストール

git clone https://github.com/yuki9541134/mcp-redash.git
cd mcp-redash
npm install
npm run build
npm link

起動モード

3つの起動モードに対応しています。

stdio(デフォルト)

Streamable HTTP

SSE(非推奨)

起動フラグ

なし

--streamable-http

--sse

通信方式

標準入出力

HTTP

HTTP(Server-Sent Events)

ポート

不要

デフォルト 3000

デフォルト 3000

エンドポイント

-

POST/GET/DELETE /mcp

GET /sse, POST /messages

主な用途

ローカル利用

リモート・複数クライアント共有

レガシー互換

stdio(デフォルト)

標準入出力で通信するモードです。MCPクライアントからローカルで利用する場合はこちらを使用します。

npm run build
node dist/index.js

開発時は npm run dev でTypeScriptを直接実行できます。

npxで利用する場合

npm link 済みであれば、npxで直接実行できます。

npx mcp-redash

Claude Codeの .mcp.json 設定例:

{
  "mcpServers": {
    "redash": {
      "type": "stdio",
      "command": "npx",
      "args": ["mcp-redash"],
      "env": {
        "REDASH_API_KEY": "<YOUR_API_KEY>",
        "REDASH_BASE_URL": "https://redash.example.com"
      }
    }
  }
}

Dockerで利用する場合

docker build -t yuki9541134/mcp-redash .

Claude Codeの .mcp.json 設定例:

{
  "mcpServers": {
    "redash": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "REDASH_API_KEY",
        "-e", "REDASH_BASE_URL",
        "yuki9541134/mcp-redash"
      ],
      "env": {
        "REDASH_API_KEY": "<YOUR_API_KEY>",
        "REDASH_BASE_URL": "https://redash.example.com"
      }
    }
  }
}

Streamable HTTP

HTTPサーバーとして起動し、Streamable HTTPプロトコルで通信するモードです。Webクライアントやリモート接続に適しています。

.env で PORT REDASH_BASE_URL REDASH_API_KEY を設定してから起動してください。

nodeで起動する場合

npm run build
node dist/index.js --streamable-http

開発時は npm run dev -- --streamable-http でTypeScriptを直接実行できます。

docker composeで起動する場合

docker compose up -d

.env の PORT でポートを変更できます(デフォルト: 3000)。

エンドポイント:

  • POST /mcp - リクエストの送信

  • GET /mcp - SSEストリームの確立(サーバー → クライアント通知用)

  • DELETE /mcp - セッションの終了

Claude Codeの .mcp.json 設定例:

{
  "mcpServers": {
    "redash": {
      "type": "http",
      "url": "http://localhost:3000/mcp"
    }
  }
}

Codexのconfig.toml 設定例

[mcp_servers.redash]
type = "url"
url = "http://localhost:3000/mcp"

SSE(非推奨)

非推奨: SSEモードはレガシー互換のために残されています。新規利用にはStreamable HTTPモードを推奨します。

HTTPサーバーとして起動し、Server-Sent Events (SSE) で通信するモードです。

npm run build
node dist/index.js --sse

開発時は npm run dev -- --sse でTypeScriptを直接実行できます。

エンドポイント:

  • GET /sse - SSE接続の確立

  • POST /messages - メッセージの送信

Claude Codeの .mcp.json 設定例:

{
  "mcpServers": {
    "redash": {
      "type": "sse",
      "url": "http://localhost:3000/sse"
    }
  }
}

Available Tools

3 tools
execute_query_and_waitC

Execute a SQL query and wait for the results

Inputs: query (required), data_source_id, max_age.

get_data_sourceC

Get details about a specific data source

Inputs: data_source_id (required).

list_data_sourcesB

List all available data sources

Inputs: no named parameters.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: execute_query_and_wait runs queries, get_data_source retrieves details for a specific source, and list_data_sources enumerates all sources. There is no overlap or ambiguity between these operations.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern (execute_query_and_wait, get_data_source, list_data_sources) with clear, descriptive names that align well with their functions.

    Tool Count2/5

    With only 3 tools, the server feels under-scoped for a Redash-like data querying and visualization platform. Key operations like creating/updating queries, managing dashboards, or fetching query results are missing, making the set too thin for typical agent workflows.

    Completeness2/5

    The tool surface is severely incomplete for a Redash server. While it covers basic data source listing and query execution, it lacks essential CRUD operations for queries, dashboards, and visualizations, as well as lifecycle management tools, which will likely cause agent failures in complex tasks.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to interact with Metabase analytics platform, allowing users to query databases, manage dashboards and cards, execute SQL queries, and access analytics data through natural language.
      119 npm
      1
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      Enables interaction with Redash instances through a standardized interface, allowing users to execute SQL queries, manage data sources, and retrieve query results using natural language.
      4
      1,756 npm
      1
      MIT
    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables AI assistants to interact with Metabase by providing access to dashboards, questions, and databases through the Metabase API. It allows users to list resources, execute existing cards, and run custom SQL queries to retrieve data through natural language.
      15 npm
      -
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to interact with Metabase for database operations, SQL queries, dashboard management, and analytics automation.
      28
      MIT