Skip to main content
Glama
Divyansh-dev12

powerbi-mcp-server

powerbi-mcp

An MCP server that connects Claude (and any MCP-compatible client) to Microsoft Power BI via the Power BI REST API using a Service Principal.

Tools exposed

Tool

Description

list_workspaces

List all workspaces the SP has access to

list_datasets

List datasets in a workspace (or all)

execute_dax_query

Run a DAX query against a dataset and get results

refresh_dataset

Trigger an on-demand dataset refresh

list_reports

List reports in a workspace (or all)

get_report_pages

Get all pages in a report

get_report_visuals

Get all visuals on a report page

Related MCP server: Power BI MCP for Claude

Prerequisites

  1. Azure App Registration with these Power BI API permissions (Application, not Delegated):

    • Dataset.Read.All

    • Dataset.ReadWrite.All (for refresh)

    • Report.Read.All

    • Workspace.Read.All

  2. In Power BI Admin Portal → Tenant settings, enable:

    • Allow service principals to use Power BI APIs

    • Add the security group containing your App Registration

  3. Add the service principal as a Member or Admin to the workspaces you want to access.

Setup

# Clone and install
git clone <this-repo>
cd powerbi-mcp-server
pip install -e .

# Copy and fill in credentials
cp .env.example .env
# Edit .env with your tenant ID, client ID, client secret

Configure in Claude Code / Claude Desktop

Add this to your MCP configuration (~/.claude/claude_desktop_config.json for Desktop, or claude mcp add for Claude Code):

{
  "mcpServers": {
    "powerbi": {
      "command": "python",
      "args": ["-m", "powerbi_mcp"],
      "env": {
        "POWERBI_TENANT_ID": "your-tenant-id",
        "POWERBI_CLIENT_ID": "your-client-id",
        "POWERBI_CLIENT_SECRET": "your-client-secret"
      }
    }
  }
}

Or using uv (no install needed):

{
  "mcpServers": {
    "powerbi": {
      "command": "uvx",
      "args": ["--from", "/path/to/powerbi-mcp-server", "powerbi-mcp"],
      "env": {
        "POWERBI_TENANT_ID": "...",
        "POWERBI_CLIENT_ID": "...",
        "POWERBI_CLIENT_SECRET": "..."
      }
    }
  }
}

Claude Code CLI

claude mcp add powerbi \
  --command python \
  --args "-m powerbi_mcp" \
  -e POWERBI_TENANT_ID=your-tenant-id \
  -e POWERBI_CLIENT_ID=your-client-id \
  -e POWERBI_CLIENT_SECRET=your-client-secret

Example prompts

Once connected, you can ask Claude:

  • "List all Power BI workspaces I have access to."

  • "Run this DAX query on dataset abc-123: EVALUATE SUMMARIZE(Sales, Sales[Region], "Total", SUM(Sales[Amount]))"

  • "Refresh the dataset named 'Monthly Sales' in the Finance workspace."

  • "Show me all the pages and visuals in the Executive Dashboard report."

Development

pip install -e ".[dev]"
python -m powerbi_mcp   # runs the MCP server via stdio

Available Tools

7 tools
execute_dax_queryB

Execute a DAX query against a Power BI dataset and return results.

Args: dataset_id: The dataset ID to query. dax_query: A valid DAX query string, e.g. "EVALUATE SUMMARIZE(Sales, Sales[Region])". workspace_id: Optional workspace ID that contains the dataset.

ParametersJSON Schema
NameRequiredDescriptionDefault
dax_queryYes
dataset_idYes
workspace_idNo

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. It states 'return results' but does not detail the output format, potential size, rate limits, or error handling. For a query execution tool, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is short and front-loaded with the purpose. The Args list is efficiently structured. Minor issue: the example could be more prominent, but overall no unnecessary text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and the complexity of DAX queries, the description lacks completeness. It does not describe the return format, pagination, error cases, or performance implications, leaving the agent underinformed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds meaning by explaining each parameter (e.g., 'The dataset ID to query') and provides a DAX query example. However, it does not elaborate on valid query patterns or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool executes a DAX query against a Power BI dataset and returns results. It uses a specific verb and resource, distinguishing it from sibling tools like list_datasets (which only list metadata) or refresh_dataset.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage through the example and parameter details but does not explicitly state when to use this tool versus alternatives (e.g., list_datasets for exploring datasets). No guidance on prerequisites or when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_report_pagesB

Get all pages in a Power BI report.

Args: report_id: The report ID. workspace_id: Optional workspace ID that contains the report.

ParametersJSON Schema
NameRequiredDescriptionDefault
report_idYes
workspace_idNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description bears full burden. It only states the function and arguments, omitting any behavioral traits like authentication needs, rate limits, or response nature.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with two sentences and an arg list, containing no unnecessary information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity and the presence of an output schema, the description adequately states the purpose and parameters. It could mention that no output details are needed because the output schema exists.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so description compensates by explicitly describing both parameters (report_id and workspace_id) beyond just names and types. However, no additional details like formats or constraints are provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get all pages in a Power BI report' clearly states the verb, resource, and context. It distinctly differentiates from sibling tools like get_report_visuals and list_reports.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives, nor are prerequisites or context (e.g., requiring a report_id from list_reports) mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_report_visualsA

Get all visuals on a specific page of a Power BI report.

Args: report_id: The report ID. page_name: The page name (from get_report_pages). workspace_id: Optional workspace ID that contains the report.

