Redash
Execute queries and retrieve results using the Redash API.
Redash MCPサーバー
Redash APIのMCPサーバーで、クエリの実行、結果の取得などの機能を提供します。
ツール
-
execute_query_and_wait- SQLクエリを実行し、結果が利用可能になるまで待機します
- 入力パラメータ:
query(文字列): 実行するSQLクエリdata_source_id(数値, 任意): クエリを実行するデータソースのIDmax_age(数値, 任意): キャッシュ有効期限(秒)
- 戻り値: 利用可能になったクエリ結果
-
list_data_sources- 利用可能なすべてのデータソースを一覧表示します
- 入力パラメータ: なし
- 戻り値: データソースの配列
-
get_data_source- 特定のデータソースに関する詳細を取得します
- 入力パラメータ:
data_source_id(数値): データソースのID
- 戻り値: データソースの詳細情報
-
get_query- クエリIDにより保存済みクエリの詳細を取得します(SQLテキスト含む)
- 入力パラメータ:
query_id(数値): クエリID
- 戻り値: 保存済みクエリの詳細情報
-
search_queries- キーワードで保存済みクエリを検索します
- 入力パラメータ:
q(文字列): 検索キーワードpage(数値, 任意): ページ番号page_size(数値, 任意): ページサイズ
- 戻り値: 検索にマッチした保存済みクエリの一覧
-
get_query_result- クエリ結果IDにより既存のクエリ結果を取得します(再実行なし)
- 入力パラメータ:
query_result_id(数値): クエリ結果ID
- 戻り値: クエリ結果
-
get_saved_query_result- クエリIDにより保存済みクエリの最新キャッシュ結果を取得します
- 入力パラメータ:
query_id(数値): クエリID
- 戻り値: 保存済みクエリの最新キャッシュ結果
セットアップ
APIキー
Redash APIキーを取得してください。
- Redashにログイン
- 「Edit Profile」をクリック
- 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クライアントやリモート接続に適しています。
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"
}
}
}
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"
}
}
}
相關伺服器
MLB SportRadar
Access MLB game data, standings, and player statistics using the SportRadar API.
Solana MCP Server
Provides comprehensive access to Solana blockchain data using 21 essential RPC methods.
ローカルNeo4jコンテナ
Manages personal knowledge using a local Neo4j container, with data imported from JSON files.
Prometheus MCP Server
A Prometheus MCP server with full API support for comprehensive management and deep interaction with Prometheus beyond basic query support. Written in go, it is a single binary install that is capable of STDIO, SSE, and HTTP transports for complex deployments.
Elasticsearch
Connects agents to Elasticsearch data, enabling natural language interaction with indices.
Tabular MCP Server
An MCP server for local Tabular Models like PowerBI. It allows LLM clients to debug, analyze, and compose DAX queries by connecting to a local Tabular model instance.
GeoServer MCP Server
Connects Large Language Models to the GeoServer REST API, enabling AI assistants to interact with geospatial data and services.
Google BigQuery by CData
Connect to Google BigQuery databases using CData's MCP Server. Requires a separate CData JDBC Driver license.
World Bank MCP Server
Interact with the open World Bank data API to list and analyze economic and development indicators for various countries.
MySQL MCP
A secure MCP service for accessing and managing MySQL databases, featuring multi-layer security and high-performance connection pooling.