Power Bi MCP logo

Power Bi MCP

by FreelexHo

Manage Power BI workspaces, datasets, refreshes, diagnostics, PBIP sources, and DAX queries through MCP.

Install Power Bi MCP

Run the project’s own setup commands, in order.

Setup steps from the project

FreelexHo/power-bi-mcp installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    git clone https://github.com/FreelexHo/power-bi-mcp.git && cd power-bi-mcp
    
  2. 2. Install
    uv venv && uv sync
    
  3. 3. Install
    pip install -e .
    
  4. 4. Run
    ./setup.ps1
    

Overview

FreelexHo/power-bi-mcp MCP server lets AI agents manage Power BI workspaces, datasets, refresh operations, and reports through natural-language tool calls. It authenticates with Azure AD device code flow, caches tokens locally, and communicates with Power BI through a stdio MCP process. Tools cover workspace discovery, dataset metadata, enhanced refresh polling, refresh diagnostics, DAX execution with RLS impersonation, and PBIP source lookup. Use it when an agent needs to inspect or operate Power BI assets and, optionally, correlate datasets with local PBIP files.

Use cases

  • List accessible Power BI workspaces and datasets
  • Trigger and monitor enhanced dataset refreshes
  • Diagnose failed refreshes and find next actions
  • Run DAX queries with RLS impersonation
  • Generate scheduled-refresh status reports

Key features

  • Azure AD device code authentication with token caching
  • Workspace and dataset discovery
  • Enhanced refresh with polling, retry, and timeout
  • Refresh diagnostics with error classification
  • DAX execution with RLS impersonation
  • PBIP source locating and scheduled-refresh reports

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

25/25 checks healthy over the last 113d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars2Stargazers on the source repository.
Last commit1mo agoMost recent push to the default branch.
Directory activity4 viewsConfig copies, upvotes, and views on AllMCPs.

How Power Bi MCP works

What FreelexHo/power-bi-mcp MCP server does

FreelexHo/power-bi-mcp MCP server exposes Power BI administration, refresh, diagnostic, query, and reporting operations as MCP tools. It is intended for agents that need to work with Power BI workspaces and datasets without requiring each operation to be performed manually in the Power BI interface.

The server can list accessible workspaces and datasets, collect combined dataset information, start and monitor refreshes, inspect refresh history, and cancel refresh operations. It also supports DAX queries against a dataset, including optional row-level security impersonation. When a local PBIP repository is configured, the server can locate related source folders and extract table TMDL or M source details where supported.

How it works

The process runs through the stdio transport using FastMCP. Tool modules are registered by the application, while HTTP requests to Azure AD and Power BI use httpx. Authentication uses Azure AD device code flow. On first use, an agent calls pbi_auth; the user opens the Microsoft device-login page, enters the displayed code, and completes sign-in and any required consent or MFA steps.

Tokens are cached under the configured token-cache directory and refreshed automatically when possible. The default application uses a built-in public client ID. Organizations that restrict public client flows can create a separate Azure AD App Registration with the included PowerShell setup script.

Refresh operations include enhanced behavior such as table-level refresh options, polling, retry handling, and timeouts. pbi_diagnose classifies refresh failures using an error catalog and returns suggested next actions. The scheduled refresh tool produces a daily status report for all datasets in a workspace as JSON or a Markdown table.

Setup and configuration

To install FreelexHo/power-bi-mcp MCP server, clone the repository and install its Python dependencies with uv venv and uv sync, or create a virtual environment and run pip install -e .. Python 3.10 or newer is required.

Register the server in an MCP client with a stdio entry that runs uv run --directory /path/to/power-bi-mcp server.py. The README provides configuration examples for Cursor and Windsurf. After registration, call pbi_auth to complete the one-time device login.

Optional settings are stored in a project-root config.json file:

  • client_id: Azure AD App Registration client ID; the built-in public client is used by default.
  • token_cache_dir: location for cached OAuth tokens; defaults to ~/.powerbi-mcp.
  • pbip_root: local PBIP repository root. Setting this enables PBIP location and source-level diagnostic hints.

The included setup.ps1 script can create an App Registration through Azure CLI. It requires Azure CLI and permission to create App Registrations.

Tools and capabilities

  • pbi_auth: authenticate with Azure AD device code flow.
  • pbi_list_workspaces and pbi_list_datasets: discover accessible Power BI resources.
  • pbi_dataset_info: return dataset metadata, data sources, gateways, refresh schedule, impacted reports, and PBIP location information.
  • pbi_refresh_dataset: start an enhanced dataset refresh.
  • pbi_refresh_manage: view refresh history, inspect execution details, or cancel a refresh.
  • pbi_diagnose and pbi_locate_pbip: investigate refresh errors and find related PBIP source files.
  • pbi_execute_query: run DAX queries, with RLS impersonation support.
  • pbi_scheduled_refresh_report: create workspace-wide scheduled-refresh reports in JSON or Markdown.

Limitations and notes

Power BI access depends on the signed-in account's permissions and the tenant's consent policies. A tenant may require administrator consent for the requested delegated permissions, and some organizations may disable public client authentication. Refresh detail requests can return 403 when permissions are insufficient or the refresh record has expired.

PBIP source features require a locally configured pbip_root; they do not locate source code without that repository path. The server communicates over stdio and is documented for Python 3.10 or newer. Concurrent instances should not share a token cache carelessly, because multiple processes may overwrite cached tokens.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Power Bi MCP

FreelexHo/power-bi-mcp is an MCP server that connects AI agents to Power BI workspaces and datasets through Azure AD authentication and the Power BI APIs. Its main tools list resources, manage and diagnose refreshes, execute DAX queries with RLS impersonation, locate PBIP sources, and generate scheduled-refresh reports.

Install it by cloning the repository, creating a Python 3.10-or-newer environment, and running either `uv sync` or `pip install -e .`. Register `server.py` as a stdio MCP server, using the provided `uv run --directory` command pattern.

Authenticate by calling `pbi_auth` and completing the Azure AD device code flow in a browser. Enter the displayed code at the Microsoft device-login URL, sign in with a work account, and approve permissions. Tokens are then cached locally and refreshed automatically when possible.

Yes, FreelexHo/power-bi-mcp can be registered in Cursor through an `mcp.json` stdio configuration. The documented entry runs `uv run --directory /path/to/power-bi-mcp server.py`; Windsurf is also named as a supported configuration target.

Yes, `pbi_diagnose` produces a refresh-failure report with root-cause classification, error-catalog information, next actions, and optional PBIP source hints. Source-level hints require the `pbip_root` setting to point to a local PBIP repository.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewPower Bi MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/freelexho-power-bi-mcp?style=directory)](https://allmcps.com/mcp/freelexho-power-bi-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/freelexho-power-bi-mcp"><img src="https://allmcps.com/api/badge/freelexho-power-bi-mcp?style=directory" alt="Power Bi MCP on AllMCPs" /></a>