Skip to main content
Glama

powerbi-pbip-mcp

Server MCP (Model Context Protocol) cross-platform (Windows, macOS, Linux) in TypeScript per creare e modificare progetti Power BI Project (.pbip) utilizzando i formati ufficiali Microsoft:

  • TMDL (Tabular Model Definition Language) → Modello Dati, Relazioni, Misure DAX e script Power Query (M)

  • PBIR (Power BI Enhanced Report Format) → Pagine, Visual Builder tipizzato e Temi JSON

Funziona senza dipendenze Windows (nessun binario VertiPaq locale): puoi generare e modificare un intero progetto Power BI da Mac, Linux o Windows, aprirlo con doppio clic su Power BI Desktop (Windows) o pubblicarlo direttamente su Microsoft Fabric / Power BI Service.


🤖 Guida Auto-Install per AI Agent (GitHub Copilot / Cursor / Claude / Antigravity)

Per l'utente: incolla il link di questo repository nella chat del tuo AI Agent (es. GitHub Copilot in Agent Mode) e scrivi:
"Leggi il README di questo repo e installa/configura questo MCP server sul mio PC."

Istruzioni operative per l'Agent

Se sei un AI Agent incaricato di installare questo MCP server sulla macchina dell'utente, esegui questi passaggi in ordine senza chiedere conferme superflue:

  1. Verifica prerequisiti

    • Controlla che git, node (>= 20) e npm siano installati (node -v && npm -v && git --version).

    • Se node manca o è < 20, avvisa l'utente e fermati.

  2. Clona il repository in una cartella stabile

    • Windows (PowerShell):

      $dest = "$env:USERPROFILE\.mcp-servers\powerbi-pbip-mcp"
      New-Item -ItemType Directory -Force -Path (Split-Path $dest) | Out-Null
      if (Test-Path $dest) { git -C $dest pull } else { git clone https://github.com/Valerio357/powerbi-pbip-mcp.git $dest }
    • macOS / Linux (bash/zsh):

      DEST="$HOME/.mcp-servers/powerbi-pbip-mcp"
      mkdir -p "$(dirname "$DEST")"
      if [ -d "$DEST" ]; then git -C "$DEST" pull; else git clone https://github.com/Valerio357/powerbi-pbip-mcp.git "$DEST"; fi

    (Se sei già dentro il repository clonato, usa la directory corrente.)

  3. Installa le dipendenze, compila e verifica i test

    cd "$DEST" # (o $dest su PowerShell)
    npm install
    npm run build
    npm test

    Verifica che esista il file compilato dist/index.js e che tutti i test passino (fail 0).

  4. Registra il server MCP nel client dell'utente Usa sempre il percorso assoluto di dist/index.js (su Windows usa forward slash C:/Users/.../dist/index.js oppure doppi backslash C:\\Users\\...\\dist\\index.js).

    • VS Code / GitHub Copilot (a livello workspace): crea o aggiorna .vscode/mcp.json facendo merge (non sovrascrivere eventuali altri server già presenti):

      {
        "servers": {
          "powerbi-pbip": {
            "type": "stdio",
            "command": "node",
            "args": ["<PERCORSO_ASSOLUTO>/dist/index.js"]
          }
        }
      }
    • VS Code / GitHub Copilot (globale per utente, se non c'è un workspace aperto):

      • Windows: %APPDATA%\Code\User\mcp.json

      • macOS: ~/Library/Application Support/Code/User/mcp.json

      • Linux: ~/.config/Code/User/mcp.json (Stesso formato JSON sopra con chiave root "servers".)

    • Claude Desktop / Cursor: usa la chiave "mcpServers" al posto di "servers":

      {
        "mcpServers": {
          "powerbi-pbip": {
            "command": "node",
            "args": ["<PERCORSO_ASSOLUTO>/dist/index.js"]
          }
        }
      }
  5. Smoke test finale via stdio Verifica che il server risponda correttamente a initialize:

    • macOS / Linux:

      printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"check","version":"1.0"}}}\n' | node "$DEST/dist/index.js"
    • Windows (PowerShell):

      '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"check","version":"1.0"}}}' | node "$dest\dist\index.js"
  6. Conferma all'utente Comunica il percorso installato, il file di configurazione aggiornato, ricorda di riavviare/ricaricare il server MCP in VS Code (icona Start in mcp.json o Developer: Reload Window) e di verificare in Power BI Desktop (File → Opzioni → Funzionalità di anteprima) che siano attivi:

    • Salvataggio progetti Power BI (.pbip)

    • Archiviazione report con formato metadati avanzato (PBIR)

    • Formato TMDL


Related MCP server: pbix-mcp

Funzionalità incluse (18 tool MCP)

Il server copre l'intero ciclo di authoring di un progetto Power BI attraverso 5 moduli:

1. Gestione Progetto (.pbip)

Tool

Cosa fa

pbip_create_project

Crea da zero l'intera struttura .pbip (<Nome>.pbip, <Nome>.SemanticModel/ in TMDL, <Nome>.Report/ in PBIR, tema base CY24SU10.json, metadati .platform per Fabric Git e prima pagina pronta all'uso).

