powerbi-mcp
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., "@powerbi-mcp inspect Sales.pbix and list its tables and measures"
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.
powerbi-mcp
Local Power BI MCP server — no tenant, no workspace, no admin.
Two things it does:
Read
.pbixfiles without opening them (via pbixray): tables, columns, measures, relationships, Power Query and decoded rows. Works on.pbix, Analysis Services.abfand PowerPivot.xlsx.Generate
.pbipprojects (the TMDL text format Power BI Desktop saves itself): build a semantic model from CSV or Excel files, add DAX measures and relationships, lay out report pages, then open the.pbipin Power BI Desktop and refresh.
Built for course-scale work: an instructor (or an AI agent) can hand out ready-made models and inspect submitted files, with no Power BI Service access at all. Everything runs locally; the server never touches the network beyond its own loopback port.
Quickstart
git clone https://github.com/veenetul/powerbi-mcp.git
cd powerbi-mcp
uv sync
uv run demo_local.py # end-to-end: CSV star schema -> validated .pbipOpen the result (exports/CourseDemo/CourseDemo.pbip) in Power BI Desktop
(File > Open report > Browse reports), press Refresh, and the data loads.
Related MCP server: pbi-mcp
Tools (20)
Tool | What it does |
| model size, tables, rough row counts, object counts |
| all columns with data types |
| all DAX measures with expressions |
| all relationships (from/to, cardinality, active) |
| all M expressions |
| decoded rows of one table (max 500/call) |
| new project skeleton ( |
| new table loaded from a CSV, types inferred |
| sheets of an .xlsx: rows, columns, headers |
| new table loaded from one .xlsx sheet, types from Excel |
| DAX measure with optional format string |
| relate tables (many side → one side) |
| calculated calendar table over a date column, marked as date table |
| add a report page, returns page id |
| add a visual (card, slicer, donutChart, filledMap, stackedBarChart, …) with fields + pixel position |
| pages and visuals of a project |
| delete a visual / page |
| tables/columns/measures/relationships of a project |
| structural checks; catches what would stop Desktop opening |
List them all without a client: uv run list_tools.py.
Run the server
uv run powerbi-mcp # stdio (what MCP clients spawn)
uv run powerbi-mcp-http # streamable HTTP on http://127.0.0.1:8003/mcpConnect from an editor/agent
VS Code:
.vscode/mcp.json→{"servers": {"powerbi": {"type": "stdio", "command": "uv", "args": ["run", "powerbi-mcp", "--directory", "<repo>"]}}}, then use the tools in Copilot agent mode.Vibe / Claude-style clients: register with stdio transport, command
uv run powerbi-mcpin the repo folder, or point a streamable-HTTP client athttp://127.0.0.1:8003/mcp.
Sandbox
All file reads and writes are restricted to allowed roots (semicolon-separated):
MCP_POWERBI_ALLOWED_READ_ROOTS— default: the working directoryMCP_POWERBI_ALLOWED_WRITE_ROOTS— default: the working directory
Set both explicitly when you want the server confined to one data folder.
Layout produced
<name>/
├── <name>.pbip
├── .gitignore
├── <name>.Report/
│ ├── .platform
│ ├── definition.pbir
│ └── definition/
│ ├── report.json
│ ├── version.json
│ └── pages/pages.json + pages/<id>/page.json
└── <name>.SemanticModel/
├── .platform
├── .pbi/editorSettings.json
├── definition.pbism
└── definition/
├── database.tmdl
├── model.tmdl
├── relationships.tmdl
└── tables/<Table>.tmdlTypical workflow
Put source data (CSV or .xlsx) somewhere the sandbox allows.
list_excel_sheetsshows what is inside an .xlsx.Ask an MCP client: "create a Power BI project called X, add the orders sheet as table Orders, sellers as Sellers, relate them, add a Total measure, add a card showing Total".
validate_pbippasses.Open
<X>/<X>.pbipin Power BI Desktop, press Refresh, build visuals.Save As
.pbixif that is the deliverable; afterwardspbix_overview/pbix_relationshipscan read the saved file back to verify it.
Updating a project
Incremental: call the MCP tools (
add_measure,add_visual, …) or edit the TMDL/JSON files in VS Code while Desktop has the project open — Desktop shows an "Apply external changes" banner; click Apply. Runvalidate_pbipafter structural changes.Full rebuild: close Power BI Desktop first (it locks the folder), then rerun the script that generated the project.
Notes
The CSV path is baked into each table's M partition. Move the CSV and you must fix the partition.
pbix_measuresreturns whatever the file's metadata database contains; some older or odd files store no measures there.Visual fields are DAX-style
Table[Field]; positions are pixels on a 1280x720 page.
Requirements
Python 3.13 (uv sync downloads it if missing; pbixray ships wheels for
3.13), Power BI Desktop for the last mile (opening the .pbip). Works
offline; pbixray decodes the DataModel locally.
License
MIT — see LICENSE.
Available Tools
20 toolsadd_csv_tableAdd Csv TableA
Add a table to a project, loaded from a CSV via Power Query. Types are inferred from the CSV. pbip_path may be the .pbip file or the project folder. Refresh in Power BI Desktop loads the data.
Inputs: csv_path (required), pbip_path (required), table_name (required), encoding, +1 more. Returns: object
add_date_tableAdd Date TableA
Add a calculated calendar table (CALENDAR over MIN..MAX of date_column, e.g. 'Tilaukset[Tilauspäivämäärä]'), marked as date table, with Vuosi/Kuukausi/Kuukauden nimi/Neljännes/Vuosineljännes columns. Then relate it with add_relationship.
Inputs: pbip_path (required), date_column (required), table_name. Returns: object
add_excel_tableAdd Excel TableB
Add a table to a project, loaded from one sheet of an .xlsx file (types come from the Excel column types). sheet='' = first sheet.
Inputs: pbip_path (required), xlsx_path (required), table_name (required), sheet. Returns: object
add_measureAdd MeasureC
Add a DAX measure to a table of a project. Example: dax='SUM(Sales[NetAmount])', format_string='"$"#,##0.00'.
Inputs: dax (required), pbip_path (required), table_name (required), measure_name (required), +1 more. Returns: object
add_pageAdd PageB
Add a report page to a project. Returns the page_id for add_visual.
Inputs: pbip_path (required), display_name (required), width, height. Returns: object
add_relationshipAdd RelationshipC
Relate two tables in a project. from_column = MANY side, to_column = ONE side, DAX style like 'Sales[StoreId]'.
Inputs: pbip_path (required), to_column (required), from_column (required), cross_filter. Returns: object
add_visualAdd VisualA
Add a visual to a page. visual_type: card, slicer, donutChart, pieChart, filledMap, map, barChart / columnChart (stacked; "stackedBarChart" is accepted as an alias), clusteredBarChart, clusteredColumnChart, textbox, table, matrix. fields maps roles to fields, e.g. {"Y": "Tilaukset[Myynnin arvo]", "Category": "Kunnat[Kommun]", "Series": "Tilaukset[Tuoteryhmä]"}. Roles: card/slicer=Values; donut/pie=Category+Y; bar/column charts= Category+Series+Y; filledMap/map=Category(+Y/Size); textbox: options {"text": "..."}. x/y/width/height are pixels on a 1280x720 page. legend: "Top"|"Bottom"|"Left"|"Right". title: show header. options: extra PBIR objects merged into the visual.
Inputs: page (required), pbip_path (required), visual_type (required), x, +8 more. Returns: object
create_pbip_projectCreate Pbip ProjectA
Create a new Power BI project skeleton that opens in Power BI Desktop. Makes <parent_dir>// containing the .pbip, an empty report and an empty semantic model. Follow up with add_csv_table / add_measure / add_relationship, then validate_pbip.
Inputs: name (required), parent_dir (required), culture. Returns: object
get_pbip_summaryGet Pbip SummaryC
Tables, columns, measures, relationships and CSV sources of a project.
Inputs: pbip_path (required). Returns: object
list_excel_sheetsList Excel SheetsC
Sheets of an .xlsx file with row/column counts and headers.
Inputs: xlsx_path (required). Returns: object
list_reportList ReportC
Pages and visuals of a project (name, type, position, fields).
Inputs: pbip_path (required). Returns: object
pbix_measuresPbix MeasuresC
Every DAX measure in a .pbix: home table, name, expression.
Inputs: path (required). Returns: object
pbix_overviewPbix OverviewA
Inspect a .pbix (also .abf / PowerPivot .xlsx) without opening it: model size, tables, rough row counts, and counts of columns, measures and relationships. Start here when looking at a Power BI file.
Inputs: path (required). Returns: object
pbix_power_queryPbix Power QueryB
All Power Query (M) expressions of a .pbix, one per table.
Inputs: path (required). Returns: object
pbix_relationshipsPbix RelationshipsB
All relationships of a .pbix model: from/to table and column, cardinality, active.
Inputs: path (required). Returns: object
pbix_schemaPbix SchemaC
All columns of a .pbix model (table, column, data type). Optional table filter.
Inputs: path (required), table. Returns: object
pbix_table_dataPbix Table DataC
Decoded rows of one table in a .pbix (max 500 rows per call).
Inputs: path (required), table (required), max_rows. Returns: object
remove_pageRemove PageA
Delete a whole page (id or display name). Cannot remove the last page.
Inputs: page (required), pbip_path (required). Returns: object
remove_visualRemove VisualC
Delete a visual from a page by name.
Inputs: name (required), page (required), pbip_path (required). Returns: object
validate_pbipValidate PbipB
Structural validation of a project (required files, JSON, table refs, relationship columns, duplicate lineage tags). Empty issues = valid.
Inputs: pbip_path (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 20 tools
The set splits cleanly into .pbip authoring tools (add_*, remove_*, create_pbip_project, validate_pbip) and .pbix inspection tools (pbix_*), and descriptions make the file-format distinction explicit. The only mild overlaps are get_pbip_summary vs list_report vs pbix_overview, which are separated by target artifact, and add_date_table vs add_measure, which the description clarifies.
Most tools follow a readable verb_noun snake_case pattern (add_measure, remove_page, list_report, validate_pbip). The pbix_* family uses a noun-first namespace prefix instead, and pbix_overview is a noun-style tool where others are verbs, but it functions as a coherent grouping convention rather than chaos.
20 tools is slightly above the comfortable band, but the surface covers two genuinely distinct workflows (authoring .pbip projects and introspecting .pbix binaries), and each tool maps to a concrete operation. Very few tools look redundant or filler-ish, so the count is defensible.
Creation is well covered (project, tables, measures, relationships, date table, pages, visuals) plus validation and inspection, but the surface is add-heavy: there is no remove/update for measures, tables, or relationships, and no way to edit an existing visual. An agent that makes a modeling mistake has to fall back to manual file edits, which is a notable lifecycle gap.
Maintenance
Related MCP Connectors
Forge designed Power BI projects (.pbip) from your agent, bound to your own semantic model.
Manage SysML2 projects; check, evaluate, verify, query, document and diagram models.
Model, map and validate data schemas. Export JSON Schema, JSON-LD, LinkML, OWL, ShEx, SQL, Avro.
Open, inspect, filter, edit and convert xlsx and csv files from your AI chat. Processing is local.
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-
- AlicenseAqualityCmaintenanceEnables 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
- AlicenseNot gradedqualityDmaintenanceEnables querying open Power BI Desktop models locally, including discovering instances, listing tables and measures, and running DAX queries without cloud login or publishing.MIT
- AlicenseAqualityBmaintenanceEnables local authoring and editing of .pbip projects by exposing semantic model (TMDL) and report layout (JSON) operations, including measure updates, visual property queries, cross-layer renames, and structural validation, without cloud authentication.20GPL 3.0