Skip to content
MCP server
Registry

pbirb-mcp MCP Server

MCP server for editing Power BI Report Builder paginated reports (RDL)

pbirb-mcp scores 69 (Good), licensed MIT and written in Python. It installs as a local process. It declares 40 tools. Filed under Uncategorized. GitHub shows 6 stars. Install configs are generated for 12 clients. Being listed in the registry is not the same as being vendor-official.

by mafaq229MITPython6 stars
Trust score
69Good
Trust score 69 of 100, Good

Good trust

69 of 100 from six public signals. Nobody can buy a point.

  • Listed in the official MCP registry.
  • OSI-style license: mit.
How we score trust
Scorecard

License, quality and maintenance

How grades work
Trust breakdown

Where the 69 comes from

22 + 20 + 3 + 10 + 4 + 10 = 69. Each factor is capped, so no single signal can carry a listing.

Registry22 / 30

Active in the official MCP registry, plus a known vendor namespace.

Registry: 22 of 30 points.
Maintenance20 / 20

How recently the repository saw a commit or release.

Maintenance: 20 of 20 points.
Popularity3 / 20

GitHub stars and weekly downloads, on a log scale.

Popularity: 3 of 20 points.
License10 / 10

A clear, OSI-style open-source license.

License: 10 of 10 points.
Security4 / 10

Not archived, a secure install path, a pinned version.

Security: 4 of 10 points.
Docs10 / 10

A real summary, a README with depth, listed tools.

Docs: 10 of 10 points.

Install

Pick your client, copy the config, paste it in.

Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.

~/Library/Application Support/Claude/claude_desktop_config.json
{  "mcpServers": {    "mafaq229-pbirb-mcp": {      "command": "uvx",      "args": [        "pbirb-mcp"      ]    }  }}

Environment variables

This server does not declare environment variables.

Tools40Tool docs quality grade D

All capabilities
  • Append an Image to the body

  • Append a Textbox to <Body>/<ReportItems>

  • Append <QueryParameter> (e.g. =Parameters!DateFrom.Value)

  • Append a <Filter>. Operators: Equal, NotEqual, GreaterThan, In, Between, Like, TopN, ...

  • Promote a table to a matrix (row + column groups) — see docs/MATRIX-cookbook.md

  • Copy one textbox's formatting onto others

  • Top-level inventory: data sources, datasets, parameters, tablixes, page setup

  • Cheat-sheet of common RDL expression patterns (countwhere, sumwhere, iifformat helpers build these)

  • Report parameters with data type, prompt, and flags (multi-value, hidden, nullable, allow-blank)

  • Tablix layout: columns, row/column groups, sort expressions, filters, visibility

  • A basic Column chart: single category axis grouped by categoryfield, single Y series =Sum(Fields!<valuefield>.Value). Change <Type> post-insert (Bar / Line / Pie / etc.).

  • A basic Tablix mirroring the fixture's shape — header row with the column name as a static label, detail row binding to =Fields!<column>.Value. One column per requested field.

About

pbirb-mcp

CI PyPI Python versions License: MIT

An MCP server for editing Power BI Report Builder paginated reports (.rdl) through Claude (Desktop, CLI, or any MCP client). 160+ tools cover the gaps that otherwise force hand-written XML: report creation, data sources and datasets, calculated fields, dataset and tablix filters, groupings (row, column, matrix), sorting, charts, headers and footers, body composition, layout containers, positioning, styling, page setup, pagination, advanced parameters, embedded images, interactivity (actions, tooltips, document map), transactions, and validation.

The server speaks MCP (JSON-RPC 2.0) over stdio, MCP protocol revisions 2024-11-05 through 2026-07-28. It opens an .rdl from disk, mutates it in place via lxml, validates structure, and writes atomically — a failed save never leaves a half-written report or scrubs the original.

Security defaults. The pbirb-mcp server only opens files under the directory it was started in, and refuses destructive tools (removals, convert_to_matrix, raw_xml_replace / raw_xml_remove, restore_from_backup) until the call carries confirm=true. MCP clients often start servers in / or in their own app directory, so set PBIRB_MCP_ALLOWED_ROOTS to your reports folder (see Security defaults).

Stability

Pre-1.0. The tool surface — tool names, inputSchema, output shapes, error semantics — is the contract. While on 0.x, MINOR releases may include a small breaking change with a migration note in CHANGELOG.md; after v1.0, breaking changes require MAJOR. See CONTRIBUTING.md for the full bump rules adapted from SemVer for an MCP tool surface.

Pin to a MINOR while on 0.x (e.g. pbirb-mcp~=0.1) if your prompts depend on specific tool names or schemas.


Quick start

1. Install

The simplest path is uv + PyPI — no clone, no venv, no install step:

uvx pbirb-mcp

