Get the FREE Ultimate OpenClaw Setup Guide →

mcpbi

PowerBI MCP server to give LLM clients (Claude, GH Copilot,etc) context from locally running PowerBI Desktop instances.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio jonaolden-mcpbi path\to\release\mcpbi.exe --port YOUR_PBI_PORT \
  --env PBI_PORT="Port of the Power BI Desktop instance to connect to"

How to use

MCPBI exposes a set of pre-defined tools that let clients discover and interact with your local Power BI Desktop tabular model via MCP. You can list model objects (tables, columns, measures), inspect detailed metadata for objects, and retrieve available DAX functions. You can also run custom DAX queries against the connected model and receive structured results along with metadata such as total rows and whether the results were truncated. For debugging and development, there are utilities to validate DAX syntax and analyze query performance, helping you refine queries and improve reliability when used by an LLM-powered assistant or other MCP clients. Model discovery tools (ListTables, GetTableColumns, GetTableRelationships) help you quickly understand a new PBIX without manually exploring the UI, while DAX assistance tools (ListMeasures, GetMeasureDetails) help reinforce consistent naming and calculations. The RunQuery tool enables executing custom DAX queries, and ValidateDaxSyntax and AnalyzeQueryPerformance provide immediate feedback and optimization guidance.

How to install

Prerequisites:

  • Windows OS
  • Power BI Desktop installed with a PBIX file you want to connect to
  • .NET 8.0 Runtime
  • Visual Studio Code (optional, for MCP server integration)

Setup from Release (recommended for end users):

  1. Download the MCPBI release from the Releases page and extract to a local directory.

  2. Ensure Power BI Desktop is running and a PBIX file is open.

  3. Open your MCP editor (e.g., VS Code with Roo) and configure the MCP server entry to point to the release executable:

    { "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" ] } } }

  4. Replace path\to\release and YOUR_PBI_PORT with your actual release path and detected Power BI port).

Setup from Source (for development):

  1. Clone the repository and navigate to it.
  2. Build the project with dotnet build.
  3. Run the development discovery to create the .env file and connect to PBIX: dotnet run --project pbi-local-mcp/pbi-local-mcp.csproj discover-pbi
  4. In your editor, configure MCP in .roo/mcp.json to point to the built DLL as shown in the README, replacing paths with your local setup.

Additional notes

Tips:

  • The MCP server connects to a local Power BI Desktop instance; ensure the PBID is open and the PBIX loaded before starting the MCP server.
  • If you prefer to use an environment file, you can load the port via an .env file rather than passing the port on the command line.
  • The AlwaysAllow list defines which MCP commands are permitted; ensure it includes the operations you plan to use (e.g., RunQuery, ValidateDaxSyntax).
  • When running on Windows, ensure the working directory (cwd) is correctly set to the release or build directory containing the executable or DLL.
  • For debugging, consider starting the MCP server in development mode with the source-based DLL path and the same port to ensure parity with the release behavior.

Related MCP Servers

Sponsor this space

Reach thousands of developers