MCP Server for Power BI
A Python-based MCP server that exposes Power BI semantic models to Claude, enabling natural-language querying of Power BI data through tools like listing workspaces, exploring datasets, executing DAX queries, and triggering refreshes.
README
MCP Server for Power BI
A Python-based Model Context Protocol server that exposes Power BI semantic models to Claude and Claude Code, enabling natural-language querying of your Power BI data from any MCP-compatible chat client.
What this project does
This implementation provides MCP tools to:
- list Power BI workspaces
- list datasets inside a workspace
- inspect dataset metadata
- list the tables and columns in a semantic model
- execute DAX queries against a dataset
- trigger a dataset refresh
This makes it possible for Claude to answer questions such as:
- “Which workspaces do I have access to?”
- “Show me the datasets in the Sales workspace.”
- “Run a DAX query against the Finance dataset.”
Architecture
flowchart LR
A[Claude / Claude Code] --> B[MCP Client]
B --> C[MCP Server - Python]
C --> D[Power BI REST API]
D --> E[Power BI Semantic Model]
Prerequisites
- Python 3.10+
- A Power BI service principal or user account with access to the required workspaces
- Power BI tenant ID, client ID, and client secret for service principal authentication
Setup
- Create and activate a virtual environment
- Install dependencies
- Copy the environment template and set your credentials
- Run the server
1) Create a virtual environment
python -m venv .venv
.venv\Scripts\activate
2) Install dependencies
pip install -r requirements.txt
3) Configure environment variables
copy .env.example .env
Update .env with your values:
POWERBI_TENANT_ID=your-tenant-id
POWERBI_CLIENT_ID=your-client-id
POWERBI_CLIENT_SECRET=your-client-secret
4) Run the server
python -m powerbi_mcp_server.server
5) Connect it to Claude Desktop or Claude Code
Point your MCP client config at this server — see examples/claude_desktop_config.json for a ready-to-copy snippet, and examples/demo_prompts.md for prompts to try once it's connected.
MCP tools exposed
list_workspaces()list_datasets(workspace_id)get_dataset_details(workspace_id, dataset_id)get_dataset_metadata(workspace_id, dataset_id)list_dataset_tables(workspace_id, dataset_id)execute_dax_query(workspace_id, dataset_id, dax_query)refresh_dataset(workspace_id, dataset_id)
Running tests
pip install pytest
python -m pytest tests/ -v
Authentication
This server authenticates via an Azure AD service principal (client credentials flow). The service principal must be added to the Power BI tenant's allowed service principals and granted access to the relevant workspaces. Interactive/user-delegated login is a possible future addition if you need a lighter-weight local demo flow.
Next steps
- add interactive user-login (device code) auth as an alternative to the service principal flow
- add a tool that surfaces DAX measures per table for richer natural-language grounding
- capture a short screen recording/GIF of a live Claude session for the README
License
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.