uvx fetches the package into a throwaway environment, runs the pbirb-mcp console script, and exits. The MCP server speaks JSON-RPC over stdio, so any MCP client (Claude Desktop, Claude Code, etc.) can spawn it directly.

For local development against this codebase instead:

git clone https://github.com/mafaq229/pbirb-mcp
cd pbirb-mcp
uv venv .venv
uv pip install --python .venv/bin/python -e ".[dev]"

Verify the binary works:

printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"smoke","version":"1"}}}' \
  | .venv/bin/pbirb-mcp

You should see a single JSON-RPC response with protocolVersion, capabilities.tools, and serverInfo.name = "pbirb-mcp".

2. Wire into Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "pbirb": {
      "command": "uvx",
      "args": ["pbirb-mcp"],
      "env": {
        "PBIRB_MCP_ALLOWED_ROOTS": "/Users/you/Reports"
      }
    }
  }
}

Claude Desktop may start the server with its working directory set to / or to the app's own directory, and by default the server only opens files under its working directory — so set PBIRB_MCP_ALLOWED_ROOTS to the folder(s) holding your reports (on Windows e.g. "C:\\Users\\you\\Reports"; separate several with : on macOS/Linux, ; on Windows). See Security defaults.

Restart Claude Desktop. The hammer icon should show pbirb and the 160+ tools listed below.

To enable file logging, add PBIRB_MCP_LOG_FILE to the env block — but keep it platform-appropriate: it takes an OS-native path, so a Unix path like /tmp/pbirb-mcp.log only works on macOS/Linux. On Windows use a Windows path (e.g. %TEMP%\\pbirb-mcp.log). See Logging. When unset, logs go to stderr, which Claude Desktop captures in its MCP debug pane on every platform.

For development against a local checkout, swap the args for ["--from", "/absolute/path/to/pbirb-mcp", "pbirb-mcp"] so uvx runs your working tree instead of the published version.

3. Wire into Claude Code

claude mcp add pbirb -- uvx pbirb-mcp

Or add to .mcp.json at the workspace root:

{
  "mcpServers": {
    "pbirb": {
      "command": "uvx",
      "args": ["pbirb-mcp"]
    }
  }
}

Or install it as a Claude Code plugin — one command instead of editing config by hand (it wires up the same uvx pbirb-mcp server for you):

/plugin marketplace add mafaq229/pbirb-mcp
/plugin install pbirb-mcp@pbirb

4. Smoke test

In any chat, ask the model:

Open ~/path/to/some-report.rdl and tell me what datasets and parameters it has.

The model should call describe_report, get_datasets, and get_parameters and summarise the result. If it doesn't, your client probably hasn't loaded the server — check the client's MCP debug log.


Configuration

Security defaults

The pbirb-mcp command (what MCP clients launch) is locked down by default:

  • File access is limited to the working directory. Every path argument (path and every *_path) must resolve — symlinks and .. followed — inside an allowed root, or the call is refused with PathNotAllowed before anything is read or written. Set PBIRB_MCP_ALLOWED_ROOTS to the directories to allow (os.pathsep-separated: : on macOS/Linux, ; on Windows); * means unrestricted. Clients such as Claude Desktop may start the server in / or their app directory, so set it explicitly (see the config example in the Quick start).
  • Destructive tools need confirm=true. Tools that delete report content or overwrite a file (every remove_*, convert_to_matrix, raw_xml_replace / raw_xml_remove, restore_from_backup, and an apply_edits batch that contains one) are refused with ConfirmationRequired until the call carries confirm=true; 2026-07-28 clients that support elicitation are asked to confirm instead. PBIRB_MCP_REQUIRE_CONFIRM=0 turns this off.
  • Audit log (opt-in). PBIRB_MCP_AUDIT_LOG=/path/to/audit.jsonl appends one JSON line per edit and per transaction commit.

An MCPServer embedded in Python (tests, the eval harness, library use) defaults to unrestricted roots and no confirmation; the same environment variables opt it in.

Toolsets and read-only mode

By default the server lists every tool. To give the model fewer tool definitions to read (and fewer to choose from), enable only the toolsets a task needs, and/or run read-only:

{
  "mcpServers": {
    "pbirb": {
      "command": "uvx",
      "args": ["pbirb-mcp", "--toolsets", "data,parameters", "--read-only"]
    }
  }
}
ToolsetCovers
coreAlways on: describe_report, validate_report / verify_report / lint_report, diff_report, apply_edits, dry_run_edit, transactions, expression helpers
dataData sources, datasets, DAX queries, query parameters, fields, dataset filters
parametersReport parameters: declarations, available/default values, prompts, pane layout
tablixTables and matrices: groups, columns, rows, subtotals, spans, filters, sorting, group visibility, pagination
chartCharts: series, axes, legend, data labels, palette, colours, title
styleTextbox text and formatting, finding textboxes, row styling
layoutPage setup, body/header/footer items, positions and sizes, containers, images, embedded images, element visibility
interactivityActions (links, drill-through, bookmarks), tooltips, document map
admincreate_report, duplicate_report, backups, the raw-XML escape hatch
  • --toolsets takes comma-separated names, all, or default (PBIRB_MCP_TOOLSETS sets the same; the flag wins). Unknown names are an error. pbirb-mcp --list-toolsets prints every toolset's tools.
  • --read-only (or PBIRB_MCP_READ_ONLY=1) exposes only tools published with readOnlyHint: true — readers, validation, expression helpers and dry_run_edit, which previews an edit on a temp copy.
  • The limits are enforced when a tool is called, not only in tools/list: a call outside the enabled toolsets, or an edit in read-only mode, returns an isError result (ToolNotEnabled / ReadOnlyMode) naming the setting to change. apply_edits / dry_run_edit ops are held to the same toolsets.