pbip_inspect_project

Analizza qualsiasi progetto .pbip esistente (anche creato da Power BI Desktop) e restituisce un riepilogo strutturato di tabelle, colonne, misure, partizioni M, espressioni condivise, relazioni, pagine e visual.

2. Power Query (Codice M)

Tool

Cosa fa

pq_set_table_query

Scrive o sostituisce la partizione Power Query (partition ... = m) di una tabella con il codice M (let ... in ...) e storage mode (import, directQuery, dual).

pq_upsert_expression

Crea o aggiorna parametri Power Query (meta [IsParameterQuery=true, ...]) e query M condivise in definition/expressions.tmdl.

pq_get_queries

Legge tutti gli script M delle partizioni delle tabelle e delle espressioni condivise.

3. Modello Dati (TMDL)

Tool

Cosa fa

model_upsert_table

Crea o aggiorna file definition/tables/<Tabella>.tmdl in modo non distruttivo (preserva blocchi/annotazioni esistenti), gestisce colonne fisiche e calcolate DAX (dataType, formatString, summarizeBy, sortByColumn, isHidden, description), partizioni M o tabelle calcolate DAX (CALENDARAUTO(), ecc.) e registra automaticamente ref table in model.tmdl.

model_delete_table

Elimina il file .tmdl della tabella e rimuove il riferimento da model.tmdl.

model_upsert_relationship

Crea o aggiorna relazioni in definition/relationships.tmdl (fromTable.fromColumn → toTable.toColumn, cardinalità, filtro singolo o bidirezionale bothDirections, stato isActive).

model_delete_relationship

Rimuove una relazione per GUID o per coppia tabella/colonna.

4. DAX Editor

Tool

Cosa fa

dax_upsert_measure

