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:

  • Preview-first workflow -- by default AI generates an Explore link so you can review the chart before it is saved. Say "save it" to commit permanently
  • Create charts from natural language -- describe what you want to see and AI picks the right chart type, metrics, and dimensions
  • Preview before saving -- generate_chart defaults to save_chart=False, showing the chart in Explore before it's committed. Ask AI to save once you're satisfied.
  • Modify existing charts -- update_chart also supports preview mode so you can review changes before saving (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"

Preview-first workflow

Charts are not saved by default. The workflow is intentionally iterative:

  1. Explore — AI generates an Explore link so you can see the chart before it exists in Superset
  2. Iterate — ask the AI to adjust the chart; changes are previewed without touching the database
  3. Save — when you're happy, say "save it" and the chart is permanently stored

To skip the preview and save immediately, include "and save it" in your prompt.

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"

Browse Databases​

Discover what database connections are configured in your Superset instance:

  • List databases -- see all database connections you have access to
  • Get database details -- name, backend type (PostgreSQL, Snowflake, etc.), and connection status

Example prompts:

"What databases are connected to Superset?" "Show me details about the data warehouse connection"

Create Virtual Datasets​

Build ad-hoc SQL datasets that can be used as the basis for charts:

  • Create virtual datasets -- write a SQL query and save it as a reusable dataset
  • Use immediately in charts -- the returned dataset ID can be passed directly to chart creation

Example prompts:

"Create a dataset from: SELECT region, SUM(revenue) as total_revenue FROM orders GROUP BY region" "Make a virtual dataset called 'monthly_signups' from the users table filtered to last 12 months"

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
  • Save queries -- save a SQL query to SQL Lab's Saved Queries for later reuse

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" "Save this query as 'Weekly Revenue Report'"

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​

Exploration & Discovery​

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

Datasets​

ToolDescription
list_datasetsList datasets with filtering and search
get_dataset_infoGet dataset metadata (columns, metrics, filters)
create_virtual_datasetCreate a virtual dataset from a SQL query

Charts​

ToolDescription
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)
get_chart_type_schemaGet the configuration schema for a chart type
generate_chartCreate a new chart from a specification (defaults to preview mode — review before saving)
update_chartModify an existing chart's configuration (pass generate_preview=False to persist immediately instead of returning a preview URL)
update_chart_previewUpdate a cached chart preview without saving
generate_explore_linkGenerate an Explore URL for interactive visualization

Dashboards​

ToolDescription
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

SQL​

ToolDescription
execute_sqlRun a SQL query with RBAC enforcement
save_sql_queryPersist a SQL query to SQL Lab's saved queries
open_sql_lab_with_contextOpen SQL Lab with a pre-populated query

Databases​

ToolDescription
list_databasesList configured database connections
get_database_infoGet details about a specific database connection

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