Every tool also carries MCP annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint: false) and a display title, so clients can auto-approve the readers and flag the destructive tools.

Environment variables

VariableDefaultPurpose
PBIRB_MCP_ALLOWED_ROOTSpbirb-mcp: the working directory; embedded MCPServer: unrestrictedDirectories report paths must be inside (os.pathsep-separated); * = unrestricted. See Security defaults.
PBIRB_MCP_REQUIRE_CONFIRMpbirb-mcp: on; embedded: offDestructive tools need confirm=true. 0 / false turns it off.
PBIRB_MCP_AUDIT_LOGoffFile to append one JSON line to per edit and per transaction commit.
PBIRB_MCP_TOOLSETSevery toolsetComma-separated toolsets to expose (--toolsets overrides it). See Toolsets.
PBIRB_MCP_READ_ONLYoff1 exposes only read-only tools (--read-only turns it on).
PBIRB_MCP_AUTO_VERIFYoff1 runs verify_report after every successful edit outside a transaction; the result becomes {result, verify}. Transactions verify at commit.
PBIRB_MCP_TRANSACTION_TIMEOUT_S600Seconds an editing transaction lives without a commit or cancel; an expired one is discarded (nothing saved).
PBIRB_MCP_LOG_LEVELWARNINGDEBUG / INFO / WARNING / ERROR.
PBIRB_MCP_LOG_FILEstderrLog file path (see Logging).
PBIRB_MCP_AUTO_BACKUPoff1 backs the report up (<path>.bak.<UTC-timestamp>) before every removal, rename, query rewrite, raw_xml_replace / raw_xml_remove and convert_to_matrix; the result's auto_backup is the backup path. A backup that already holds the file's bytes is reused.

Truthy values are 1, true, yes, on (case-insensitive).

Logging

VariableDefaultPurpose
PBIRB_MCP_LOG_LEVELWARNINGDEBUG / INFO / WARNING / ERROR
PBIRB_MCP_LOG_FILEstderrPath to a log file; otherwise logs go to stderr (where Claude Desktop captures them in its MCP debug pane)
PBIRB_MCP_LOG_LEVEL=DEBUG PBIRB_MCP_LOG_FILE=/tmp/pbirb-mcp.log pbirb-mcp

Working with a report

The recommended flow is read first, then edit by name. Every mutating tool addresses elements by their RDL Name attribute (Tablix name, Textbox name, ReportParameter name, DataSet name) — never by index. Indices break across multi-step edits.

A typical session:

You:    Bind the existing report at ~/Reports/sales.rdl to the Finance
        workspace's "FY26 Sales" dataset, change the body DAX to a date-
        ranged query, and add a header with a logo and a parameter line.

Claude: → describe_report(path=…)
        → set_datasource_connection(name="PBIDataset",
              workspace_url="Finance", dataset_name="FY26 Sales")
        → update_dataset_query(dataset_name="MainDataset",
              dax_body="EVALUATE FILTER('Sales',
                'Sales'[OrderDate] >= @DateFrom &&
                'Sales'[OrderDate] <= @DateTo)")
        → add_query_parameter(dataset_name="MainDataset",
              name="DateFrom",
              value_expression="=Parameters!DateFrom.Value")
        → add_query_parameter(dataset_name="MainDataset",
              name="DateTo",
              value_expression="=Parameters!DateTo.Value")
        → add_embedded_image(name="Logo",
              mime_type="image/png", image_path="~/brand/logo.png")
        → set_page_header(height="0.75in",
              print_on_first_page=True, print_on_last_page=True)
        → add_header_image(name="HeaderLogo",
              image_source="Embedded", value="Logo",
              top="0in", left="0in", width="1in", height="0.5in")
        → add_header_textbox(name="DateLine",
              text='="From: " & Parameters!DateFrom.Value & "  To: "
                    & Parameters!DateTo.Value',
              top="0.1in", left="1.2in", width="4in", height="0.25in")

Open the resulting .rdl in Report Builder; the change is visible in the designer and renders in Preview against the bound dataset.


Tool reference

