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

powerbi-mcp-server

v0.1.0

Published

MCP server for interacting with Power BI semantic models via DAX queries

Readme

Power BI MCP Server

An MCP (Model Context Protocol) server that connects to Power BI semantic models, enabling natural language queries via DAX through AI assistants like Claude.

Features

  • List workspaces — Browse all Power BI workspaces you have access to
  • List datasets — See semantic models in any workspace
  • Discover model schema — Inspect tables, columns, measures, and data types via DMV queries
  • Execute DAX queries — Run DAX EVALUATE statements and get structured results
  • Refresh datasets — Trigger and monitor dataset refreshes
  • Get dataset details — View metadata for any semantic model

Authentication

Authenticates with Microsoft Entra ID, following the same patterns as the Azure MCP and Azure DevOps MCP servers. Three modes are supported:

| Mode | Flag | Description | |------|------|-------------| | Interactive (default) | --authentication interactive | Opens a browser for OAuth login | | Azure CLI | --authentication azcli | Uses your az login session | | Environment | --authentication env | Uses DefaultAzureCredential (service principal env vars, managed identity, etc.) |

You can optionally pass --tenant <tenant-id> for single-tenant or B2B scenarios.

Setup

Prerequisites

  • Node.js 18+
  • An Azure/Microsoft Entra ID account with access to Power BI

Build

npm install
npm run build

Configure in Claude Code

Add to your Claude Code MCP settings (~/.claude/settings.json or project .claude/settings.json):

{
  "mcpServers": {
    "powerbi": {
      "command": "node",
      "args": ["/path/to/PowerBIMCP/dist/index.js", "--authentication", "interactive"],
      "env": {}
    }
  }
}

For Azure CLI authentication (if you're already logged in via az login):

{
  "mcpServers": {
    "powerbi": {
      "command": "node",
      "args": ["/path/to/PowerBIMCP/dist/index.js", "--authentication", "azcli"],
      "env": {}
    }
  }
}

With a specific tenant:

{
  "mcpServers": {
    "powerbi": {
      "command": "node",
      "args": [
        "/path/to/PowerBIMCP/dist/index.js",
        "--authentication", "interactive",
        "--tenant", "your-tenant-id"
      ],
      "env": {}
    }
  }
}

Available Tools

list_workspaces

List all Power BI workspaces the authenticated user has access to.

list_datasets

List datasets (semantic models) in a workspace.

  • workspaceId (optional) — omit for "My Workspace"

get_dataset

Get detailed information about a specific dataset.

  • datasetId (required)
  • workspaceId (optional)

get_tables

List tables in a dataset via the REST API.

  • datasetId (required)
  • workspaceId (optional)

discover_model

Discover the full schema of a semantic model (tables, columns, measures) using DMV queries. This is the best tool to call first before writing DAX queries.

  • datasetId (required)
  • workspaceId (optional)

execute_dax_query

Execute a DAX query against a semantic model.

  • datasetId (required)
  • query (required) — a valid DAX EVALUATE statement
  • workspaceId (optional)

refresh_dataset

Trigger a dataset refresh.

  • datasetId (required)
  • workspaceId (optional)

get_refresh_history

Get refresh history for a dataset.

  • datasetId (required)
  • workspaceId (optional)
  • top (optional) — number of entries, defaults to 10

Example Workflow

  1. List workspaces to find your workspace ID
  2. List datasets in that workspace to find your semantic model
  3. Discover model to understand the schema (tables, columns, measures)
  4. Execute DAX queries to answer questions about your data
"Show me total sales by region for 2024"
→ discover_model → execute_dax_query with:
  EVALUATE SUMMARIZECOLUMNS('Geography'[Region], 'Date'[Year], "Total Sales", SUM('Sales'[Amount]))

Debugging

Set LOG_LEVEL=debug for verbose logging:

{
  "mcpServers": {
    "powerbi": {
      "command": "node",
      "args": ["/path/to/PowerBIMCP/dist/index.js"],
      "env": {
        "LOG_LEVEL": "debug"
      }
    }
  }
}

Use the MCP Inspector for interactive testing:

npm run inspect