powerbi-mcp-server

mcp
Security Audit
Fail
Health Warn
  • No license — Repository has no license file
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Low visibility — Only 5 GitHub stars
Code Fail
  • Hardcoded secret — Potential hardcoded credential in tests/conftest.py
Permissions Pass
  • Permissions — No dangerous permissions requested
Purpose

This tool is an MCP server that integrates the Power BI REST API with GenAI applications like Claude Desktop. It allows AI models to list workspaces, datasets, and reports, execute DAX queries, and trigger data refreshes directly within Power BI.

Security Assessment

The server makes external network requests to the Power BI REST API using an Azure AD OAuth2 client credentials flow. This inherently involves accessing sensitive business data and analytics. The code does not execute shell commands and requests no dangerous local permissions. However, the scan raised a critical flag by failing a hardcoded secret check in the `tests/conftest.py` file. Even if this credential is only used for testing, leaving secrets in the source code is a significant security risk that could lead to data leaks if the repository is public or forked. Overall risk is rated as High due to the combination of accessing sensitive data and poor secret hygiene.

Quality Assessment

The project is actively maintained, with its most recent push occurring today. It is written in Python, uses typed async methods, and features a full test suite with mocked HTTP calls. On the downside, it has very low community visibility, with only 5 stars. More importantly, the repository lacks a proper license file, meaning there are no clear legal terms granting you the right to use, modify, or distribute the code.

Verdict

Not recommended due to hardcoded secrets, missing licensing, and high-risk access to sensitive business analytics.
SUMMARY

MCP server for Power BI - Business analytics and data visualization

README.md

Power BI MCP Server

Powerbi Mcp Server

GitHub stars
GitHub forks
GitHub watchers

License
Issues
Pull Requests
Last Commit

Python
MCP

A Model Context Protocol (MCP) server for integrating the Power BI REST API
with GenAI applications such as Claude Desktop.

Features

  • FastMCP-based server targeting MCP SDK >=1.27 (protocol revision 2025-11-25).
  • Azure AD OAuth2 authentication (client credentials flow) with token caching
    and automatic refresh on 401 Unauthorized.
  • Typed async httpx client with typed exception hierarchy
    (PowerBIError, AuthenticationError, APIError, NotFoundError).
  • Full test suite using pytest-httpx for deterministic HTTP mocking.

Tool catalogue

Tool Description
list_workspaces List all Power BI workspaces (groups) visible to the service principal.
list_datasets(workspace_id?) List datasets in a workspace or across My Workspace.
list_reports(workspace_id?) List reports in a workspace or across My Workspace.
list_dashboards(workspace_id?) List dashboards in a workspace or across My Workspace.
refresh_dataset(dataset_id, workspace_id?, notify_option?) Trigger an on-demand dataset refresh.
get_dataset_refresh_history(dataset_id, workspace_id?, top?) Return the refresh history entries for a dataset.
execute_dax_query(dataset_id, query, workspace_id?) Run a DAX EVALUATE ... query against a dataset.
export_report(report_id, format, workspace_id?) Start an export job for a report (PDF, PPTX, PNG, etc.).

Installation

git clone https://github.com/LokiMCPUniverse/powerbi-mcp-server.git
cd powerbi-mcp-server
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Configuration

Set the following environment variables (or put them in a local .env file):

Variable Required Description
POWERBI_TENANT_ID yes (client creds) Azure AD tenant ID.
POWERBI_CLIENT_ID yes (client creds) Azure AD application ID.
POWERBI_CLIENT_SECRET yes (client creds) Azure AD application secret.
POWERBI_ACCESS_TOKEN optional Pre-minted bearer token; bypasses OAuth flow.
POWERBI_API_BASE optional Override API base (default https://api.powerbi.com/v1.0/myorg).
POWERBI_TIMEOUT optional HTTP timeout in seconds (default 30).

The Azure AD application must be granted the Power BI service scope
https://analysis.windows.net/powerbi/api/.default and added as a
member/admin to any workspaces it needs to read from.

Running

powerbi-mcp

This starts the MCP server on stdio.

Claude Desktop config

Add the following entry to your Claude Desktop claude_desktop_config.json:

{
  "mcpServers": {
    "powerbi": {
      "command": "powerbi-mcp",
      "env": {
        "POWERBI_TENANT_ID": "<tenant-guid>",
        "POWERBI_CLIENT_ID": "<client-guid>",
        "POWERBI_CLIENT_SECRET": "<client-secret>"
      }
    }
  }
}

Development

pip install -e ".[dev]"
pytest -x --tb=short
ruff check src/ tests/

License

MIT License - see LICENSE file for details.

Reviews (0)

No results found