The tools, grouped by RDL concern. The highlights of each group are tabled below; the authoritative, always-current list with full schemas is the server's tools/list output (pbirb-mcp --list-toolsets prints the names by toolset), and docs/TOOLS.md has every tool's full behaviour notes. Every report tool takes a path argument (absolute path to the .rdl).

Every tool that takes a report path also accepts an optional transaction_id, so a multi-step edit batches into a single atomic save — see Transactions and docs/TRANSACTIONS.md.

Read-only inventory

The "what's in this report?" tools. Always the first calls when planning a multi-step edit.

ToolReturns
describe_reportTop-level inventory: data sources, datasets, parameters, tablixes, page setup
get_datasets / get_datasetFull DAX command text, fields, query parameters, dataset filters (all, or one by name)
list_data_sources / get_data_sourceData source inventory; one source's connection details
get_parametersReport parameters with data type, prompt, and flags (multi-value, hidden, nullable, allow-blank)
get_tablixesTablix layout: columns, row/column groups, sort expressions, filters, visibility
list_tablix_filters / list_dataset_filtersFilters in document order with stable indices
list_body_items / list_header_items / list_footer_itemsNamed report items in each region
get_textbox / get_image / get_rectangle / get_chartFull properties of a named report item
list_embedded_images / get_embedded_image_dataEmbedded image names + MIME types; base64 bytes of one
get_expression_referenceCheat-sheet of common RDL expression patterns (count_where, sum_where, iif_format helpers build these)

Datasource & dataset

ToolWhat it edits
set_datasource_connectionRepoint a <DataSource> at a Power BI XMLA endpoint. DataProvider=SQL (the AS provider id).
add_data_source / remove_data_source / rename_data_sourceManage <DataSource> elements
update_dataset_queryReplace <DataSet>/<Query>/<CommandText> with a DAX expression
add_query_parameterAppend <QueryParameter> (e.g. =Parameters!DateFrom.Value)
update_query_parameterChange the value expression of an existing query parameter
remove_query_parameterDrop a query parameter (and clean up empty <QueryParameters>)
add_dataset_field / remove_dataset_fieldManage <Field> entries on a dataset
add_calculated_field / remove_calculated_fieldManage <Value>-backed calculated fields
refresh_dataset_fieldsRe-derive the <Fields> list from the query's column metadata
add_dataset_filter / remove_dataset_filterFilters applied at the dataset level (vs. tablix)
add_dataset / remove_dataset / rename_datasetManage <DataSet> elements; a rename rewrites every reference to the dataset
set_dataset_data_source / set_dataset_optionsPoint a dataset at another data source; query timeout, collation and case/accent/kana/width sensitivity
rename_dataset_field / set_field_typeRename a field (rewriting Fields!X references) or set its rd:TypeName

Tablix

ToolWhat it edits
add_tablix_filterAppend a <Filter>. Operators: Equal, NotEqual, GreaterThan, In, Between, Like, TopN, ...
remove_tablix_filterRemove by ordinal index from list_tablix_filters
add_row_group / remove_row_groupWrap the row hierarchy in a new outer group + header row (and its inverse)
add_column_group / remove_column_groupSame, on the column axis
convert_to_matrixPromote a table to a matrix (row + column groups) — see docs/MATRIX-cookbook.md
set_tablix_cornerSet the matrix corner cell text/expression
set_group_sort / set_column_group_sortReplace <SortExpressions> on a group
set_group_visibility / set_column_group_visibilitySet <Visibility> on a group's TablixMember
set_detail_row_visibilitySet <Visibility> on the Details group
add_tablix_column / remove_tablix_columnAdd/drop a column across the tablix grid
add_static_row / add_static_columnInsert a non-grouped row/column
add_subtotal_row / add_subtotal_columnInsert an aggregate row/column on a group
set_cell_spanSet RowSpan / ColSpan on a cell
set_column_width / set_row_heightSet <Width> / <Height> on the Nth column/row
set_tablix_sizeSet the tablix's overall <Width> / <Height> (distribute=true rescales the columns to a new width; column edits keep <Width> in sync on their own)
set_repeat_header_rowsRepeat the column header rows on every page

Page

ToolWhat it edits
set_page_setupPage dimensions, margins, columns. All fields optional.
set_page_orientationSwap PageHeight/PageWidth to match Portrait or Landscape. Idempotent.

Page header & footer

Same set of operations for each region, each accepts named items so follow-up edits don't drift on indices.

ToolWhat it edits
set_page_header / set_page_footerSection height + PrintOnFirstPage / PrintOnLastPage
add_header_textbox / add_footer_textboxAppend a Textbox (static text or =expression)
add_header_image / add_footer_imageAppend an Image (External URL, Embedded name, or Database expression)
remove_header_item / remove_footer_itemRemove by name; tidies empty <ReportItems>

Body composition

