powerbi
MCP server from pkduongsu/powerbi-mcp-server
claude mcp add --transport stdio pkduongsu-powerbi-mcp-server python powerbi_server.py \ --env POWERBI_CLIENT_ID="your-client-id" \ --env POWERBI_TENANT_ID="your-tenant-id" \ --env POWERBI_CLIENT_SECRET="your-client-secret"
How to use
This MCP server provides programmatic access to the PowerBI REST API through a suite of tools for data cleaning, transformation, analysis, and visualization within Power BI. It exposes capabilities to list workspaces, datasets, and reports; fetch dataset schemas and metadata; perform DAX-based queries and calculated measures; refresh datasets; analyze data quality; and generate visualization-ready data and reports. Use the provided prompts and tools to guide data cleaning, dashboard design, and optimization tasks, and leverage the analysis prompts for insights and best-practice recommendations throughout your Power BI workflows.
To interact with the server, authenticate using OAuth 2.0 via the registered Azure app and rely on the built-in tooling to navigate workspaces, datasets, and reports. Tools like get_workspaces, get_datasets, get_dataset, analyze_data_quality, generate_visualization_suggestions, create_dax_for_visualization, and create_report enable end-to-end data preparation and visualization workflows. For example, you can analyze a dataset’s quality, generate suggested visualizations, then create a report and export chart data for external visualization tools. Respect the required permissions (Dataset.Read.All, Dataset.ReadWrite.All, Report.Read.All, Report.ReadWrite.All, Workspace.Read.All) when operating against your Power BI tenant.
How to install
Prerequisites:
- Python 3.8+ (recommended) and pip
- Access to a Power BI tenant with adequate permissions
- Azure AD app registration with Power BI API permissions and client secret
Installation steps:
- Clone the repository (or obtain the server files)
# Clone the repository
git clone <repository-url>
cd powerbi-mcp-server
- Install Python dependencies (via pip)
pip install mcp[cli] httpx pandas openpyxl
Alternative (using uv for Python):
uv add "mcp[cli]" httpx pandas openpyxl
- Ensure environment variables are set for Power BI authentication (see below) or provide them in a .env file.
- Run the server (Python example):
python powerbi_server.py
- (Optional) For Claude Desktop Integration, register the server:
mcp install powerbi_server.py --name "PowerBI Server"
Environment variables (example):
export POWERBI_TENANT_ID=your-tenant-id
export POWERBI_CLIENT_ID=your-client-id
export POWERBI_CLIENT_SECRET=your-client-secret
Additional notes
Tips and common considerations:
- Secrets should never be committed to version control; use environment variables or a secrets manager.
- Ensure the Azure app registration includes the required Power BI API permissions and that admin consent has been granted.
- Tokens are obtained via OAuth 2.0 client credentials flow and are refreshed automatically by the server.
- If you encounter authentication issues, verify tenant ID, client ID, and client secret are correct and that the app has access to the necessary workspaces.
- For high-volume scenarios, implement additional throttling or rate-limiting as needed due to Power BI API limits.
- When running locally, consider using a virtual environment to isolate dependencies (python -m venv venv; source venv/bin/activate on Unix or venv\Scripts\activate on Windows).
- The server exposes a rich set of tools; consult the usage examples in the README to chain operations (e.g., get_workspaces -> get_datasets -> get_dataset -> analyze_data_quality -> generate_visualization_suggestions -> create_report).
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP