# Mode Analytics MCP

> Mode Analytics connects your AI agent directly to your data workspace. List spaces, retrieve report metadata, audit underlying SQL queries, and trigger fresh report runs using nothing but natural conversation.

## Overview
- **Category:** brain-trust
- **Price:** Free
- **Tags:** sql-analytics, data-visualization, collaborative-data, python-notebooks, data-science, report-automation

## Description

This MCP gives your AI client full access to the logic behind your business intelligence reports. Instead of logging into Mode Analytics and navigating through menus, you talk to your agent, and it handles the data retrieval process for you. You can ask for a list of all available spaces or find out which metrics are defined by checking calculated field definitions. If a campaign needs updated figures, you simply trigger a new report run without ever touching the web interface. When working with complex enterprise data—the kind that lives in systems like this—connecting through Vinkius makes sure your agent can talk to dozens of services at once. It lets you maintain full control over your data science workflows right from your chat window.

## Tools

### run_mode_report
Starts a new calculation run for a specified report.

### get_mode_account
Retrieves basic authenticated account details for verification purposes.

### get_mode_report_run
Gets the detailed status and history of a specific report execution.

### get_mode_report
Fetches general metadata for a particular report.

### list_mode_definitions
Lists all defined calculated fields used across the workspace metrics.

### list_mode_members
Retrieves a list of all users who belong to the Mode Analytics workspace.

### list_mode_queries
Shows the raw underlying SQL query used within a report.

### list_mode_report_runs
Lists all historical runs for a single given report.

### list_mode_reports
Displays a list of reports available within a specific space.

### list_mode_spaces
Lists all separate analytical workspaces (spaces) in the account.

## Prompt Examples

**Prompt:** 
```
List all reports in the 'Marketing Analytics' space.
```

**Response:** 
```
I've retrieved 8 reports from the 'Marketing Analytics' space, including 'Campaign ROI', 'Leads by Channel', and 'Monthly Web Traffic'.
```

**Prompt:** 
```
Run the report with token 'rep_12345' and check its latest status.
```

**Response:** 
```
Report run has been triggered. Status is currently 'enqueued'. I'll check back in a moment to see if it has completed.
```

**Prompt:** 
```
Show me the SQL query used in the 'Churn Analysis' report.
```

**Response:** 
```
I've fetched the queries for that report. It uses a SELECT statement from the 'events' table joined with 'subscriptions' to calculate monthly churn rates.
```

## Capabilities

### Discovering Data Assets
List all available spaces, members, and reports across the entire analytical workspace.

### Auditing Report Logic
View the underlying SQL code or check calculated field definitions to understand exactly how a metric is derived.

### Executing Data Jobs
Trigger new report runs for specific reports, passing in custom parameters when needed.

## Use Cases

### Needing to verify a KPI's source data
A junior analyst spots a questionable number on a dashboard. Instead of emailing the BI team, they ask their agent, 'Show me the SQL query for the Monthly Web Traffic report.' The agent uses `list_mode_queries` and instantly provides the underlying SELECT statement, allowing them to verify data lineage immediately.

### Running a time-sensitive campaign check
The Growth Team launches a new ad set at 3 PM. They ask their agent, 'Run the Leads by Channel report now.' The agent uses `run_mode_report`, and they receive an immediate status update, allowing them to monitor performance without waiting for a manual dashboard refresh.

### Mapping out data ownership in a new department
A BI Manager needs to see who has access to the Sales space. They prompt their agent, 'Who are the members of the Marketing Analytics workspace?' The agent uses `list_mode_members` and returns an accurate list of authorized users.

### Checking if a report run completed overnight
The team wakes up to check yesterday's reports. Instead of logging in, they ask their agent about the run status. The agent uses `list_mode_report_runs` and provides details for the specific report execution.

## Benefits

- Stop context switching. Instead of jumping between a BI dashboard and a code editor to check status, you ask your agent directly: 'What's the status of the Campaign ROI report run?'
- Audit data logic instantly. You can use the `list_mode_queries` tool to see the exact SQL statement powering any metric, eliminating guesswork about where the numbers come from.
- Automate updates without manual clicks. When a campaign shifts strategy, you don't manually re-run dashboards; your agent calls `run_mode_report` and gets confirmation when it's finished.
- Maintain governance visibility. Use `list_mode_spaces` or `list_mode_members` to quickly map out who owns which segment of the data without navigating internal organizational charts.
- Understand every metric. The `list_mode_definitions` tool shows you all calculated fields, ensuring everyone uses the exact same formula for key KPIs.

## How It Works

The bottom line is that your AI client becomes an immediate command line for your entire data intelligence stack.

1. First, you subscribe to this MCP via Vinkius and provide your Mode API Token, API Secret, and workspace slug.
2. Next, you prompt your AI agent with a question—for example, 'List all reports in the Marketing space' or 'Run the campaign ROI report'.
3. Finally, your agent uses the tools to talk directly to Mode Analytics, retrieves the required data or status, and gives you a clear answer.

## Frequently Asked Questions

**How does Mode Analytics MCP list available workspaces?**
You can use the `list_mode_spaces` tool to see all distinct spaces in your account. This lets you quickly identify which area of data belongs to which business unit.

**Can I check what SQL query a report uses with Mode Analytics MCP?**
Yes, use the `list_mode_queries` tool. It retrieves the raw underlying SELECT statement for any given report, letting you audit data logic immediately.

**Is running reports via Mode Analytics MCP different from manual runs?**
No. The agent uses the `run_mode_report` tool to trigger an exact replica of a manual run. It handles passing all necessary custom parameters so your report executes precisely as expected.

**What if I need to know who has access to my data in Mode Analytics?**
You can use `list_mode_members` to get a complete list of every user currently associated with the workspace, helping you manage permissions efficiently.