Power BI MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Power BI MCP ServerRename the Sales table's Revenue measure to Total Revenue across the report."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Power BI MCP Server (PBI_MCP)
A standalone Model Context Protocol (MCP) server for Power BI authoring and editing that works exclusively with local .pbip files (no Microsoft Cloud or Azure authentication required).
1. Core Architecture
The server implements a Dual-Engine Architecture to cleanly manage the two distinct data layers within a Power BI project (.pbip):
┌──────────────────────────┐
│ Model Context Protocol │
│ (Stdio MCP Server) │
└─────────────┬────────────┘
│
┌─────────────────────────┴─────────────────────────┐
▼ ▼
┌──────────────────────────────┐ ┌──────────────────────────────┐
│ Engine A: Semantic Model │ │ Engine B: Report Layout │
│ (The "Brain") │ │ (The "Body") │
│ - TMDL Parser & AST │ │ - JSON Shadow Model │
│ - Round-Trip Fidelity │ │ - Path-based visual queries │
│ - Zero-diff formatting │ │ - Embedded JSON decoding │
└──────────────┬───────────────┘ └──────────────┬───────────────┘
│ │
└───────────────────┬───────────────────────┘
│
▼
┌───────────────────────────────┐
│ Cross-Layer Integrity Engine │
│ - Reference-Aware Renames │
│ - Bound Identifier Rewriting │
│ - Post-Write Safety Validator │
└───────────────────────────────┘Engine A: Semantic Model (TMDL): Parses and serializes tabular model definitions (
.tmdl). Provides typed Pydantic models for tables, columns, and measures, with 100% round-trip fidelity preserving indentation, comments, and whitespace to prevent noisy git diffs.Engine B: Report Layout (JSON Shadow Model): Ingests deeply nested
report.jsonfiles, decodes embedded JSON strings (config,query,dataTransforms), and exposes a flat path-based addressing scheme and JMESPath querying.Cross-Layer Integrity & Safety Net: Coordinates atomic renames between TMDL and report layout JSON. Prevents destructive naive substring replacement, and runs an automated syntax safety net after writes.
In-Memory State Cache: Uses
os.path.getmtimetimestamps to avoid redundant parsing across agent turns.
Related MCP server: Power BI Desktop Local MCP Server
2. MCP Tools Overview
The server registers 11 tools over standard input/output (stdio):
Semantic Model (Engine A)
Tool | Description |
| Returns a high-level summary of all tables, columns, and measures without flooding context. |
| Lists tables with column and measure counts. |
| Retrieves full schema for a table including columns, measures, and partitions. |
| Gets DAX formula, description, formatting, and lineage tag for a measure. |
| Updates a measure's DAX formula in TMDL cleanly while preserving comments and whitespace. |
Report Layout (Engine B)
Tool | Description |
| Lists all report pages with names, ordinals, and visual counts. |
| Returns flat shadow models of all visuals on a page. |
| Query visual properties via path syntax (e.g. |
| Executes JMESPath queries across the report layout shadow model. |
Cross-Layer Integrity & Validation
Tool | Description |
| Renames a measure across TMDL and updates all bound references in |
| Runs post-write structural and syntax validation across descriptor, TMDLs, and report layout JSON. |
3. Running with Docker / Docker Compose
Prerequisites
Docker Engine & Docker Compose
Run with Docker Compose
docker compose up -dBuild and Run with Docker
# Build the image
docker build -t pbi-mcp-server:latest .
# Run container mounting local PBIP workspace
docker run --rm -i \
-v $(pwd):/app/workspace:rw \
-e PBI_WORKSPACE_PATH=/app/workspace \
-e LOG_LEVEL=INFO \
pbi-mcp-server:latest4. Local Development
Installation using uv
# Create virtual environment and install dependencies
uv sync
# Or install with pip
pip install -e .Running the Server Locally
export PBI_WORKSPACE_PATH=$(pwd)/sample_project.pbip
python -m mcp_server.mainRunning Tests
pytest -v5. Integrating with MCP Clients
Add the server to your client configuration (e.g., Claude Desktop claude_desktop_config.json or Antigravity):
{
"mcpServers": {
"powerbi": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-v",
"/absolute/path/to/pbip_project:/app/workspace:rw",
"-e",
"PBI_WORKSPACE_PATH=/app/workspace",
"pbi-mcp-server:latest"
]
}
}
}Or running directly with Python:
{
"mcpServers": {
"powerbi": {
"command": "python",
"args": ["-m", "mcp_server.main"],
"env": {
"PBI_WORKSPACE_PATH": "/absolute/path/to/pbip_project"
}
}
}
}This server cannot be deployed
Maintenance
Related MCP Connectors
Forge designed Power BI projects (.pbip) from your agent, bound to your own semantic model.
- ApricotOAuthtools.apricot
Manage SysML2 projects; check, evaluate, verify, query, document and diagram models.
Manage files and folders directly from your workspace. Read and write files, list directories, cre…
The Buildkite MCP server exposes Buildkite product data (pipelines, builds, jobs, and test data) to AI tools, editors, and agents through the Model Context Protocol. It provides capabilities including pipeline creation and management, build monitoring with specialized tools like 'wait_for_build', efficient log querying using Apache Parquet conversion and caching, and OAuth-based authentication for both read-write and read-only access to Buildkite's REST API.
Related MCP Servers
- FlicenseCqualityDmaintenanceCreates, inspects, validates, and modifies Power BI Project (.pbip) folders, generating PBIR-style reports and TMDL semantic models from structured inputs.52-
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to discover and interact with local Power BI Desktop instances, including inspecting table/column schema and executing DAX queries.2-
- AlicenseAqualityAmaintenanceEnables local Power BI project (.pbip) automation, including model (TMDL) and report (PBIR) layer manipulation, without cloud dependencies. Provides 56 tools for building, editing, and validating reports and measures through natural language prompts.13MIT
- AlicenseBqualityAmaintenanceEnables AI agents to author and edit Power BI files locally (.pbix/PBIP), covering semantic models, reports, and Power Query M with 490 tools.10023 npm3Cryptographic Autonomy 1.0 (Combined Work Exception)