ToolWhat it edits
add_body_textboxAppend a Textbox to <Body>/<ReportItems>
add_body_imageAppend an Image to the body
remove_body_itemRemove a named report item from the body; refuses while other items still reference it unless force=true
rename_report_itemRename a report item or group and rewrite every reference to it

Snippet templates

Single-call inserts of common report items, programmatically built and appended to the body.

ToolWhat it builds
insert_tablix_from_templateA basic Tablix mirroring the fixture's shape — header row with the column name as a static label, detail row binding to =Fields!<column>.Value. One column per requested field.
insert_chart_from_templateA basic Column chart: single category axis grouped by category_field, single Y series =Sum(Fields!<value_field>.Value). Change <Type> post-insert (Bar / Line / Pie / etc.).

Charts

Refine a chart after insert_chart_from_template (or any existing <Chart>).

ToolWhat it edits
add_chart_series / remove_chart_seriesManage Y-axis <ChartSeries>
set_chart_series_typeColumn / Bar / Line / Area / Pie / ... per series
set_chart_series_groupingCategory/series grouping expression
set_chart_axisCategory / value axis title, scale, format
set_chart_legendLegend visibility and placement
set_chart_data_labelsToggle and format data labels
set_chart_titleChart title text/expression
set_chart_palette / set_series_colorAny of the 16 RDL palettes or custom colours; explicit per-series or per-point colour
set_chart_series_propertiesLegend entry, secondary axis, chart area, order, tooltip, markers, empty points of one series
set_chart_category_groupEdit a category group's label, sort or field, or add a nested level

Styling

ToolWhat it edits
set_textbox_styleRoutes properties to the right nested <Style> node automatically: box-level (BackgroundColor, Border, VerticalAlign), paragraph-level (TextAlign), run-level (FontFamily, FontSize, FontWeight, Color, Format)
set_textbox_style_bulkApply one style to many textboxes in a single call
copy_textbox_styleCopy one textbox's formatting onto others
set_textbox_runs / set_textbox_valueRich multi-run paragraph content; or replace the value
find_textboxes_by_style / find_textbox_by_valueLocate textboxes to target follow-up edits
style_tablix_rowStyle every cell of a tablix row at once (header / detail / footer)
set_alternating_row_colorZebra-stripe a tablix's detail row with BackgroundColor=IIf(RowNumber(Nothing) Mod 2, "<a>", "<b>")
set_conditional_row_colorDrive detail-row BackgroundColor from an expression
set_image_sizing / set_image_sourceImage <Sizing>; switch External / Embedded / Database source

Visibility

ToolWhat it edits
set_element_visibilitySet <Visibility> on any named ReportItem (Tablix, Textbox, Image, Rectangle, Subreport, Chart). Group / detail-row visibility have their own tools.

Layout containers

ToolWhat it builds
add_rectangleA <Rectangle> container (group other items, control page breaks)
add_listA list region (single-column tablix template)
add_lineA <Line> report item
ungroup_rectangleRemove a rectangle, moving its items out to its container in place

Positioning & sizing

Move and resize named items in each region. Coordinates are RDL sizes ("1in", "2.5cm", ...).

ToolWhat it edits
set_body_item_position / set_header_item_position / set_footer_item_positionTop / Left of a named item
set_body_item_size / set_header_item_size / set_footer_item_sizeWidth / Height of a named item
set_body_sizeThe <Body> region's overall height
move_report_item / center_item / fit_page_to_bodyMove an item between the body, header, footer and rectangles; centre it in its container; fix a body wider than the page

Interactivity

ToolWhat it edits
set_textbox_action / set_image_action / set_chart_series_action<Action>: hyperlink, drill-through, or bookmark
set_item_actionThe same, on any Textbox / Image / Rectangle / Line
set_textbox_tooltip / set_item_tooltip<ToolTip> on a textbox / any report item
set_bookmark<Bookmark> on any report item (target of BookmarkLink actions)
set_document_map_label<DocumentMapLabel> for the navigation pane

Pagination

ToolWhat it edits
set_group_page_break<Group><PageBreak> (Start / End / Between)
set_repeat_on_new_pageRepeat a group header/footer on each page
set_keep_together / set_keep_with_groupKeep-together rendering hints

Parameters (advanced)

ToolWhat it edits
add_parameter / remove_parameter / rename_parameterManage <ReportParameter> elements
set_parameter_prompt / set_parameter_typePrompt text; data type (Boolean / DateTime / Integer / Float / Text)
set_parameter_available_valuesStatic <ParameterValues> list (strings or {value, label} dicts) or <DataSetReference> to a lookup dataset
set_parameter_default_valuesStatic <Values> list or <DataSetReference> (defaults take ValueField only — defaults are values, not display strings)
update_parameter_advancedToggle the four boolean flags: multi_value, hidden, allow_null (writes <Nullable>), allow_blank
reorder_parametersReorder <ReportParameters> (controls prompt order)
set_parameter_layout / sync_parameter_layoutPosition parameters in the <ReportParametersLayout> grid

