npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@drinus76/powerbi-mcp

v1.0.0

Published

MCP server per interrogare modelli semantici Power BI via service principal (OAuth client credentials)

Downloads

180

Readme

@drinus76/powerbi-mcp

MCP server Node.js per interrogare modelli semantici Power BI tramite la Execute Queries REST API di Microsoft, usando autenticazione headless via service principal (OAuth 2.0 client credentials).

Pensato per agenti AI in cloud o ambienti server, sullo stesso pattern dei connettori MCP per database (es. @connorbritain/mssql-mcp-server).

Caratteristiche

  • Trasporto MCP stdio (standard)
  • Autenticazione service principal Microsoft Entra ID (client credentials)
  • Nessun login interattivo, nessun browser, nessun token statico da rinnovare a mano
  • Cache automatica del token con rinnovo (~5 minuti prima della scadenza)
  • Espone un solo tool: execute_dax_query

Installazione

Nessuna installazione manuale: si usa via npx. Configurazione MCP client:

{
  "mcpServers": {
    "powerbi": {
      "command": "npx",
      "args": ["-y", "@drinus76/powerbi-mcp@latest"],
      "env": {
        "AZURE_TENANT_ID": "...",
        "AZURE_CLIENT_ID": "...",
        "AZURE_CLIENT_SECRET": "...",
        "POWERBI_WORKSPACE_ID": "...",
        "POWERBI_DATASET_ID": "..."
      }
    }
  }
}

Variabili d'ambiente

| Variabile | Descrizione | |-----------|-------------| | AZURE_TENANT_ID | Tenant ID di Microsoft Entra ID | | AZURE_CLIENT_ID | Application (client) ID del service principal | | AZURE_CLIENT_SECRET | Client secret (Valore, non ID) | | POWERBI_WORKSPACE_ID | ID del workspace Power BI | | POWERBI_DATASET_ID | ID del modello semantico di default |

Prerequisiti lato Power BI

  1. Registrare un'app in Microsoft Entra ID e generare un client secret.
  2. Nelle impostazioni tenant di Power BI abilitare:
    • "Modello semantico Esecuzione di query API REST"
    • "Le entità servizio possono chiamare le API pubbliche di Fabric"
  3. Aggiungere il service principal come Membro del workspace (preferibilmente tramite un gruppo di sicurezza Entra ID).

Tool esposti

execute_dax_query

Esegue una query DAX e restituisce il risultato in JSON.

Input:

  • query (string, obbligatorio): la query DAX da eseguire.
  • datasetId (string, opzionale): ID di un dataset diverso da quello di default.

Esempi di query utili:

  • Elenco tabelle: EVALUATE INFO.VIEW.TABLES()
  • Elenco colonne: EVALUATE INFO.VIEW.COLUMNS()
  • Elenco misure: EVALUATE INFO.VIEW.MEASURES()
  • Top 10 righe: EVALUATE TOPN(10, 'NomeTabella')

Limiti noti

  • La Execute Queries API Microsoft ha un tetto di 100.000 righe per risposta. Per query potenzialmente grandi conviene aggregare in DAX.
  • Le query molto lunghe possono superare il timeout di default dell'API (60 secondi).
  • Su modelli con compatibility level più basso, alcune funzioni INFO.* non sono disponibili: usare le varianti INFO.VIEW.*.

Sviluppo locale

git clone https://github.com/drinus76/powerbi-mcp.git
cd powerbi-mcp
npm install
npm run build
npm start

Per i test, esportare le 5 variabili d'ambiente prima di npm start.

Licenza

MIT — vedi LICENSE.