Crea o aggiorna misure DAX (singola riga o multi-linea indentate secondo lo standard TMDL), supporta formatString, displayFolder, description (commenti ///), isHidden e preserva il lineageTag esistente.

dax_delete_measure

Elimina una misura DAX dalla tabella indicata lasciando intatti colonne e partizioni.

dax_list_measures

Elenca tutte le misure DAX del modello (o di una singola tabella) con formule, cartelle e formati.

5. Visual Builder (PBIR)

Tool

Cosa fa

report_create_page

Crea una nuova pagina PBIR (page.json, dimensioni canvas personalizzabili, FitToPage / FitToWidth / ActualSize) e la registra in pages.json.

report_delete_page

Elimina una pagina e aggiorna pages.json e activePageName.

report_add_visual

Builder ad alto livello che genera visual.json conforme agli schemi PBIR Microsoft con binding queryState corretti (Entity/Property, Column/Measure, ordinamento sortDefinition, titolo e posizionamento x, y, width, height, z).

report_update_visual

Aggiorna posizione, dimensioni, titolo, testo o campi associati di un visual esistente.

report_delete_visual

Rimuove un visual da una pagina.

report_set_theme

Salva un tema JSON custom in StaticResources/RegisteredResources/ e lo collega automaticamente in definition/report.json.

Tipi di visual supportati nativamente da report_add_visual:

  • Grafici ad assi: clusteredColumnChart, clusteredBarChart, stackedColumnChart, stackedBarChart, lineChart, areaChart (category, values, series opzionale)

  • Torte / Ciambelle: pieChart, donutChart (category, values)

  • KPI Card: card (classica) e cardVisual (nuova card multi-metrica)

  • Tabelle e Matrici: tableEx (values) e pivotTable (rows, columns, values)

  • Filtri e Testo: slicer (values) e textbox (text, fontSizePt)


Esempio di prompt con GitHub Copilot

"Usa powerbi-pbip per creare un progetto chiamato Vendite2026 in C:/Projects/BI con cultura it-IT. Aggiungi un parametro Power Query CartellaDati, la tabella Vendite da CSV con colonne DataOrdine, Regione, Importo, una tabella Calendario calcolata con CALENDARAUTO(), collegale in relazione, aggiungi la misura DAX Fatturato Totale formattata in euro e crea una dashboard nella prima pagina con una KPI card, uno slicer su Regione e un grafico a colonne Fatturato per Regione ordinato decrescente."


Uso combinato con Power BI Desktop su Windows

Questo server lavora direttamente sui file .pbip (quindi gira uguale su Mac e Windows e copre anche il Visual Builder PBIR).
Quando sei sul PC Windows con Power BI Desktop aperto e vuoi anche eseguire query DAX live sui dati caricati in memoria, puoi affiancarlo nello stesso .vscode/mcp.json al server ufficiale Microsoft microsoft/powerbi-modeling-mcp.


Sviluppo locale

npm install
npm run build      # Compila TypeScript -> dist/index.js
npm test           # Compila ed esegue i test end-to-end MCP
npm run inspector  # Avvia MCP Inspector interattivo

Available Tools

18 tools
dax_delete_measureC

Delete a DAX measure from a table's .tmdl file.

Inputs: tableName (required), measureName (required), projectPath (required).

dax_list_measuresA

List all DAX measures (with expressions, format strings, folders, descriptions) across the model or for a single table.

Inputs: projectPath (required), tableName.

dax_upsert_measureA

Create or update a DAX measure inside a table's .tmdl file (preserves existing lineageTag, columns, and partitions).

Inputs: tableName (required), expression (required), measureName (required), projectPath (required), +4 more.

model_delete_relationshipB

Delete a relationship by ID or by (fromTable, fromColumn, toTable, toColumn).

Inputs: projectPath (required), id, toTable, toColumn, +2 more.

model_delete_tableB

Delete a table .tmdl file and remove its reference from model.tmdl.

Inputs: tableName (required), projectPath (required).

model_upsert_relationshipC

Create or update a relationship between two tables in definition/relationships.tmdl.

Inputs: toTable (required), toColumn (required), fromTable (required), fromColumn (required), +5 more.

model_upsert_tableC

Create or update a semantic model table (.tmdl) with columns (physical or DAX calculated) and an optional Power Query M or DAX calculated table partition.

Inputs: tableName (required), projectPath (required), columns, isHidden, +2 more.

pbip_create_projectA

Create a new cross-platform Power BI Project (.pbip) with TMDL semantic model and PBIR report structure, ready to open in Power BI Desktop or deploy to Fabric.

Inputs: parentDir (required), projectName (required), culture, initialPageName, +1 more.

pbip_inspect_projectA

Inspect an existing Power BI Project (.pbip) directory or .pbip file and summarize its semantic model (tables, columns, measures, Power Query M partitions, expressions, relationships) and PBIR report (pages, visuals).

Inputs: projectPath (required).

pq_get_queriesA

Read all Power Query M partitions across tables and shared expressions/parameters from expressions.tmdl.

Inputs: projectPath (required), tableName.

pq_set_table_queryA

Create or replace the Power Query M partition script for a table in the TMDL semantic model (creates the table file if it does not exist yet).

Inputs: tableName (required), mExpression (required), projectPath (required), mode, +1 more.

pq_upsert_expressionB

Create or update a shared Power Query M expression or parameter in definition/expressions.tmdl.

Inputs: name (required), mExpression (required), projectPath (required), description, +2 more.

report_add_visualB

Add a visual to a PBIR report page (charts, cards, tables, matrices, slicers, textboxes) with validated Microsoft PBIR visual.json schema and queryState projections.

Inputs: pageId (required), position (required), visualType (required), projectPath (required), +9 more.

report_create_pageB

Create a new PBIR report page (page.json) and register it in pages.json.

Inputs: displayName (required), projectPath (required), width, height, +2 more.

report_delete_pageC

Delete a report page folder and remove it from pages.json.

Inputs: pageId (required), projectPath (required).

report_delete_visualC

Remove a visual from a PBIR report page.

Inputs: pageId (required), visualId (required), projectPath (required).

report_set_themeC

Apply a custom Power BI JSON theme to the report and register it in definition/report.json.

Inputs: theme (required), themeName (required), projectPath (required).

report_update_visualC

Update position, size, title, text, or data bindings of an existing PBIR visual.

Inputs: pageId (required), visualId (required), projectPath (required), rows, +7 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 18 tools

    Disambiguation4/5

    Each tool targets a specific PBIP artifact or action (pages, visuals, themes, tables, relationships, measures, queries, project), so most selections are clear. A few boundaries are soft: model_upsert_table can also create a table partition, overlapping somewhat with pq_set_table_query, and pbip_inspect_project overlaps with dax_list_measures/pq_get_queries as a broad summary.

    Naming Consistency4/5

    All tools use snake_case and follow a predictable domain-prefix + verb + object pattern (report_*, model_*, dax_*, pq_*, pbip_*). There is minor verb variation for create/update semantics (create, add, upsert, set), but the overall naming is readable and consistent.

    Tool Count4/5

    The 18 tools map cleanly across five coherent subdomains: report, model, DAX, Power Query, and PBIP project management. This is slightly above the ideal 3-15 range, but each tool corresponds to a real operation and the breadth fits the domain.

    Completeness4/5

    Core lifecycle coverage is solid: measures have list/upsert/delete, tables and relationships have upsert/delete, visuals have add/update/delete, and inspect provides broad read access. Notable gaps remain for report page update/rename and deletion of shared Power Query expressions, and several resources lack direct read/list tools beyond the broad inspector.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      MCP server for creating, editing, and evaluating Power BI (.pbix/.pbit) files without Power BI Desktop. Supports 101 tools including report creation, data sources, DAX measures, and file manipulation.
      1,278 PyPI
      25
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      The Power BI Modeling MCP Server implements the MCP specification to create a seamless connection between AI agents and Power BI semantic models. This allows developers and AI applications to interact with Power BI models in entirely new ways, from using natural language to execute modeling changes to autonomous AI agentic development workflows.
      1,297
      MIT