Cascading parameters

RDL has no <DependsOn> element — cascading is inferred from =Parameters!X.Value references in a lookup dataset's <QueryParameters>. To wire parameter B to depend on parameter A:

  1. set_parameter_available_values(name="B", source="query", query_dataset="LookupB", ...)
  2. add_query_parameter(dataset_name="LookupB", name="@A", value_expression="=Parameters!A.Value")

Report Builder figures out the dependency graph by parsing those expressions.

Embedded images

ToolWhat it edits
add_embedded_imageRead a real file off disk, base64-encode it, store under <EmbeddedImages>
list_embedded_imagesNames + MIME types
remove_embedded_imageRemove by name; tidies empty <EmbeddedImages>

Reference an embedded image with add_*_image(image_source="Embedded", value="<image-name>").

Report lifecycle

ToolWhat it does
create_reportScratch-create a minimal valid .rdl to start from
duplicate_reportCopy a report to a new path
backup_report / list_backups / restore_from_backupSnapshot a report (optional folder and label), list its backups and roll back to one (set PBIRB_MCP_AUTO_BACKUP=1 for automatic backups before destructive edits)

Expression helpers

These don't mutate the report — they build correct RDL expression strings to pass into other tools (text, filters, conditional styling).

ToolWhat it returns
count_where / sum_whereA Count/Sum aggregate expression with an inline condition
iif_formatAn IIf(...) expression for conditional values/formatting
get_expression_referenceA reference sheet of common RDL expression patterns

Transactions & validation

Batch many edits into one atomic save, and check correctness before/after.

ToolWhat it does
start_editing_transaction / commit_editing_transaction / cancel_editing_transactionOpen an in-memory transaction, verify (XSD + lint, new errors only) and save once, or discard. See docs/TRANSACTIONS.md.
apply_editsApply a list of tool calls in one transaction
dry_run_editPreview an edit's effect without writing to disk
diff_reportSemantic diff of a report against a baseline (added / removed / changed items, ignoring layout noise)
validate_report / verify_reportStructural + XSD validation against the bundled reportdefinition.xsd; verify_report adds lint
lint_reportSurface warnings/errors Report Builder would flag

Raw XML escape hatch

ToolWhat it does
raw_xml_viewRead the XML under an XPath
raw_xml_replaceReplace the XML at an XPath — last resort for anything without a dedicated tool
raw_xml_insert / raw_xml_removeInsert XML at an XPath; remove the node(s) it matches

Power BI specifics

XMLA connection strings

set_datasource_connection writes the canonical form:

Data Source=powerbi://api.powerbi.com/v1.0/myorg/<workspace>;Initial Catalog=<dataset>

workspace_url accepts a bare workspace name (Finance) or a full powerbi:// URL — the tool detects the latter and avoids double-prefixing. DataProvider is set to SQL (the Analysis Services provider id RDL uses for PBI XMLA, despite the misleading name).

DAX queries

DAX bodies are accepted verbatim — pbirb-mcp doesn't parse DAX, so the user (or Report Builder at preview time) is the source of truth for syntax. Empty bodies are rejected up front because Report Builder loads them but errors at preview, which is a worse signal than a clear ValueError here.