ParametersJSON Schema
NameRequiredDescriptionDefault
page_nameYes
report_idYes
workspace_idNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries burden. States it 'gets all visuals' implying read-only, but does not disclose permissions, error handling, or behavior if page missing. Adequate but minimal beyond purpose.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Very concise; one-line purpose followed by compact Args section. Every sentence adds value. Front-loaded with purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool is straightforward; output schema exists, so return details not needed. Description covers essential input context. Could mention that it returns a list/array of visuals, but not necessary given schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Description lists all three parameters with additional context: page_name's source (from get_report_pages), workspace_id's optionality. Schema has 0% coverage, so this adds meaning over the schema's simple type definitions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states 'Get all visuals on a specific page of a Power BI report'. Verb 'get' and resource 'visuals on a page' are specific. Distinguishes from sibling tools like get_report_pages (gets pages) and execute_dax_query (query).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly mentions that page_name 'comes from get_report_pages', providing context for prerequisite tool. Does not explicitly state when not to use, but the context is clear. Minor omission of exclusion criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_datasetsA

List datasets in a workspace or across all workspaces.

Args: workspace_id: Optional workspace (group) ID. Omit for the default workspace.

ParametersJSON Schema
NameRequiredDescriptionDefault
workspace_idNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It correctly indicates this is a listing operation (read-only by nature), but it does not disclose any behavioral traits such as pagination, result limits, or required permissions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise, using two clear sentences and an Arg block. Every part adds value with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that an output schema exists (though not shown), the description does not need to explain return values. The description covers the essential purpose and parameter, leaving no major gaps for a simple list tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaning to the single parameter workspace_id by explaining its purpose ('optional workspace ID') and default behavior ('omit for default workspace'). Since the schema provides no descriptions (0% coverage), this adds significant value beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (list) and resource (datasets) and specifies the scope (in a workspace or across all workspaces), which distinguishes it from sibling tools like list_reports and list_workspaces.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides minimal guidance: it notes that workspace_id is optional and omitting it uses the default workspace. However, it does not explicitly explain when to use this tool versus alternatives, nor does it mention any prerequisites or limitations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_reportsA

List reports in a workspace or across all workspaces.

Args: workspace_id: Optional workspace ID. Omit for the default workspace.

ParametersJSON Schema
NameRequiredDescriptionDefault
workspace_idNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description must carry burden. It describes action and parameter but does not state read-only nature, safety, or response details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Very concise: two sentences plus parameter note. Front-loaded with purpose, no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Simple listing tool with output schema; parameter and scope are well-covered. Could mention pagination or ordering, but not critical.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so description adds value by explaining workspace_id effect (omit for default). Adds meaning beyond schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the action 'list' and resource 'reports', with scope options (workspace or all). While distinct from sibling tools like list_datasets, it lacks explicit differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Guidance on the workspace parameter is given (optional, omit for default), but no when-to-use vs. alternatives or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_workspacesA

List all Power BI workspaces (groups) the service principal has access to.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states the tool lists workspaces but does not declare it as read-only or disclose any side effects. Basic transparency but could be more explicit.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence that is clear and to the point, with no unnecessary words or repetition. Perfectly concise for the simplicity of the tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the zero parameters and existence of an output schema (not shown), the description adequately explains the tool's purpose and scope. It could mention the output format, but the output schema covers that.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has no parameters and 100% schema coverage. The description adds value by specifying 'all workspaces' and 'the service principal has access to,' providing context beyond the empty schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (list) and the resource (Power BI workspaces/groups). It specifies 'the service principal has access to,' distinguishing it from siblings which deal with datasets, reports, and DAX queries.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use it (to list accessible workspaces) but does not explicitly state when not to use it or mention any prerequisites. However, the sibling tools cover different operations, making the usage context clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

refresh_datasetB

Trigger an on-demand refresh of a Power BI dataset.

Args: dataset_id: The dataset ID to refresh. workspace_id: Optional workspace ID that contains the dataset.

ParametersJSON Schema
NameRequiredDescriptionDefault
dataset_idYes
workspace_idNo

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description does not disclose behavioral traits like whether the refresh is synchronous or asynchronous, if it triggers a full refresh, or any error scenarios. No annotations are provided to compensate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with two sentences plus parameter details. It is well-structured and front-loaded with the purpose, though the parameter descriptions could be integrated more naturally.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of output schema and annotations, the description provides minimal context. It does not explain return values, error handling, or the nature of the refresh operation, leaving significant gaps for a mutation tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaning to both parameters: 'dataset_id' is described as 'The dataset ID to refresh' and 'workspace_id' as 'Optional workspace ID that contains the dataset.' This goes beyond the schema's type-only information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Trigger an on-demand refresh of a Power BI dataset,' which is a specific verb ('trigger') and resource ('dataset'), clearly distinguishing it from sibling tools that list datasets or reports.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives, such as listing datasets first or using other refresh methods. No prerequisites or context about when a refresh is needed.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 7 tool updatesv0.1.0
    • First observedexecute_dax_query
    • First observedget_report_pages
    • First observedget_report_visuals
    • First observedlist_datasets
    • First observedlist_reports
    • First observedlist_workspaces
    • First observedrefresh_dataset

TDQS

A3.9/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: querying, listing, getting details, or refreshing. No overlap in functionality.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case, using verbs like execute, get, list, and refresh.

Tool Count5/5

7 tools is well-scoped for a Power BI server covering listing, querying, and refreshing resources without being excessive or too thin.

Completeness4/5

The tool set covers core read, query, and refresh operations, but lacks create/update/delete capabilities for datasets and reports, which are minor gaps.

Maintenance

ActivityStale
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server for interacting with Microsoft PowerBI REST API, providing tools for data cleaning, transformation, analysis, and visualization within PowerBI.
    4
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A self-hosted MCP server that proxies MCP clients to Power BI, using your own Entra tenant and Azure subscription. It enables DAX queries, workspace listing, and dataset management while preserving user-specific row-level security.
    2
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Divyansh-dev12/powerbi-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server