About Tabular Mcp
Tabular Mcp (MCPBI) is an MCP server that connects to locally running tabular models in Power BI Desktop. It is intended for users who debug, analyse and write DAX queries, helping LLM clients understand model structure and run queries.
Key features
- 01List tables, columns, measures and relationships
- 02Look up DAX function details and parameters
- 03Run custom DAX queries with row limits
- 04Validate DAX syntax and analyze query performance
- 05Optional data obfuscation strategies
- 06Truncation metadata for query results
Use cases
- 01Quickly understanding the structure of an unfamiliar Power BI model
- 02Writing new DAX measures that follow existing naming styles
- 03Iteratively debugging DAX expressions
MCP support
This project is an MCP server that exposes tools for browsing model objects, querying DAX functions, running DAX queries and validating syntax to MCP clients. It connects to a local Power BI Desktop instance through its port using ADOMD.NET.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEMCPBI - Tabular Model MCP Server
This is a Model Context Protocol (MCP) server for locally running Tabular Models, i.e. PowerBI models running on PowerBI Desktop.
This server allows MCP-enabled LLM clients to communicate with your tabular models and help you debug, analyse and compose DAX queries.
Example: Copilot querying Tabular Model via MCP
How it works
It connects to a local running instance of Tabular models using the AdomdConnection in ADOMD.NET.
Using this connection, the server then allows clients to execute DAX-queries and retrieve model metadata (using DMV queries) through pre-defined tools for high accuracy, as well as custom DAX queries for debugging and development.
Features
Configuration Options
Port
Specify the Power BI Desktop instance port to connect to (required).
# Example: Connect to Power BI Desktop instance on port 56751
dotnet run -- --port 56751
Obfuscation
Protect sensitive data with configurable encryption strategies:
- None (default): No obfuscation
- All: Mask all values
- Dimensions: Mask only text/date fields (keep numeric data visible)
- Facts: Mask only numeric fields (keep dimensional context)
# Example: Protect customer/product names while keeping sales figures visible
dotnet run -- --port 56751 --obfuscation-strategy dimensions --encryption-key "YourSecureKey123!"
Output Truncation
Automatic row limiting with comprehensive metadata:
- Default 500-row limit (configurable)
- Response includes:
totalRows,displayedRows,truncated,hasMore
# Example: Increase row limit for analysis
dotnet run -- --port 56751 --max-rows 2000
Tools
list_objects
- Lists all objects in the model (tables, columns, measures, relationships)
- Returns object type, name, and basic metadata
get_object_details
- Retrieves detailed metadata for a specific object (table, column, measure)
- Returns properties, data types, relationships, and dependencies
list_functions
- Lists available DAX functions with optional filtering by category or origin
- Returns function name, description, interface classification, and origin
get_function_details
- Retrieves comprehensive details for a specific DAX function including full parameter information
- Returns function signature, parameter requirements, return type, and DirectQuery compatibility
run_query
- Executes a custom DAX query against the model
- Returns query results with metadata (total rows, truncated status)
1. Model Discovery
Use [ListTables], [GetTableColumns], and [GetTableRelationships] to quickly understand an unfamiliar model's structure without manually clicking through Power BI Desktop.
2. DAX Assistance
LLM clients can use [ListMeasures] and [GetMeasureDetails] to learn your existing DAX patterns and suggest consistent new measures that follow your naming conventions and calculation styles.
3. Debugging
Combine [RunQuery] with [ValidateDaxSyntax] to iteratively test and refine DAX expressions with immediate feedback on syntax and results.
validate_query
- Validates DAX query syntax without execution
- Returns syntax correctness and error messages if applicable
analyze_query_performance
- Analyzes DAX query performance and provides optimization suggestions
- Returns execution time, resource usage, and improvement recommendations
Installation
Setup Instructions
Requirements
- Power BI Desktop (with a PBIX file open for discovery)
- Windows OS
- Visual Studio Code (for MCP server integration)
- .NET 8.0 Runtime
Setup from Prebuilt Release
-
Download the release from the Releases directory or GitHub releases page and extract to your preferred location.
-
Open Power BI Desktop with a PBIX file you want to work with.
-
Get PowerBI instance information
There are several ways to detect Power BI Desktop instances. The easiest is to open Tabular Editor and check the port in the connection string.
Simply add the port (63717 in example above) to your MCP server configuration in the next step (you can ignore the database ID, as this server connects to the default model).
If you don't have Tabular Editor, you can use the included discovery tool to find the running instance and database.
Open PowerShell, navigate to the release directory, and run:
cd path\to\release
.\pbi-local-mcp.DiscoverCli.exe
Note: In PowerShell, you must use .\ prefix to run executables from the current directory.
Follow the prompts to:
- Select the Power BI Desktop instance (identified by port)
- Choose the database/model to connect to
This creates a .env file with PBI_PORT and PBI_DB_ID in the release directory, which you can reference in your MCP configuration or ignore if you specify the port directly.
- Configure MCP server in your editor. For VS Code with Roo, create/edit
.roo/mcp.json:
Replace{ "mcpServers": { "MCPBI": { "type": "stdio", "command": "path\\to\\release\\mcpbi.exe", "cwd": "path\\to\\release", "args": ["--port", "YOUR_PBI_PORT"], "disabled": false, "alwaysAllow": [ "ListTables", "GetTableDetails", "GetTableColumns", "GetTableRelationships", "ListMeasures", "GetMeasureDetails", "PreviewTableData", "RunQuery", "ValidateDaxSyntax", "AnalyzeQueryPerformance", "ListFunctions", "GetFunctionDetails" ] } } }path\\to\\releasewith your actual release directory path andYOUR_PBI_PORTwith the port number from PBI instance.
Setup from Source (For Development)
-
Clone the repository:
git clone <repository-url> cd MCPBI -
Build the project:
dotnet build -
Open Power BI Desktop with a PBIX file.
-
Run discovery to create
.envfile:dotnet run --project pbi-local-mcp/pbi-local-mcp.csproj discover-pbiFollow prompts to select instance and database.
-
Configure MCP server in
.roo/mcp.json:{ "mcpServers": { "mcpbi-dev": { "type": "stdio", "command": "dotnet", "cwd": "path\\to\\MCPBI", "envFile": "path\\to\\MCPBI\\.env", "args": [ "exec", "path\\to\\MCPBI\\pbi-local-mcp\\bin\\Debug\\net8.0\\pbi-local-mcp.dll" ], "disabled": false, "alwaysAllow": [ "ListTables", "GetTableDetails", "GetTableColumns", "GetTableRelationships", "ListMeasures", "GetMeasureDetails", "PreviewTableData", "RunQuery", "ValidateDaxSyntax", "AnalyzeQueryPerformance", "ListFunctions", "GetFunctionDetails" ] } } }Replace
path\\to\\MCPBIwith your actual repository path.
Configuration Notes
- Use either port or envFile: You can specify the Power BI port directly in
argsor useenvFileto load from.env. - Port argument: The
--portargument in the release configuration connects to the specific Power BI Desktop instance on that port - envFile: The development setup uses
envFileto automatically loadPBI_PORTandPBI_DB_IDfrom.env - alwaysAllow: Lists all tools that can be used without requiring user approval for each invocation
- Working directory: The
cwdparameter sets the working directory where the.envfile is located
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.