PBI paginated reports do not carry <CommandType> for DAX (unlike SSRS where you'd set CommandType=StoredProcedure); these tools never emit it.

Pre-commit hooks (contributors)

pre-commit is in the [dev] extras. After a fresh checkout:

uv pip install --python .venv/bin/python -e ".[dev]"
.venv/bin/pre-commit install                # one-time — installs the git hook
.venv/bin/pre-commit run --all-files        # one-time — clean any drift

After the hook is installed, every git commit runs ruff format + ruff check (with --fix) + the fast pytest suite. If lint or tests fail the commit is aborted; fix and re-stage before retrying.

To run individual hooks ad-hoc:

.venv/bin/pre-commit run ruff --all-files
.venv/bin/pre-commit run ruff-format --all-files
.venv/bin/pre-commit run pytest-fast --all-files

The full config lives in .pre-commit-config.yaml. Ruff settings (line length, rule selection, per-file ignores) live under [tool.ruff*] in pyproject.toml.

Report Builder install

Power BI Report Builder is a free Microsoft-distributed Windows app:

https://www.microsoft.com/en-us/download/details.aspx?id=105942

Open any .rdl produced by pbirb-mcp directly in Report Builder. The "opens cleanly with no upgrade prompt" check is the actual integration test — the unit tests verify schema correctness, but lxml will round-trip XML that Report Builder's deserialiser still rejects (we hit this twice in the chart-template work; both fixes are documented in the git history).


Architecture

pbirb-mcp/
├── pbirb_mcp_server.py         # Entry point (CLI flags, logging, main())
├── pbirb_mcp/
│   ├── protocol.py             # MCP protocol on the official SDK (stdio, versions)
│   ├── server.py               # Tool registry + dispatcher, annotations
│   ├── tools.py                # Tool definitions — wires ops into the server
│   ├── core/
│   │   ├── security.py         # Allowed roots, confirmation, audit log
│   │   ├── toolsets.py         # Toolsets + read-only mode
│   │   ├── document.py         # RDLDocument: open/save (lxml), atomic write
│   │   ├── xpath.py            # Namespace-aware XPath helpers
│   │   ├── ids.py              # Stable element addressing
│   │   ├── encoding.py         # XML declaration / self-closing-tag fidelity
│   │   ├── transactions.py     # In-memory transaction registry
│   │   └── schema.py           # Structural + opt-in XSD validation
│   ├── ops/                    # One module per RDL concern; wired into tools.py
│   │   ├── reader.py           # describe / get_datasets / get_params / get_tablixes
│   │   ├── datasource.py       # PBI XMLA connection + data-source management
│   │   ├── dataset.py          # DAX body, query params, fields, calc fields, filters
│   │   ├── tablix.py           # Row/column groups, sort, visibility, matrix
│   │   ├── tablix_columns.py   # Add/remove tablix columns
│   │   ├── tablix_cells.py     # Cell span
│   │   ├── tablix_static.py    # Static rows / columns
│   │   ├── tablix_subtotals.py # Subtotal rows / columns
│   │   ├── chart.py            # Chart series, axes, legend, labels, palette
│   │   ├── page.py             # Page setup + orientation
│   │   ├── layout.py           # Pagination (page breaks, keep-together, repeat)
│   │   ├── header_footer.py    # Page header / footer authoring
│   │   ├── body.py             # Body textboxes / images / containers / removal
│   │   ├── positioning.py      # Move / resize named items per region
│   │   ├── templates.py        # Chart + tablix snippet builders
│   │   ├── styling.py          # Textbox styles, runs, bulk, row styling, find
│   │   ├── images.py           # Image sizing / source
│   │   ├── actions.py          # Actions, tooltips, document-map labels
│   │   ├── visibility.py       # Element-level visibility
│   │   ├── parameters.py       # Lifecycle, values, advanced flags, layout
│   │   ├── embedded_images.py  # Base64 image embedding
│   │   ├── expressions.py      # Expression-builder helpers (count/sum/iif)
│   │   ├── filter_types.py     # Filter operator definitions
│   │   ├── clone.py            # duplicate_report
│   │   ├── scratch.py          # create_report
│   │   ├── snapshot.py         # backup / restore
│   │   ├── transactions.py     # start/commit/cancel + apply_edits
│   │   ├── dry_run.py          # dry_run_edit
│   │   ├── validate.py         # validate / verify
│   │   ├── lint.py             # lint_report
│   │   └── escape.py           # raw_xml_view / raw_xml_replace
│   └── schemas/                # Bundled RDL 2016 XSD (reportdefinition.xsd) for opt-in validation
└── tests/
    ├── fixtures/
    │   └── pbi_paginated_minimal.rdl  # Hand-tuned to match Report Builder's emitted style
    └── test_*.py               # every tool plus round-trip invariants

Hard rules (enforced by tests)

  • Tests first. Every commit writes failing tests, then makes them pass.
  • lxml, not stdlib xml.etree. Round-trip fidelity is a feature, not polish. Report Builder reads what's on disk; formatting drift causes silent corruption.
  • Stable IDs, never indices. Tools take tablix_name + group_name, not column_index: 2. Indices break across multi-step edits.
  • Atomic save. Every write goes to a temp file next to the report and is renamed over it (core.document.write_atomic), following symlinks and keeping the file's mode. A failure mid-write never leaves a half-written report.
  • Round-trip byte-identity is enforced by tests/test_byte_fidelity.py (BOM × CRLF × trailing-newline matrix, Report Builder's MustUnderstand root and <Style></Style> form) and tests/test_document.py. A no-op open → save → reopen produces a byte-identical file, and a one-value edit changes one line.

RDL gotchas learned the hard way

  • <?xml version="1.0" encoding="utf-8"?> uses double quotes, not lxml's default single quotes. Fixed in RDLDocument.save_as via a manual declaration.
  • Self-closing tags use <Tag /> with a space, not <Tag/>. Fixed via a post-process regex.
  • The rd: prefix (http://schemas.microsoft.com/SQLServer/reporting/reportdesigner) carries designer metadata Report Builder relies on. Don't strip it; preserve prefixes.
  • Do not put MustUnderstand="df" on <Report> unless you also declare xmlns:df=....
  • <ChartCategoryAxes> / <ChartValueAxes> hold <ChartAxis> children directly — there is no <ChartCategoryAxis> / <ChartValueAxis> wrapper.
  • <ChartMember> requires a <Label> child, even an empty one.
  • DAX queries live in <DataSet><Query><CommandText>EVALUATE ...</CommandText></Query></DataSet>. No <CommandType> element for DAX (unlike SSRS).

Development

Running tests

.venv/bin/python -m pytest tests/ -v

The suite is fast (well under a minute) so re-run on every change.

Smoke testing the live binary

printf '%s\n' \
  '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"smoke","version":"1"}}}' \
  '{"jsonrpc":"2.0","method":"notifications/initialized"}' \
  '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \
  | .venv/bin/pbirb-mcp

For an end-to-end sanity check, drive an actual mutation against a copy of the bundled fixture:

SCRATCH=$(mktemp -d)/r.rdl
cp tests/fixtures/pbi_paginated_minimal.rdl "$SCRATCH"
.venv/bin/python -c "
from pbirb_mcp.ops.dataset import update_dataset_query
update_dataset_query(path='$SCRATCH', dataset_name='MainDataset',
    dax_body=\"EVALUATE TOPN(10, 'Sales')\")
print('Wrote', '$SCRATCH')
"

Open the resulting file in Power BI Report Builder. Manual verification that an .rdl opens cleanly is the actual integration test — the unit tests catch schema-level mistakes, but only Report Builder catches deserialiser nits.

Adding a new tool

  1. Write tests first under tests/test_*.py.
  2. Implement in the appropriate pbirb_mcp/ops/*.py module (or create a new one).
  3. Register in pbirb_mcp/tools.py with a short description (purpose first, at most 400 characters, no release history — longer notes go in docs/TOOLS.md) and a strict inputSchema; add it to a toolset in pbirb_mcp/core/toolsets.py.
  4. Run the full suite and a JSON-RPC smoke against the fixture.
  5. Open the modified RDL in Report Builder.

The commit-by-commit history shows the pattern in practice.


Releases

CHANGELOG.md tracks every release in Keep a Changelog format. Releases are also published as GitHub Releases and to PyPI.

Versions follow SemVer adapted for an MCP tool surface — see CONTRIBUTING.md § Versioning.

Contributing

PRs welcome. CONTRIBUTING.md covers dev setup, the hard rules (tests-first, lxml only, stable IDs, atomic save, byte-identity round-trip, smoke in Report Builder), the SemVer-for-MCP bump table, and the PR review checklist.

Bug reports and tool proposals: please use the issue templates. For security issues, see SECURITY.md. All participants are expected to follow the Code of Conduct.


Acknowledgments

The existing bethmaloney/rdl-mcp server pioneered the MCP-over-RDL pattern but is scoped to SSRS: column metadata, basic parameter management, stored-procedure swap. Power BI paginated reports use the same RDL 2016 schema as SSRS, but:

  1. Data sources are Power BI XMLA endpoints, not SQL Server.
  2. Queries are DAX, and the upstream tool exposes no body-edit (only stored-procedure name swap, useless here).
  3. Report Builder is picky about XML round-tripping — formatting drift, namespace prefix loss, or unrecognised MustUnderstand attributes cause silent corruption or "this report needs to be upgraded" prompts.

pbirb-mcp is built around lxml so a no-op edit produces a byte-identical file, addresses every element by stable name (never index), and treats "opens cleanly in Report Builder" as the actual integration test.


mcp-name: io.github.mafaq229/pbirb-mcp

Frequently asked questions

What is pbirb-mcp MCP Server?

MCP server for editing Power BI Report Builder paginated reports (RDL)

How do I install pbirb-mcp MCP Server in Claude Desktop, Cursor, or VS Code?

Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. pbirb-mcp MCP Server runs locally from the PyPI package pbirb-mcp with the command uvx pbirb-mcp.

Is pbirb-mcp MCP Server free and open source?

Yes. pbirb-mcp MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.

Does pbirb-mcp MCP Server support remote (HTTP) connections?

No remote endpoint is listed for pbirb-mcp MCP Server. It runs locally on your machine over stdio, started by your MCP client.

What tools does pbirb-mcp MCP Server provide?

pbirb-mcp MCP Server provides 40 tools, including add_body_image, add_body_textbox, add_query_parameter, and add_tablix_filter. See the full tool list for descriptions and parameters.

How is pbirb-mcp MCP Server's trust score calculated?

pbirb-mcp MCP Server scores 69 out of 100 (Good). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.

Reviews

No reviews yet

—Be the first to review

5 star0 reviews at 5 stars
4 star0 reviews at 4 stars
3 star0 reviews at 3 stars
2 star0 reviews at 2 stars
1 star0 reviews at 1 stars

No published reviews yet. Used it? Tell the next person how it went.

Add badge to your README

Paste either snippet into the repository README. The image links to this listing.

Listed on MCPpedia

Top 5 MCP servers

Daily or weekly. Confirm by email, unsubscribe any time.

How often

Manage this listing

Claim this server