Power Bi Analyst Mcp

by mbrummerstedt

447 downloads
Not rated
GitHub

About

Connect Claude to your Power BI semantic models. Browse workspaces, tables, and measures, run DAX queries, and get results — with large datasets automatically saved to local CSV files to protect the LLM context window. Includes a query history log for cross-session reuse and audi

Details

Author
mbrummerstedt
Downloads
447
Categories
Search

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Power Bi Analyst Mcp
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

You need an Azure AD app registration with Dataset.Read.All and Workspace.Read.All permissions. A 5-minute setup guide is available in the README. After configuration, run the server locally; the LLM can then invoke the provided tools to interact with your Power BI environment.

authenticate

Authenticate with Power BI using the OAuth 2.0 device code flow. Call this tool first if you have never logged in, or if a previous call returned "Not authenticated". The tool uses a two-step flow: - First call: returns a URL and a one-time code for you to open in a browser. - Second call: completes the authentication after you have signed in. Your credentials are cached locally so you will not need to repeat this step until the refresh token expires (~90 days).

logout

Sign out of Power BI by clearing the cached credentials. After logging out, call `authenticate` to sign in again.

list_workspaces

List all Power BI workspaces (groups) the authenticated user is a member of. Returns workspace id, name, type, and capacity information. Use the `id` field as `workspace_id` in subsequent tools.

list_datasets

List all datasets (semantic models) in a Power BI workspace. Returns dataset id, name, configured-by, web URL, is-refreshable flag, and the target storage mode (Import / DirectQuery / etc.). Use the `id` field as `dataset_id` in subsequent tools.

get_dataset_info

Return detailed metadata for a single Power BI dataset. Includes name, owner, refresh schedule, storage mode, web URL, and more. Also returns the last 5 refresh history entries so you can see data freshness.

list_tables

List all visible tables in a Power BI dataset. Hidden tables and internal Power BI system tables (names starting with '$') are excluded. Use the returned table names in `list_measures`, `list_columns`, and DAX queries.

list_measures

List measures defined in a Power BI dataset. Returns each measure's name, parent table, description, and format string. Optionally filter by table name.

list_columns

List columns (dimensions) in a Power BI dataset. Returns each column's name, parent table, description, data type, and whether it is a key column. Optionally filter by table name.

execute_dax

Execute a DAX query against a Power BI dataset and return the result rows. The query must start with EVALUATE (standard DAX query syntax). Results are returned as a JSON array of objects, with column names as keys. Small results (<= 50 rows) are returned inline as JSON. Large results (> 50 rows) are automatically saved to a CSV file and a compact summary is returned with the file path, column names, row count, and a preview of the first 5 rows. Use `read_query_result` to page through a saved CSV, or read the file directly. Every successful execution is logged to a local history file for auditability and cross-session reuse. Use `search_query_history` to find prior queries. The `query_summary` parameter makes history search much more effective — always provide it when you can. Limitations imposed by the Power BI API: - Maximum 1,000,000 values or 100,000 rows per query. - Rate limit: 120 requests per minute per user. - Only DAX is supported; MDX and DMV queries are not. - The tenant setting "Dataset Execute Queries REST API" must be enabled. Tips: - Use TOPN or FILTER to limit large result sets. - Use SUMMARIZECOLUMNS for aggregated queries. - Use CALCULATETABLE for filtered table expressions. - Use max_rows to sample a large table without rewriting the DAX. - Use result_name to give the saved CSV a meaningful filename.

read_query_result

Read a page of rows from a CSV file saved by `execute_dax`. Use this tool when `execute_dax` returns a `savedTo` path instead of inline rows. Combine `offset` and `limit` to page through large results without loading the entire file into context. Returns rows for the requested slice together with pagination metadata: - totalRows: total number of rows in the file - offset: the offset used - limit: the limit used - hasMore: whether more rows exist after this page Example workflow: 1. Call `execute_dax` — if rows > 50 you get a savedTo path. 2. Call `read_query_result(file_path=savedTo, offset=0, limit=100)`. 3. If hasMore is true, call again with offset=100, then 200, etc.

search_query_history

Search the local query history log for prior DAX executions. Every successful `execute_dax` call is logged with the DAX query, a short summary of what the user asked for, the result shape, and the path to any saved CSV file. Use this tool to: - Find previous queries for a dataset so you can reuse or adapt the DAX - Locate saved CSV files from earlier sessions - Audit what data has been pulled and when - Avoid re-running expensive queries when the data already exists locally Results are returned newest-first. Use `keyword` to search by intent (e.g. "revenue by market") — it matches against the query summary, the DAX text, and the result name.

delete_query_log_entry

Remove a single entry from the query history log. Use this when a query produced incorrect or misleading results and should not appear in future history searches. The associated CSV file (if any) is NOT deleted — only the log entry is removed.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "power bi analyst mcp": {
            "powerbi": {
                "command": "uvx",
                "args": [
                    "powerbi-analyst-mcp"
                ],
                "env": {
                    "POWERBI_CLIENT_ID": "<YOUR_CLIENT_ID>",
                    "POWERBI_TENANT_ID": "<YOUR_TENANT_ID>"
                }
            }
        }
    }
}

McpServers

{
    "powerbi": {
        "command": "uvx",
        "args": [
            "powerbi-analyst-mcp"
        ],
        "env": {
            "POWERBI_CLIENT_ID": "<YOUR_CLIENT_ID>",
            "POWERBI_TENANT_ID": "<YOUR_TENANT_ID>"
        }
    }
}

What it does

Ask your LLM to analyse Power BI data. The server connects to Power BI's REST API via OAuth device code flow, lets the agent explore your semantic models, and execute DAX queries — all running locally on your machine.

Key features

- 12 tools — authenticate, browse workspaces/datasets/tables/measures/columns, execute DAX, page through results, search query history, delete log entries - Large result handling — queries returning >50 rows are auto-saved to a local CSV; the agent gets a compact summary and pages on demand - Query history — every DAX execution is logged to a JSONL file with the user's intent, DAX, columns, and CSV path — searchable across sessions - Secure — runs locally, tokens stored in OS-native secure storage (Keychain/DPAPI/LibSecret), no cloud relay

Quick start

Requires an Azure AD app registration with Dataset.Read.All and Workspace.Read.All permissions. See the README for a 5-minute setup guide.
No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.