powerbi-agent-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@powerbi-agent-mcpcheck connection status, then list my workspaces and run a read-only DAX query"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
powerbi-agent-mcp
Connect your AI agent to your own Power BI / Microsoft Fabric tenant — and give it the rules and skills it needs to build dashboard pages that an executive can trust.
Three parts, one repo:
Part | What you get |
The MCP server — | Runs on your machine, signs in as you (Azure CLI), stores no secret. 12 tools: list workspaces and items, read the model schema, run read-only DAX, download / validate / deploy PBIR report definitions, write self-maintaining date filters, screenshot every page, read refresh history. The guardrails are in the code: it refuses to touch items you did not create, refuses DAX that is not read-only, and has no tool that triggers a refresh. |
The rules — | The universal rules an AI agent must follow on a Power BI tenant. Drop it into your project as |
The skills — | Three skills the agent uses: build a page (spec → build → validate → deploy → look), review a page through executive eyes, verify after every deploy (the see-it doctrine). Plus the install of Microsoft's own |
It comes from a real build on a shared retail tenant — an executive daily-trading report rebuilt and
verified by AI agents — with everything company-specific stripped out. The company here is YourCo,
items you create are prefixed ORG-, report measures RM , and every id is
00000000-0000-0000-0000-000000000000.
Why the guardrails exist
Each one was paid for on a shared tenant:
Never touch an item you did not create. Other people's reports bind to the same model. Work on a clone. →
deploy_reportrefuses any item name without your prefix.Never trigger a refresh on a shared model. It lands in the tenant's history under your name. → there is no refresh tool;
refresh_historyis read-only.The shared model is read-only. New DAX goes into the report (
RMmeasures), never the model. →run_daxacceptsEVALUATE/DEFINEonly; model edits need a copy you own (see docs/modeling-mcp.md).A page is not done until you have seen it rendered with data, in every state a user can put it in. Validators cannot see a page. →
capture_pages+ thepowerbi-dashboard-verifyskill.Capacity is shared. One render pass per deploy, one batched DAX query, offline checks first.
Related MCP server: Microsoft Fabric MCP Server
Install in 10 minutes
You need Python 3.11+, the Azure CLI signed in to your tenant, Node 20+ (for Microsoft's PBIR validator), and — only for screenshots — Playwright. Full detail: docs/SETUP.md.
git clone https://github.com/HamadYMarafi/powerbi-agent-mcp.git
cd powerbi-agent-mcp
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
az login # your own identity; no service principal
cp config.example.yaml config.yaml # gitignored
$EDITOR config.yaml # workspace.name, semantic_model.name, deploy.item_prefix
python scripts/discover.py # fills the ids, exports the model definition to schema/
python -m powerbi_agent_mcp --check # loads config, mints tokens, finds your workspace → OKRegister the server with your AI host. Claude Code:
claude mcp add powerbi-agent --env POWERBI_MCP_CONFIG="$PWD/config.yaml" \
-- "$PWD/.venv/bin/python" "$PWD/powerbi_agent_mcp/server.py"Any other MCP host (Claude Desktop, Cursor, …) takes the same thing as JSON:
{ "mcpServers": { "powerbi-agent": {
"command": "/absolute/path/to/repo/.venv/bin/python",
"args": ["/absolute/path/to/repo/powerbi_agent_mcp/server.py"],
"env": { "POWERBI_MCP_CONFIG": "/absolute/path/to/repo/config.yaml" } } } }Then the rules and the skills:
cp rules/CLAUDE.md /path/to/your/project/CLAUDE.md # or append to an existing one
bash skills/install.sh # copies the three skills into ~/.claude/skillsIn Claude Code, add Microsoft's skills for PBIR and semantic-model specifics:
/plugin marketplace add microsoft/skills-for-fabric then /plugin install powerbi-authoring@fabric-collection.
One-command alternative for Claude Code (this repo is also a plugin marketplace — it registers the
server and installs the three skills; you still need the pip install, az login and config.yaml
above): /plugin marketplace add HamadYMarafi/powerbi-agent-mcp then
/plugin install powerbi-agent@powerbi-agent-mcp.
First conversation: "Call connection_status, then list_workspaces, then run_dax with
EVALUATE ROW("ok", 1)." Three tools, no change to the tenant.
The tools
Tool | What it does | Touches the tenant? |
| Config file, workspace, model, prefixes, token expiry for both APIs. Call first. | no (token check only) |
| Workspaces the signed-in identity can see. | read |
| Items in a workspace: | read |
| Exports the model definition (TMDL) to | read |
| Read-only DAX via | read |
| Downloads a report's PBIR folder ( | read |
| Microsoft's PBIR validator CLI + offline checks: overlaps, canvas bounds, unique names, date pins present, banned filter kinds, theme byte-identical to | no |
| Writes the self-maintaining date filters on a visual: | no |
| Creates or updates the report by display name. Refuses names without your prefix and models not allowed in config. | write — your items only |
| Opens the report, visits every page, saves a PNG and an accessibility-text dump per page. | read (browser) |
| The model's last refreshes and their errors. | read |
| The rules text. Also the MCP resource | no |
What it will never do
Update or delete an item whose name does not start with your prefix (
deploy.item_prefix).Bind a report to a model that is not
semantic_model.idor listed indeploy.allowed_model_ids.Run DAX that is not
EVALUATE/DEFINE.Trigger, retry or schedule a refresh — no such tool exists.
Store a token. Tokens are minted in memory by the Azure CLI per request;
config.yamlholds names and ids only and is gitignored;tools/secret_scan.pyfails CI on a token, an e-mail address or a non-placeholder GUID.
The rules the agent follows
rules/CLAUDE.md in one breath: never touch what you did not create · prefix everything · never refresh
a shared model · model read-only, DAX in the report · theme locked once stakeholders have seen it ·
validate after every batch and the CLI is the source of truth — never guess PBIR JSON · every number
carries its basis on the canvas · a page is not done until seen rendered in every state · one page per
agent, the main thread owns the shared files · deterministic checks before judgement · label every claim
TESTED or UNTESTED · never commit ids, tokens or screenshots. rules/settings.example.json is a matching
Claude Code permission allow-list.
The skills
Skill | When the agent loads it |
| "build / add / rebuild a page", "deploy this report", "clone my report and fix it" — spec first, one builder per page, date pins by tool, validate after every batch, deploy, capture, look. |
| "review this", "would a CEO understand it" — five lenses (CEO, trading director, finance director, data auditor, designer) over the same screenshots, then a skeptic pass; changes nothing. |
| after any deploy — validator, live-vs-local diff, every page in every state, digits against the tie-out, error-marker grep, capacity etiquette. |
For PBIR mechanics (visual JSON, formatting objects, filters, the validator, PBIP workflows) and
semantic-model authoring, the skills defer to Microsoft's powerbi-authoring bundle:
powerbi-report-planning, powerbi-report-design, powerbi-report-authoring,
powerbi-report-management, semantic-model-authoring.
The model side
This server reads models and writes reports. To edit a semantic model (measures, tables, relationships, calculation groups, roles), Microsoft ships its own MCP — the Power BI Modeling MCP — hosted or local. docs/modeling-mcp.md has the connection recipe, the argument shape that trips people up, and the headless-server sign-in trick. The rule stands: point it only at a model you own or a copy.
Repo map
powerbi_agent_mcp/server.py the MCP server (stdio); --check for a no-AI smoke test
scripts/ the toolkit the server wraps; every script also runs on its own
rules/CLAUDE.md the universal rules — drop into your project
rules/settings.example.json Claude Code permission allow-list for the tools
skills/ powerbi-dashboard-build / -review / -verify + install.sh
docs/SETUP.md connect your AI to your Power BI, step by step
docs/modeling-mcp.md Microsoft's Power BI Modeling MCP: recipe and rules
docs/MODEL_CONTRACT.md what your semantic model must provide (the one thing to adapt)
docs/reference/ the playbook the rules were distilled from: recipe, 51 traps, checklists, spec template, snippets, DAX
report-template/ a deployable one-page PBIR report (the "Today" page) on Microsoft's stock theme
config.example.yaml every id and rule the server reads; copy to config.yaml (gitignored)
tests/ offline: guardrails, server surface and refusals
.claude-plugin/marketplace.json makes this repo installable as a Claude Code plugin
.github/workflows/validate.yml CI: tests, PBIR validation of the template, secret scanCredits
Microsoft
skills-for-fabric(github.com/microsoft/skills-for-fabric, MIT) — the Power BI authoring skills this repo's skills defer to, and the plugin-marketplace layout this repo copies.@microsoft/powerbi-report-authoring-cli— the PBIR validator and catalogue: look a property up, never guess it.@microsoft/powerbi-modeling-mcp— the model-side MCP.Model Context Protocol Python SDK (
mcp).report-template/StaticResources/SharedResources/BaseThemes/CY26SU07.jsonis Microsoft's own base theme copied unmodified out of a report definition; it is Microsoft's, not this repo's, and the MIT licence does not cover it. Delete it and the service supplies the same theme.
License
MIT — see LICENSE. Author: Hamad Marafi.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to programmatically manage Power BI workspaces, reports, and dashboards while executing DAX queries and triggering dataset refreshes. It supports secure OAuth2 authentication for operations like report exporting, workspace management, and real-time push dataset updates.624MIT
- AlicenseBqualityDmaintenanceEnables AI assistants to interact with Microsoft Fabric and Power BI services through the Model Context Protocol. Users can manage workspaces, execute DAX queries, refresh datasets, and create Fabric notebooks using natural language.6222MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to query PowerBI workspaces, datasets, and execute DAX queries through the PowerBI REST API.7MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to deploy Power BI reports to Microsoft Fabric by automating data loading from CSV, creating semantic models, and generating report visuals.
Related MCP Connectors
Build, validate, and deploy multi-agent AI solutions from any AI environment.
See, price, and control every tool call your AI agents make: policy checks, cost, and audit tools.
SaaS intelligence for AI agents. 5 unified tools cover 1,000+ services with 91-96% token savings.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/HamadYMarafi/powerbi-agent-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server