powerbi-mcp

powerbi-mcp

Enables discovery of Power BI workspaces and datasets, retrieval of semantic model definitions (TMDL), and execution of DAX queries through the Power BI and Microsoft Fabric REST APIs, using MSAL/WAM authentication for secure token caching.

Category
Visit Server

README

powerbi-mcp

A small Model Context Protocol (MCP) server for Microsoft Power BI. It lets an MCP-capable client (Claude, VS Code, etc.) discover your workspaces and datasets, read a semantic model's structure, and run DAX queries — all through the public Power BI and Microsoft Fabric REST APIs.

Authentication uses MSAL with the Windows broker (WAM): you sign in once, the token is cached locally, and the server refreshes it silently afterwards. No tokens are ever pasted by hand or stored in config.

Tools

Tool Description
list_workspaces List the workspaces (groups) you can access.
list_datasets List the datasets (semantic models) in a workspace.
get_model_definition Return a model's TMDL: tables, columns, measures (with DAX) and relationships.
run_dax Execute a DAX query and return the rows as JSON.

Requirements

  • Python 3.10+
  • A Power BI account with access to at least one workspace
  • Windows is recommended (the interactive sign-in uses the OS broker)

Setup

git clone https://github.com/rajivdatta/powerbi-mcp.git
cd powerbi-mcp
python -m venv .venv
.venv\Scripts\activate          # Windows
pip install -r requirements.txt

Sign in once (opens an interactive prompt and caches the token):

python server.py --login

Configuration

All configuration is optional and supplied via environment variables:

Variable Default Purpose
POWERBI_TENANT_ID organizations Pin to a single Azure AD tenant (GUID or domain).
POWERBI_CLIENT_ID Azure CLI public client Use your own app registration instead.

See .env.example.

Using it with an MCP client

Point your client at server.py. Example MCP config (see examples/mcp.json):

{
  "mcpServers": {
    "powerbi": {
      "command": "python",
      "args": ["C:\\path\\to\\powerbi-mcp\\server.py"],
      "env": { "POWERBI_TENANT_ID": "your-tenant-id-or-domain" }
    }
  }
}

A typical flow: list_workspaces -> list_datasets -> get_model_definition (to learn the table and measure names) -> run_dax.

Security

The MSAL token cache (%LOCALAPPDATA%\powerbi-mcp\token_cache.bin) contains a refresh token. Treat it like a password; it is git-ignored and should never be committed.

License

MIT (c) 2026 Rajiv Datta

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured