Skip to main content
Glama

redash-mcp

npm version Downloads Node Glama Claude Cursor Gemini CLI Codex CLI

English | 한국어 | 日本語

MCP server that connects Redash to Claude, Cursor, Gemini CLI, Codex, and any MCP client — query data, build charts and dashboards, and run SQL with natural language.

Install · Tools · Env · Examples · Troubleshooting · Privacy

What's new in 3.5

  • create_visualization — create line / column / area / pie / scatter charts or counters on a saved query. If the query has been run, column names are checked against its latest result, so a typo returns an error instead of an empty chart.

  • Dashboard auto-layout — add_widget places new widgets below existing ones; half-width widgets pair up side by side (previously they all overlapped at the top-left).

Full history: Releases

Related MCP server: redash-mcp

Why redash-mcp?

Built for letting an LLM touch production data safely:

  • 🛡️ SQL Safety Guard — blocks DROP/TRUNCATE/ALTER and DELETE/UPDATE without WHERE; strict/warn/off modes, PII detection, and auto-LIMIT.

  • 🧠 BIRD Smart Query — analyzes the question, auto-selects tables, and guides SQL generation (BIRD text-to-SQL). Optional Claude Haiku fallback.

  • 📊 End-to-end — query, save, chart, dashboards, and alerts — 25 tools.

  • ⚡ One-command setup — npx redash-mcp setup configures Claude Desktop / Claude Code / Cursor / Gemini CLI / Codex CLI.

  • 🔒 Fully local — talks directly to your Redash. API key and results never leave your machine.

Installation

Requirements: Node.js 20+ and a Redash API key (Redash → Profile → Edit Profile → API Key).

npx redash-mcp setup

The wizard configures any combination of Claude Desktop, Claude Code, Cursor, Gemini CLI, and Codex CLI.

Alternatively, install Node.js, Claude Desktop, and the MCP config in one go:

curl -fsSL https://raw.githubusercontent.com/seob717/redash-mcp/main/install.sh | bash
  • Claude Desktop — ~/Library/Application Support/Claude/claude_desktop_config.json

  • Cursor — ~/.cursor/mcp.json (create it if missing)

{
  "mcpServers": {
    "redash-mcp": {
      "command": "npx",
      "args": ["-y", "redash-mcp"],
      "env": {
        "REDASH_URL": "https://your-redash-instance.com",
        "REDASH_API_KEY": "your_api_key_here"
      }
    }
  }
}

Fully quit and restart Claude Desktop after saving.

Claude Code

claude mcp add --scope user redash-mcp \
  -e REDASH_URL=https://your-redash-instance.com \
  -e REDASH_API_KEY=your_api_key_here \
  -- npx -y redash-mcp

Gemini CLI

gemini mcp add -s user \
  -e REDASH_URL=https://your-redash-instance.com \
  -e REDASH_API_KEY=your_api_key_here \
  redash-mcp npx -y redash-mcp

Codex CLI

codex mcp add redash-mcp \
  --env REDASH_URL=https://your-redash-instance.com \
  --env REDASH_API_KEY=your_api_key_here \
  -- npx -y redash-mcp

Tools

Category

Tools

Data sources & schema

list_data_sources, list_tables, get_table_columns

Query

run_query — execute SQL and return results

Saved queries

list_queries, get_query, get_query_result (with parameter values), create_query, update_query, fork_query, archive_query

Charts

create_visualization — line / column / area / pie / scatter / counter

Dashboards

list_dashboards, get_dashboard, create_dashboard, add_widget (auto-layout)

Alerts

list_alerts, get_alert, create_alert

Smart Query (BIRD)

smart_query, get_bird_config, evaluate_queries, submit_query_feedback, manage_few_shot_examples, manage_keyword_map

SQL Safety Guard

Applies to ad-hoc SQL run through run_query. Saved queries executed with get_query_result are not checked, so give the Redash data source a read-only DB account.

  • Always blocked (unless REDASH_SAFETY_MODE=off): DROP, TRUNCATE, ALTER TABLE, GRANT/REVOKE, DELETE/UPDATE without WHERE

  • Warned (warn) / blocked (strict): SELECT *, queries without WHERE or LIMIT, PII column access

  • Auto-LIMIT: appends LIMIT N when REDASH_AUTO_LIMIT is set

Details: docs/sql-safety-guard.md. Query results are also cached in memory (see REDASH_MCP_CACHE_* below).

Environment Variables

Variable

Default

Description

REDASH_URL

required

