PBIXRay MCP Server
Info!
Those interested in this project might also be interested in this follow-up project, tabular-mcp, which allows running DAX queries against a local PowerBI model. Support is highly appreciated!
A (MCP) server for PBIXRay.
This MCP server exposes the capabilities of PBIXRay as tools and resources for LLM clients to interact with Power BI (.pbix) files.
Features
Loading and analyzing PBIX files
Data model exploration
Listing tables in the model
Retrieving model metadata
Checking model size
Getting model statistics
Getting comprehensive model summary
Query language access
Viewing Power Query (M) code
Accessing M Parameters
Exploring DAX calculated tables
Viewing DAX measures
Examining DAX calculated columns
Data structure analysis
Retrieving schema information
Analyzing table relationships
Accessing table contents with pagination
The list of tools is configurable, so you can choose which tools you want to make available to the MCP client.
Tools
Tool | Category | Description |
| Core | Load a Power BI (.pbix) file for analysis |
| Model | List all tables in the model |
| Model | Get metadata about the Power BI configuration |
| Query | Display all M/Power Query code used for data transformation |
| Query | Display all M Parameters values |
| Model | Get the model size in bytes |
| Query | View DAX calculated tables |
| Query | Access DAX measures with filtering by table or measure name |
| Query | Access calculated column DAX expressions with filtering options |
| Structure | Get details about the data model schema and column types |
| Structure | Get the details about the data model relationships |
| Data | Retrieve the contents of a specified table with pagination |
| Model | Get statistics about the model with optional filtering |
| Model | Get a comprehensive summary of the current Power BI model |
Requirements
Python 3.13 (recommended) or Python 3.10+
uv package manager
Windows PowerShell
Check Your Python Version
Installation and Setup
First Time Setup - Create Virtual Environment
Verification
Once everything is set up, you can test the server:
You should see output similar to:
Claude Desktop Configuration
My Real Claude_Desktop_config.json
Path: C:\Users\guyen\AppData\Roaming\Claude
Content:
Alternative Configuration with PowerShell
If you prefer using PowerShell commands:
Alternative Configuration with uv run
If you prefer using uv run (which handles the virtual environment automatically):
Usage
Windows Path Usage
When using the PBIXRay MCP Server on Windows, you can use standard Windows paths directly:
Command Line Options
The server supports several command line options:
--disallow [tool_names]: Disable specific tools for security reasons--max-rows N: Set maximum number of rows returned (default: 100)--page-size N: Set default page size for paginated results (default: 20)
Query Options
Tools support additional parameters for filtering and pagination:
Filtering by Name
Tools like get_dax_measures, get_dax_columns, get_schema and others support filtering by specific names:
Pagination for Large Tables
The get_table_contents tool supports pagination to handle large tables efficiently:
Development and Testing
Development Installation with uv
For developers working on the project:
Clone the repository (if not already done):
git clone https://github.com/username/pbixray-mcp.git cd pbixray-mcpInstall Python 3.13 (if needed):
uv python install 3.13Create virtual environment with Python 3.13:
uv venv --python 3.13Activate virtual environment:
.venv\Scripts\Activate.ps1Install in development mode:
uv pip install -e .Install dependencies:
uv pip install mcp pbixray numpy
Testing with Sample Files
The repository includes sample files and test scripts to help you get started:
With activated virtual environment:
With uv run (handles venv automatically):
Development Mode
To test the server during development, use the MCP Inspector:
With activated virtual environment:
With uv run (handles venv automatically):
This starts an interactive session where you can call tools and test responses.
Project Structure
Alternative Installation Methods
Traditional pip Installation
You can also install PBIXRay MCP Server with pip:
For development with pip:
WSL (Alternative)
If you prefer to use WSL, add the server configuration to your client configuration file:
WSL Path Conversion
When using the PBIXRay MCP Server in WSL with Claude Desktop on Windows, you need to be aware of path differences when loading PBIX files.
Windows paths (like C:\Users\name\file.pbix) cannot be directly accessed in WSL. Instead, use WSL paths when referencing files:
Windows:
C:\Users\name\Downloads\file.pbixWSL:
/mnt/c/Users/name/Downloads/file.pbix
Contributions
Contributions are much welcomed!
Credits
Hugoberry - Original PBIXRay library
rusiaaman - WCGW (This MCP was fully written by Claude using wcgw)