# Apache Superset MCP for AI Agents MCP

> Apache Superset MCP connects your AI client directly to Apache Superset. Your agent can explore BI dashboards, retrieve chart data details, and run live SQL analytics straight from chat or code. It gives you deep access into complex business reports without ever leaving your development environment.

## Overview
- **Category:** brain-trust
- **Price:** Free
- **Tags:** data-visualization, sql-lab, dashboarding, data-exploration, business-insights

## Description

This connector gives your conversational AI direct access to enterprise Business Intelligence tools using Apache Superset. You don't have to click through endless menus; instead, your agent indexes your entire analytical setup—from high-level operational dashboards down to specific raw data tables. Need to see how revenue was calculated? Ask the AI client for dashboard details. Want to run a custom report? Execute SQL directly against your connected databases. It handles everything from listing all available reports to pulling granular metrics and aggregating business insights on demand. If you're using Vinkius, this MCP plugs into your existing catalog, making Superset analysis one of many powerful tools your agent can access.

## Tools

### execute_sql_query
Runs a specific SQL query against a selected database connection ID, returning the raw result set.

### get_chart_details
Pulls all metadata about how a single chart (or slice) is built, including its metrics and filters.

### get_dashboard_details
Retrieves the full structure of a dashboard, showing which charts are included and their overall purpose.

### list_charts
Provides an inventory of every chart or visualization available within your Superset environment.

### list_dashboards
Lists all user-facing dashboards, giving you a quick overview of the reporting surface area.

### list_databases
Displays a list of all active data source connections that Superset uses for its reports.

### list_datasets
Inventories every unique dataset available, helping you map out the entire analytical structure.

## Prompt Examples

**Prompt:** 
```
What's the revenue performance breakdown by product category this quarter?
```

**Response:** 
```
**Q3 Revenue Breakdown**

| Category | Total Sales | % of Revenue |
| :--- | :--- | :---: |
| Electronics | $1.2M | 45% |
| Apparel | $950K | 35% |
| Software | $410K | 15% |
| Home Goods | $620K | 25% |

*Note: Data pulled from the 'Main Sales DB' connection.*
```

**Prompt:** 
```
Show me the details for the 'User Funnel' dashboard and tell me which charts it uses.
```

**Response:** 
```
**Dashboard: User Funnel**

This dashboard tracks user journeys across four stages. It includes:
*   Chart 1: Registration Count (Metric: `new_users`)
*   Chart 2: First Login Rate (Source: `user_activity`)
*   Chart 3: Conversion Path Map (Type: Funnel Diagram)

All metrics are sourced from the 'Core Metrics' dataset.
```

**Prompt:** 
```
List all datasets and tell me which ones connect to Postgres.
```

**Response:** 
```
I found 12 available datasets. Here is a breakdown of their connections:
*   `sales_transactions`: PostgreSQL (Primary)
*   `user_activity`: Snowflake
*   `marketing_campaigns`: PostgreSQL (Secondary)
*   ... and so on.

The two key PostgreSQL sources are `sales_transactions` and `marketing_campaigns`.
```

## Capabilities

### List Available Reports
Shows a comprehensive list of all dashboards and charts currently built in Apache Superset.

### Get Dashboard Details
Retrieves the specific configuration, metrics, and underlying data for any given dashboard ID.

### List Data Sources
Identifies all connected database connections (like Postgres or MySQL) used by Superset.

### Run Custom SQL Queries
Executes specific, raw SQL statements against a chosen database connection ID to generate custom reports.

## Use Cases

### Validating a KPI in a live report
A Product Manager needs to confirm if 'Monthly Active Users' on the main dashboard is using the right definition. They ask their agent, and it uses `get_dashboard_details` followed by `list_charts` to pinpoint the exact underlying metric logic for validation.

### Deep-diving into quarterly revenue gaps
A Data Analyst suspects a data source issue. They use `list_databases` first, then run `execute_sql_query` on a specific connection to pull raw transaction logs and find the discrepancy manually.

### Inventorying all reporting capabilities
A new team member needs to know what reports exist. They prompt their agent to use `list_dashboards` and then `list_datasets` to get a full, categorized map of the entire BI portal.

### Checking for deprecated metrics
A Data Engineer suspects an old dataset is unused. They prompt their agent to use `list_datasets` and check which datasets are referenced by existing charts using `get_chart_details` to confirm if it's safe to retire.

## Benefits

- You can validate complex metrics instantly. Use `get_chart_details` to see exactly how a number was calculated, instead of just trusting the dashboard display.
- Audit your entire BI infrastructure without logging into Superset's UI. Running `list_dashboards` gives you an immediate inventory of what reports exist.
- Skip manual data extraction steps. With `execute_sql_query`, your agent runs raw SQL against production databases and returns the resulting table directly to chat.
- `list_databases` lets you audit all connected sources at a glance, which is critical for data engineers tracking connectivity changes.
- Understand dashboard relationships instantly. Calling `get_dashboard_details` shows you the parent-child relationship between charts without needing to click around.

## How It Works

The bottom line is that once configured, your AI client treats the entire BI portal like another API endpoint, allowing direct data interaction via conversation.

1. Append the Apache Superset MCP module into your agent's operational integrations panel.
2. Configure your AI client by providing the active `SUPERSET_BASE_URL` and a validated `SUPERSET_ACCESS_TOKEN`. This connection authenticates your session with Superset.
3. Ask your agent to perform an analytic task, such as: "List all dashboards and then run a query for Q3 sales figures."

## Frequently Asked Questions

**How does the Apache Superset MCP help me audit dashboard metrics?**
The MCP lets your agent retrieve granular details on any chart, showing you the exact metric and underlying data source used. You can trace a number back to its origin without needing manual UI navigation.

**Can I run custom reports using Apache Superset MCP for AI Agents?**
Yes. By executing raw SQL queries through the agent, you bypass the dashboard's built-in filters and write exactly what data you need directly against the connected databases.

**What if I need to know which dashboards are available right now?**
You can use the MCP to list all existing dashboards. This gives you an immediate, comprehensive inventory of every reporting surface built in your Superset instance.

**Is the Apache Superset MCP for AI Agents good for data engineering tasks?**
Absolutely. You can use it to audit database connections (`list_databases`) and inspect dataset metadata, helping you spot anomalies or confirm connectivity status quickly.

**Does this MCP support multiple data sources?**
Yes, the system manages and lists all connected databases. You can select any active connection ID to run your custom SQL query against a different data source.