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"
}
}
}
Похожие серверы
MySQL Server
A server for performing MySQL database operations.
Dynamics 365 MCP Server by CData
A read-only MCP server by CData that enables LLMs to query live data from Dynamics 365. Requires the CData JDBC Driver for Dynamics 365.
Multi Database MCP Server
An MCP server that provides AI assistants with structured access to multiple databases simultaneously.
MySQL MCP Server
Enables secure interaction with MySQL databases, allowing AI assistants to list tables, read data, and execute SQL queries through a controlled interface.
Octopus MCP Server
A high-performance, persistent knowledge base MCP server built with Rust. Supports local deployment with hybrid datastores like Qdrant, Neo4j, and Redis.
Mina Archive Node API
Access Mina blockchain data, including events, actions, and network state, through the Mina Archive Node API.
DROMA MCP Server
Interact with DROMA drug-omics association analysis databases using natural language.
CData SAP Hybris C4C
A read-only MCP server for querying live SAP Hybris C4C data, powered by the CData JDBC Driver.
CongressMCP
Access comprehensive U.S. Congressional data, including bills, votes, and member information, via the Congress.gov API.
Exasol MCP
Exasol MCP server. Provides knowledge about the Exasol database to an LLM through the Model Context Protocol.