Skip to main content
All connectors
qbash Connectors / Power BI

Power BI MCP serverand Python AI tasks

qbash hosts a Power BI MCP server you can use in Claude, ChatGPT, Codex, Cursor, Grok Bot and Muse. Developers use qbash Tasks to write cloud-hosted Python functions that pair Power BI with models such as Claude and GPT.

Add the qbash MCP

Use Power BI from Claude Code, Codex, Cursor and other MCP clients. Connect Power BI in qbash, and your agent can work with its data and build Tasks that call it.

claude mcp add --transport http qbash https://mcp.qbash.com/mcp

Then run /mcp in Claude Code and sign in with qbash.

  • List the workspaces the connected user or service principal can reach
  • List the semantic models in a workspace with their owner and refresh settings
  • Read a semantic model's name, owner, storage mode and whether it can be refreshed
  • Run a DAX query against a semantic model and return the rows
  • List the data sources behind a semantic model with their connection details
  • Read the Power Query parameters defined on a semantic model
Read the docs

Write a Power BI task in Python

A qbash Task is a Python function hosted in the cloud. Python is the runtime and defines the process, and built-in inline prompts run on leading models such as Claude, GPT, Gemini and Grok.

Run a Task on a schedule, from an HTTP request or when a connected app sends an event. Your agents and chat tools call it over MCP.

Each run is logged with its inputs and results, and you can turn data logging off for any Task. Every Task has version control, and each run is locked to the version it ran.

Write the Monday sales note from a Power BI semantic model

execute_queries runs a DAX query that totals last week's revenue and orders by region. An inline prompt turns the rows into a short note for the sales lead on the regions that grew and fell.

main.py
report = qbash.integrations.power_bi.execute_queries(
workspace_id="f089354e-8366-4e18-aea3-4cb4a3a50b48",
dataset_id="cfafbeb1-8037-4d0c-896e-a46fb27ff229",
query="""EVALUATE
SUMMARIZECOLUMNS(
Region[Region],
"Revenue", CALCULATE([Total Revenue], DATESINPERIOD('Date'[Date], TODAY() - 1, -7, DAY)),
"Revenue Prior Week", CALCULATE([Total Revenue], DATESINPERIOD('Date'[Date], TODAY() - 8, -7, DAY)),
"Orders", CALCULATE([Order Count], DATESINPERIOD('Date'[Date], TODAY() - 1, -7, DAY))
)""",
)
rows = report["results"][0]["tables"][0]["rows"]
if rows:
note = qbash.ai.run_prompt(
slug="power-bi-weekly-sales",
variables={"regions": json.dumps(rows)},
)
qbash.output(note)
else:
qbash.output("The semantic model returned no sales for last week.")
Sample execute_queries response
{
"status": "success",
"results": [
{
"tables": [
{
"rows": [
{
"Region[Region]": "North America",
"[Revenue]": 418230.5,
"[Revenue Prior Week]": 392104,
"[Orders]": 2311
},
{
"Region[Region]": "Europe",
"[Revenue]": 286912.25,
"[Revenue Prior Week]": 301455.75,
"[Orders]": 1688
},
{
"Region[Region]": "Asia Pacific",
"[Revenue]": 154078,
"[Revenue Prior Week]": 131920.5,
"[Orders]": 947
}
]
}
]
}
]
}

Custom MCP server

Build a custom MCP server with Power BI

Create a hosted MCP server that combines Power BI tools with your other connectors, Tasks and memory folders. You choose each tool it exposes, so a server can share Power BI reads with write tools left off.

Share the server with your team, and each person adds it to the client they already use.

How to set it up

  1. Connect Power BI on the qbash Connectors page.
  2. Create an MCP server and add the Power BI tools you want to share.
  3. Paste the server URL into your client. It connects with OAuth or an access token.

Power BI MCP questions

Does Power BI have an official MCP server?

Microsoft publishes several. Its hosted Power BI authoring server at api.fabric.microsoft.com/v1/mcp/powerbi/authoring is in preview as of November 2026 and edits semantic models once a Fabric admin turns it on, the Power BI Modeling MCP server runs locally, and for querying data Microsoft points to its Fabric IQ MCP server. The qbash server is a separate one that puts Power BI on one URL with your other connectors and exposes the same methods to Python Tasks.

What does the Power BI connector need to connect?

A Microsoft Entra sign-in with the Dataset.Read.All and Workspace.Read.All scopes, plus Dataset.ReadWrite.All for refreshes and parameter changes. A service principal works too once an admin lets service principals use the Power BI APIs and adds it to the workspace. execute_queries also needs the Dataset Execute Queries REST API tenant setting and Build permission on the semantic model.

Can the Power BI MCP server change my semantic models?

Five methods write: refresh_dataset, cancel_refresh, update_parameters, update_refresh_schedule and add_workspace_user. Connect with read scopes only if chat users should just query models and read refresh history.

Build a Power BI task

Write it in Python with AI steps, or describe it to your coding agent through the qbash MCP.