Skip to main content
Version: Next

Using AI with Superset

Superset supports AI assistants through the Model Context Protocol (MCP). Connect Claude, ChatGPT, or other MCP-compatible clients to explore your data, build charts, create dashboards, and run SQL -- all through natural language.

info

Requires Superset 5.0+. Your admin must enable and deploy the MCP server before you can connect. See the MCP Server admin guide for setup instructions.


What Can AI Do with Superset?

Explore Your Data

Ask your AI assistant to browse what's available in your Superset instance:

  • List datasets -- see all datasets you have access to, with filtering and search
  • Get dataset details -- column names, types, available metrics, and filters
  • List charts and dashboards -- find existing visualizations by name or keyword
  • Get chart and dashboard details -- understand what a chart shows, its query, and configuration

Example prompts:

"What datasets are available?" "Show me the columns in the sales_orders dataset" "Find dashboards related to revenue"

Build Charts

Describe the visualization you want and AI creates it for you:

  • Create charts from natural language -- describe what you want to see and AI picks the right chart type, metrics, and dimensions
  • Preview before saving -- AI generates a preview so you can review before committing
  • Modify existing charts -- update filters, change chart types, add metrics
  • Get Explore links -- open any chart in Superset's Explore view for further refinement

Example prompts:

"Create a bar chart showing monthly revenue by region from the sales dataset" "Update chart 42 to use a line chart instead" "Give me a link to explore this chart further"

Create Dashboards

Build dashboards from a collection of charts:

  • Generate dashboards -- create a new dashboard with a set of charts, automatically laid out
  • Add charts to existing dashboards -- place a chart on an existing dashboard with automatic positioning

Example prompts:

"Create a dashboard called 'Q4 Sales Overview' with charts 10, 15, and 22" "Add the revenue trend chart to the executive dashboard"

Run SQL Queries

Execute SQL directly through your AI assistant:

  • Run queries -- execute SQL with full Superset RBAC enforcement (you can only query data your roles allow)
  • Open SQL Lab -- get a link to SQL Lab pre-populated with a query, ready to run and explore

Example prompts:

"Run this query: SELECT region, SUM(revenue) FROM sales GROUP BY region" "Open SQL Lab with a query to show the top 10 customers by order count"

Analyze Chart Data

Pull the raw data behind any chart:

  • Get chart data -- retrieve the data a chart displays, with support for JSON, CSV, and Excel export formats
  • Inspect results -- useful for verifying what a visualization shows or feeding data into other tools

Example prompts:

"Get the data behind chart 42" "Export chart 15 data as CSV"

Check Instance Status

  • Health check -- verify your Superset instance is up and the MCP connection is working
  • Instance info -- get high-level statistics about your Superset instance (number of datasets, charts, dashboards)

Example prompts:

"Is Superset healthy?" "How many dashboards are in this instance?"


Connecting Your AI Client

Once your admin has deployed the MCP server, connect your AI client using the instructions below.

Claude Desktop

Edit your Claude Desktop config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"superset": {
"url": "http://localhost:5008/mcp"
}
}
}

Restart Claude Desktop. The hammer icon in the chat bar confirms the connection.

If your admin has enabled JWT authentication, you may need to include a token:

{
"mcpServers": {
"superset": {
"command": "npx",
"args": [
"-y",
"mcp-remote@latest",
"http://your-superset-host:5008/mcp",
"--header",
"Authorization: Bearer YOUR_TOKEN"
]
}
}
}

Claude Code (CLI)

Add to your project's .mcp.json:

{
"mcpServers": {
"superset": {
"type": "url",
"url": "http://localhost:5008/mcp"
}
}
}

ChatGPT

  1. Click your profile icon > Settings > Apps and Connectors
  2. Enable Developer Mode in Advanced Settings
  3. In the chat composer, press + > Add sources > App > Connect more > Create app
  4. Enter a name and your MCP server URL
  5. Click I understand and continue
info

ChatGPT MCP connectors require a Pro, Team, Enterprise, or Edu plan.

Ask your admin for the MCP server URL and any authentication tokens you need.


Tips for Best Results

  • Be specific -- "Create a bar chart of monthly revenue by region from the sales dataset" works better than "Make me a chart"
  • Start with exploration -- ask what datasets and charts exist before creating new ones
  • Review AI-generated content -- always check chart configurations and SQL before saving or sharing
  • Use Explore for refinement -- ask AI for an Explore link, then fine-tune interactively in the Superset UI
  • Check permissions if you get errors -- AI respects Superset's RBAC, so you can only access data your roles allow

Available Tools Reference

ToolDescription
health_checkVerify the MCP server is running and connected
get_instance_infoGet instance statistics (dataset, chart, dashboard counts)
get_schemaDiscover available charts, datasets, and dashboards with schema info
list_datasetsList datasets with filtering and search
get_dataset_infoGet dataset metadata (columns, metrics, filters)
list_chartsList charts with filtering and search
get_chart_infoGet chart metadata and configuration
get_chart_dataRetrieve chart data (JSON, CSV, or Excel)
get_chart_previewGenerate a chart preview (URL, ASCII, table, or Vega-Lite)
generate_chartCreate a new chart from a specification
update_chartModify an existing chart's configuration
update_chart_previewUpdate a cached chart preview without saving
list_dashboardsList dashboards with filtering and search
get_dashboard_infoGet dashboard metadata and layout
generate_dashboardCreate a new dashboard with specified charts
add_chart_to_existing_dashboardAdd a chart to an existing dashboard
execute_sqlRun a SQL query with RBAC enforcement
open_sql_lab_with_contextOpen SQL Lab with a pre-populated query
generate_explore_linkGenerate an Explore URL for interactive visualization

Troubleshooting

"Connection refused" or "Cannot connect"

  • Confirm the MCP server URL with your admin
  • For Claude Desktop: fully quit the app (not just close the window) and restart after config changes
  • Check that the URL path ends with /mcp (e.g., http://localhost:5008/mcp)

"Permission denied" or missing data

  • Superset's RBAC controls what you can access through AI, just like in the Superset UI
  • Ask your admin to verify your roles and permissions
  • Try accessing the same data through the Superset web UI to confirm your access

"Response too large"

  • Ask for smaller result sets: use filters, reduce page_size, or request specific columns
  • Example: "Show me the top 10 rows from the sales dataset" instead of "Show me all sales data"

AI doesn't see Superset tools

  • Verify the connection in your AI client (e.g., the hammer icon in Claude Desktop)
  • Ask the AI "What Superset tools are available?" to confirm the connection
  • Restart your AI client if you recently changed the configuration