Content
# Redash MCP Server
Redash API MCP server providing features such as query execution and result retrieval.
## Tool List
1. `execute_query_and_wait`
* Execute a SQL query and wait for the result to be available
* Input parameters:
* `query` (string): SQL query to execute
* `data_source_id` (number, optional): ID of the data source to execute the query on
* `max_age` (number, optional): Cache expiration time in seconds
* Return value: Query result when available
2. `list_data_sources`
* List all available data sources
* Input parameters: None
* Return value: Array of data sources
3. `get_data_source`
* Get details about a specific data source
* Input parameters:
* `data_source_id` (number): ID of the data source
* Return value: Data source details
4. `get_query`
* Get details about a saved query by ID (including SQL text)
* Input parameters:
* `query_id` (number): Query ID
* Return value: Saved query details
5. `search_queries`
* Search for saved queries by keyword
* Input parameters:
* `q` (string): Search keyword
* `page` (number, optional): Page number
* `page_size` (number, optional): Page size
* Return value: List of saved queries matching the search
6. `get_query_result`
* Get an existing query result by ID (without re-execution)
* Input parameters:
* `query_result_id` (number): Query result ID
* Return value: Query result
7. `get_saved_query_result`
* Get the latest cached result of a saved query by ID
* Input parameters:
* `query_id` (number): Query ID
* Return value: Latest cached query result
## Setup
### API Key
Obtain a Redash API key.
1. Log in to Redash
2. Click "Edit Profile"
3. Copy the API key
### Environment Variables
The following environment variables are required:
* `REDASH_API_KEY`: Redash API key
* `REDASH_BASE_URL`: Redash URL (e.g., https://redash.example.com)
* `DATA_SOURCE_ID` (optional): Default data source ID (used when `data_source_id` is omitted in `execute_query_and_wait`)
* `PORT` (optional): HTTP server port number (default: 3000, used for Streamable HTTP / SSE)
### Installation
```sh
git clone https://github.com/yuki9541134/mcp-redash.git
cd mcp-redash
npm install
npm run build
npm link
```
## Launch Modes
Three launch modes are supported.
| | stdio (default) | Streamable HTTP | SSE (deprecated) |
|---|---|---|---|
| Launch flag | None | `--streamable-http` | `--sse` |
| Communication method | Standard input/output | HTTP | HTTP (Server-Sent Events) |
| Port | Not required | Default 3000 | Default 3000 |
| Endpoints | - | `POST/GET/DELETE /mcp` | `GET /sse`, `POST /messages` |
| Primary use | Local usage | Remote / multi-client sharing | Legacy compatibility |
### stdio (default)
Mode for communicating via standard input/output. Use this for local usage with MCP clients.
```bash
npm run build
node dist/index.js
```
> During development, use `npm run dev` to execute TypeScript directly.
#### Usage with npx
If `npm link` is done, you can execute directly with npx.
```bash
npx mcp-redash
```
Example `.mcp.json` configuration for Claude Code:
```json
{
"mcpServers": {
"redash": {
"type": "stdio",
"command": "npx",
"args": ["mcp-redash"],
"env": {
"REDASH_API_KEY": "<YOUR_API_KEY>",
"REDASH_BASE_URL": "https://redash.example.com"
}
}
}
}
```
#### Usage with Docker
```sh
docker build -t yuki9541134/mcp-redash .
```
Example `.mcp.json` configuration for Claude Code:
```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
Mode for launching as an HTTP server and communicating via Streamable HTTP protocol. Suitable for web clients and remote connections.
Set `.env` with `PORT`, `REDASH_BASE_URL`, and `REDASH_API_KEY` before launching.
#### Launch with node
```bash
npm run build
node dist/index.js --streamable-http
```
> During development, use `npm run dev -- --streamable-http` to execute TypeScript directly.
#### Launch with docker compose
```sh
docker compose up -d
```
> Port can be changed with `.env` `PORT` (default: 3000).
Endpoints:
- `POST /mcp` - Send request
- `GET /mcp` - Establish SSE stream (server → client notifications)
- `DELETE /mcp` - End session
Example `.mcp.json` configuration for Claude Code:
```json
{
"mcpServers": {
"redash": {
"type": "http",
"url": "http://localhost:3000/mcp"
}
}
}
```
Example `config.toml` configuration for Codex:
```toml
[mcp_servers.redash]
type = "url"
url = "http://localhost:3000/mcp"
```
### SSE (deprecated)
> **Deprecated**: SSE mode is kept for legacy compatibility. Use Streamable HTTP mode for new usage.
Mode for launching as an HTTP server and communicating via Server-Sent Events (SSE).
```bash
npm run build
node dist/index.js --sse
```
> During development, use `npm run dev -- --sse` to execute TypeScript directly.
Endpoints:
- `GET /sse` - Establish SSE connection
- `POST /messages` - Send message
Example `.mcp.json` configuration for Claude Code:
```json
{
"mcpServers": {
"redash": {
"type": "sse",
"url": "http://localhost:3000/sse"
}
}
}
```
Connection Info
You Might Also Like
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
markitdown
Python tool for converting files and office documents to Markdown.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.
mempalace
The highest-scoring AI memory system ever benchmarked. And it's free.
mempalace
The highest-scoring AI memory system ever benchmarked. And it's free.