# FreelexHo/power-bi-mcp [Health: Active]

**Category:** 📊 Data Visualization  
**Repository:** https://github.com/FreelexHo/power-bi-mcp  
**GitHub Stars:** 2  
**Views:** 4  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/freelexho-power-bi-mcp

## Description
Power BI MCP server with device code auth, enhanced refresh (table-level polling with retry), refresh diagnostics with root-cause error catalog, DAX queries with RLS simulation, PBIP source locating, and scheduled refresh reports.

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/FreelexHo/power-bi-mcp), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
git clone https://github.com/FreelexHo/power-bi-mcp.git && cd power-bi-mcp
```

2. Install:

```sh
uv venv && uv sync
```

3. Install:

```sh
pip install -e .
```

4. Run:

```sh
./setup.ps1
```

## Documentation

## 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.

_Full upstream README: https://allmcps.com/mcp/freelexho-power-bi-mcp/readme_