Redash instance URL (e.g. https://redash.example.com)

REDASH_API_KEY

required

Redash user API key

REDASH_SAFETY_MODE

warn

SQL safety level: off / warn / strict

REDASH_SAFETY_DISABLE_PII

false

Disable PII detection

REDASH_SAFETY_DISABLE_COST

false

Disable cost warnings

REDASH_AUTO_LIMIT

0

Auto-append LIMIT N to queries without one (0 = off)

REDASH_DEFAULT_MAX_AGE

0

Redash cache TTL in seconds

REDASH_MCP_CACHE_TTL

300

MCP query cache TTL in seconds (0 = off)

REDASH_MCP_CACHE_MAX_MB

50

Max memory for the MCP query cache, in MB

REDASH_MCP_CONFIG_DIR

~/.redash-mcp

Where BIRD few-shot, feedback, eval, and keyword-map data live

REDASH_BIRD_ENABLED

true

false disables the BIRD smart query tools

REDASH_HTTP_TIMEOUT_SECS

30

Per-request HTTP timeout against the Redash API

ANTHROPIC_API_KEY

—

Enables the Claude Haiku fallback for table selection in smart_query

Usage Examples

Just ask in natural language:

  • "How many new users signed up this month?" → smart_query picks the tables → run_query

  • "What percentage of last week's new users made a purchase?" → smart_query guides the JOIN → run_query

  • "Create an alert when daily signups drop below 100" → create_alert

Build a dashboard: "Save a monthly revenue query, chart it as a line, and put it on a new Revenue dashboard."

  1. create_query — save "Monthly Revenue"

  2. get_query_result — run it once so the chart columns can be checked

  3. create_visualization — type: "line", x_column: "month", y_columns: ["revenue"]

  4. create_dashboard — create "Revenue"

  5. add_widget — place the chart; more widgets stack below or pair side by side

Troubleshooting

Symptom

Fix

npx not found (macOS GUI apps)

Run which npx and use the full path as command

"Authentication failed"

Check REDASH_API_KEY — it must be a user API key

"Unable to connect to the Redash server"

Check REDASH_URL (base URL with https://, without /api) and network/VPN

"The query timed out"

Simplify the query or pass a larger timeout_secs to run_query / get_query_result; raise REDASH_HTTP_TIMEOUT_SECS for slow API responses

Query blocked by the safety guard

Add WHERE/LIMIT; in strict mode, switch to REDASH_SAFETY_MODE=warn to get warnings instead

Tools don't show up

Fully restart the client after editing its config

Development

npm install
npm run dev     # run from source (tsx)
npm test        # vitest
npm run build   # typecheck + bundle to dist/

Privacy Policy

redash-mcp is a local MCP server that talks directly to your Redash instance. No intermediate servers are involved.

Item

Description

Redash API Key

Stored only as a local environment variable (REDASH_API_KEY). Never transmitted externally.

Query content & results

Delivered only to the local MCP client via the MCP protocol.

BIRD SQL settings

Stored only in local files (~/.redash-mcp/): few-shot examples, keyword maps, and feedback.

LLM Fallback

Only when ANTHROPIC_API_KEY is set, smart_query sends table names, column names, and the question text to the Anthropic API. Query results and row data are never transmitted.

We do not sell or share user data with third parties.

Retention: config files stay in ~/.redash-mcp/ until you delete them; the query cache is in-memory and cleared on shutdown; the schema cache is in-memory with a 10-minute TTL.

Contact: inquiries and security reports via GitHub Issues.

Disclaimer

redash-mcp is an unofficial, community-built integration and is not affiliated with, endorsed by, or sponsored by Redash. "Redash" is a trademark of its respective owners and is used here only to describe compatibility. This project communicates with Redash solely through its public REST API.

License

MIT

Available Tools

25 tools
add_widgetA
Destructive

Add a saved query's visualization onto a dashboard as a widget. Behavior: places the widget below the existing ones (half-width widgets pair up side by side) and returns its id and dashboard_id. Usage: get the dashboard_id from list_dashboards or create_dashboard, and the visualization_id from get_query (each saved query exposes its visualizations) or from create_visualization for a new chart. This is how you build up a dashboard after creating it.

Inputs: dashboard_id (required), visualization_id (required), text, width.

archive_queryA
Destructive

Archive a saved query, removing it from active query lists. This is Redash's form of deletion and cannot be undone through the API, so confirm with the user before calling it. Behavior: archives the query and returns a confirmation message. Usage: find the query_id with list_queries.

Inputs: query_id (required).

create_alertA
Destructive

Create an alert that watches a saved query and fires when a chosen result column crosses a threshold (e.g., daily_signups less than 10). Behavior: creates the alert and returns its id and name. Usage: get the query_id from list_queries and confirm the exact column name with get_query / get_query_result first. The alert evaluates the query's latest result on Redash's schedule.

Inputs: op (required), name (required), value (required), column (required), +2 more.

create_dashboardA
Destructive

Create a new, empty dashboard. Behavior: creates the dashboard and returns its id, name, and slug. Usage: after creating it, populate it with charts using add_widget, passing visualization ids obtained from get_query or create_visualization. To list or inspect existing dashboards instead, use list_dashboards / get_dashboard.

Inputs: name (required).

create_queryA
Destructive

Save a new named SQL query to Redash so it can be reused, scheduled, visualized, or added to a dashboard. Behavior: creates the query and returns its new id, name, and created_at. Usage: get the data_source_id from list_data_sources and verify the SQL runs with run_query first; to change an existing query use update_query instead. Note: this only saves the query — use get_query_result to execute it.

Inputs: name (required), query (required), data_source_id (required), tags, +1 more.

create_visualizationA
Destructive

Create a chart (line, column, area, pie, scatter) or counter on a saved query, so it can be shown in Redash and placed on a dashboard. Behavior: creates the visualization and returns its id. Usage: save the SQL with create_query first; column names must exactly match the query's result columns (run get_query_result to see them). Then call add_widget with the returned id to put the chart on a dashboard.

Inputs: name (required), type (required), query_id (required), y_columns (required), +4 more.

evaluate_queriesA

Build and run an accuracy test suite for SQL generation on a data source. Behavior: action 'add_test' stores a question paired with ground-truth SQL; 'list_tests' shows them; 'remove_test' deletes one; 'run' scores generated SQL against the test cases; 'results' shows the latest run. Usage: use this to measure whether keyword maps and few-shot examples actually improve smart_query accuracy over time; test cases and runs are stored locally per data_source_id.

Inputs: action (required), data_source_id (required), test_case, test_case_id, +2 more.

fork_queryA
Destructive

Fork (duplicate) an existing saved query into a new, independently editable copy, leaving the original unchanged. Behavior: creates the copy and returns its new id and name. Usage: find the query_id to fork with list_queries; use this when you want to experiment with or adapt a query without modifying the original.

Inputs: query_id (required).

get_alertA
Read-only

Get the full detail of a single alert. Behavior: returns the alert's id, name, current state, last_triggered_at, threshold options (column, operator, value), and the query it monitors (id, name, description, data_source_id). Usage: find the alert_id with list_alerts.

Inputs: alert_id (required).

get_bird_configA
Read-only

View BIRD SQL configuration and status.

Inputs: no named parameters.

get_dashboardA
Read-only

Get a dashboard's full layout. Behavior: returns the dashboard's id, name, slug, and every widget, each with its linked visualization (id, name, type) and the query behind it (id, name). Usage: find the dashboard id or slug with list_dashboards; use the returned visualization/query ids to understand or extend the dashboard with add_widget.

Inputs: dashboard_id_or_slug (required).

get_queryA
Read-only

Get the full definition of a saved query. Behavior: returns the query's SQL text, data_source_id, tags, owner, update time, its parameters (name, type, default value, dropdown options), and its visualizations (each with id, name, type). Usage: find the query_id with list_queries. The returned visualization ids can be placed on a dashboard with add_widget; to actually run the query use get_query_result.

Inputs: query_id (required).

get_query_resultA
Read-only

Run an existing saved query by its ID and return the latest results. Behavior: executes the query as stored in Redash and returns up to max_rows rows as a markdown table or JSON, with the column list and a truncation note. Usage: find the query_id with list_queries or get_query. If the query has parameters ({{ name }} placeholders), call get_query first to see their names, types, and allowed values, then pass every one in parameters — Redash does not fill in defaults for API calls. Unlike run_query, this executes already-saved SQL rather than ad-hoc SQL, so the safety guard does not apply.

Inputs: query_id (required), format, max_rows, parameters, +1 more.

get_table_columnsA
Read-only

Get the column names and data types for one or more tables in a data source. Accepts a single table or a comma-separated list of tables. Use this to confirm exact column names and types before writing SQL with run_query or smart_query. Returns each table's columns; if a table name is not found, it suggests verifying it with list_tables.

Inputs: table_name (required), data_source_id (required).

list_alertsA
Read-only

List all alerts configured in Redash. Behavior: returns an array where each alert has id, name, current state (ok / triggered / unknown), last_triggered_at, its linked query (id, name), and threshold options. Usage: use this to discover alert_ids, then call get_alert for one alert's full detail, or create_alert to add a new one.

Inputs: no named parameters.

list_dashboardsA
Read-only

List dashboards in Redash, most recently updated first. Behavior: returns a paginated array where each item has id, name, slug, and created/updated timestamps. Usage: use this to discover a dashboard's id or slug, then call get_dashboard to inspect its widgets and visualizations, or create_dashboard to make a new one. Supports keyword search and pagination.

Inputs: page, search, page_size.

list_data_sourcesA
Read-only

List connected data sources (id, name, type). Call this first to get data_source_id.

Inputs: no named parameters.

list_queriesA
Read-only

List saved (named) queries in Redash, most recently updated first. Behavior: returns a paginated array where each item has id, name, description, data_source_id, and updated_at. Usage: use this to discover query_ids, then call get_query for a query's full SQL and visualizations, or get_query_result to run it. Supports keyword search and pagination; for ad-hoc SQL that isn't saved, use run_query instead.

Inputs: page, search, page_size.

list_tablesA
Read-only

List tables in a data source. Use keyword to filter by name. Verify table names here before writing SQL.

Inputs: data_source_id (required), keyword.

manage_few_shot_examplesA

Manage the few-shot examples that smart_query uses to generate more accurate SQL. Behavior: action 'list' returns all stored examples with their ids; 'add' saves a new example (requires the example object); 'remove' deletes one (requires example_id). Each example pairs a natural-language question with the correct SQL and the tables it uses, teaching the model your schema's domain conventions. Usage: examples are stored locally per data_source_id and are retrieved automatically by smart_query — register a few for recurring question patterns to raise accuracy.

Inputs: action (required), data_source_id (required), example, example_id.

manage_keyword_mapA

Manage keyword-to-table-name mappings. After inspecting the schema with list_tables, register domain-specific mappings to improve smart_query table-matching accuracy. e.g., {"revenue": ["payment"], "creator": ["creator"]}

Inputs: action (required), data_source_id (required), keywords, mappings.

run_queryA
Read-only

Execute an ad-hoc SQL query against a data source and return the resulting rows. Every query passes through the SQL safety guard, which blocks destructive statements (DROP/TRUNCATE/ALTER, DELETE/UPDATE without WHERE) and flags PII columns and expensive full scans; results are cached in memory. Behavior: returns up to max_rows rows as a markdown table or JSON, with the column list and a truncation note when there are more rows. Usage: confirm table and column names with list_tables and get_table_columns first; for natural-language questions, plan the SQL with smart_query before calling this. To run an already-saved query instead, use get_query_result.

Inputs: query (required), data_source_id (required), format, max_age, +2 more.

smart_queryA
Read-only

BIRD SQL-based intelligent query tool. Analyzes natural-language questions to (1) extract relevant schema, (2) match similar few-shot examples, (3) assess complexity, (4) request clarification for ambiguous questions. Call this tool before run_query. For a new data source, first inspect the schema with list_tables, then register keyword-to-table mappings via manage_keyword_map to significantly improve accuracy. Note: when ANTHROPIC_API_KEY is set, table names, column names, and the question text (never query results or row data) may be sent to the Anthropic API as a fallback for table selection.

Inputs: question (required), data_source_id (required), context.

submit_query_feedbackA

Record whether the SQL produced for a question was correct, so smart_query improves over time. Behavior: stores an up/down rating; when you rate 'down' and supply the correct SQL, the error is classified and, if the same kind of mistake recurs, automatically promoted into a few-shot example. Returns the feedback id and any error type or promotion. Usage: call after reviewing smart_query/run_query output; feedback is stored locally per data_source_id and feeds the learning loop.

Inputs: rating (required), question (required), generated_sql (required), data_source_id (required), +1 more.

update_queryA
Destructive

Update fields of an existing saved query. Behavior: only the fields you pass are changed (name, SQL, description, or tags); any omitted field is left untouched. Returns the query's id, name, and updated_at. Usage: find the query_id with list_queries or get_query; to create a brand-new query instead, use create_query.

Inputs: query_id (required), name, tags, query, +1 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 25 tools

    Disambiguation4/5

    Core Redash operations are well separated by resource and action, and run_query vs get_query_result vs smart_query are explicitly differentiated in descriptions. The main ambiguity is the smart-query meta-tool cluster (few-shot examples, feedback, query evaluation, keyword maps, BIRD config), whose boundaries are related and could cause misselection.

    Naming Consistency4/5

    Almost all tools use consistent snake_case with a verb_noun pattern (list_queries, create_dashboard, get_alert, manage_keyword_map). Minor deviations are smart_query, which is not verb-led, and get_bird_config, but the overall convention remains predictable.

    Tool Count3/5

    At 25 tools this is at the heavy end for an MCP server and forces agents to choose among many related operations. The core Redash tools are reasonable, but the smart-query learning/evaluation/config tools inflate the surface and make the set feel borderline over-scoped.

    Completeness3/5

    The server covers important workflows: query discovery, execution, creation/update/fork/archive, dashboards/widgets, alerts, schema inspection, and ad-hoc SQL. However, notable lifecycle gaps remain, including no dashboard update/delete, no alert update/delete, no widget/visualization removal, and data sources are only listable.

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      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.
      67
      4,448 npm
      108
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      A database-agnostic MCP server that enables natural language queries to your database through Claude or Copilot, automatically writing and executing SQL.
      8
      5 npm
      MIT