Fabric MCP Server - PowerBI Report Creator
Enables AI agents to deploy Power BI reports to Microsoft Fabric by automating data loading from CSV, creating semantic models, and generating report visuals.
README
Fabric MCP Server | PowerBI Report Creatorπ
Skip the formula learning curve β let AI build your Power BI report structure.
A Model Context Protocol (MCP) server that lets AI agents deploy Power BI reports to Microsoft Fabric. Focus on what data you want to see, not how to write DAX or configure data sources.
π‘ The Big Idea
Traditional workflow: Learn DAX formulas β Figure out data modeling β Create measures β Build visuals β Configure connections β Publish β Style it β Hope it works.
With this MCP server: Tell your AI what data you want to visualize β AI generates the semantic model, measures, and report structure β Deploys to Fabric β You apply final styling in Fabric portal.
Why This Matters
- No DAX Required β AI writes the measures and data model. You don't need to learn
SUM(),CALCULATE(), or relationship syntax. - Quick Scaffolding β Get a working report with the right visuals and data bindings in minutes, not hours.
- Data Pipeline Automation β CSV β Lakehouse β Delta Table β Semantic Model β Report, all automated.
- Ready for Styling β Visuals are deployed with correct data. Apply colors and formatting in Fabric portal.
What You Get
You: "Create a sales report from this CSV with revenue by region and monthly trends"
AI: [uploads data, creates semantic model with measures, builds report with charts]
Result: Working report in Fabric with:
β Data loaded into Lakehouse
β Semantic model with correct measures (TotalRevenue, TotalProfit, etc.)
β Visuals bound to the right fields
β Ready for you to apply your preferred colors/theme in Fabric portal
Styling Limitations
Note: Programmatic visual styling (custom colors, fonts) via PBIR
objectsproperty is not currently supported by Fabric. Reports deploy with default Power BI styling. Use Fabric portal or Power BI Desktop to apply custom themes after deployment.
π How It Works
The server automates the complete data-to-report workflow:
- Upload CSV Data β Write to Lakehouse OneLake storage (ADLS Gen2)
- Create Delta Tables β Load CSV into queryable Lakehouse tables
- Deploy Semantic Model β Push TMDL definitions to Git
- Deploy Report β Push PBIR report with visuals to Git
- Sync to Fabric β Trigger "Update from Git" to create workspace items
- Refresh Model β Load data into semantic model via Power BI API
β¨ Capabilities
| Category | Features |
|---|---|
| Data Loading | Upload CSV to OneLake, create Delta tables |
| Semantic Models | Generate TMDL with Direct Lake connection, measures, relationships |
| Reports | Generate PBIR with cards, bar charts, line charts, tables, slicers |
| Git Operations | Push to Azure DevOps, sync workspace from Git |
| Workspace Management | List workspaces, check Git status, refresh models |
| Themes | Generate Power BI JSON themes from hex colors |
π¦ Installation
Prerequisites
- Python 3.10+
- Azure CLI (for authentication):
az login - Azure SDK:
pip install azure-storage-file-datalake azure-identity - Fabric Workspace connected to Azure DevOps Git repo (one-time setup in Fabric portal)
Install from Source
git clone https://github.com/yourorg/fabric-mcp-server-powerbi-creator.git
cd fabric-mcp-server-powerbi-creator
# Create virtual environment
python -m venv .venv
.venv\Scripts\Activate.ps1 # Windows PowerShell
# Install
pip install -e .
pip install azure-storage-file-datalake azure-identity
Verify Installation
python -c "import fabric_mcp; print('OK')"
π Quick Start
1. Authenticate with Azure (REQUIRED)
You MUST authenticate before using the MCP server:
az login
This uses Azure CLI for authentication. Without this step, all API calls will fail.
2. Get Your Fabric Information
The MCP server will ask you for:
| Information | How to Get It |
|---|---|
| Workspace URL | Go to Fabric portal β Open your workspace β Copy URL from browser<br>https://app.fabric.microsoft.com/groups/<WORKSPACE_ID>/... |
| Lakehouse | The server will list available Lakehouses for you to choose |
| Azure DevOps Repo URL | Go to Azure DevOps β Repos β Clone β Copy HTTPS URL<br>https://org.visualstudio.com/project/_git/repo |
3. Configure MCP Client
Add to your AI agent's MCP configuration:
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"fabric": {
"command": "fabric-mcp-server-powerbi-creator"
}
}
}
Cursor (.cursor/mcp.json):
{
"mcpServers": {
"fabric": {
"command": "C:/path/to/project/.venv/Scripts/fabric-mcp-server-powerbi-creator.exe"
}
}
}
π οΈ Available Tools
Workspace Management
| Tool | Description |
|---|---|
list_workspaces |
List all Fabric workspaces you have access to |
get_git_status |
Check Git connection and pending changes for a workspace |
sync_workspace |
Trigger "Update from Git" to pull changes into Fabric |
Data Loading
| Tool | Description |
|---|---|
list_lakehouses |
List all Lakehouses in a workspace |
list_lakehouse_tables |
List Delta tables in a Lakehouse |
upload_csv_to_lakehouse |
Upload local CSV to Lakehouse OneLake storage |
load_csv_to_lakehouse |
Load CSV from Files into a Delta table |
Deployment
| Tool | Description |
|---|---|
deploy_semantic_model |
Deploy TMDL semantic model to Git |
deploy_report_with_model |
Deploy semantic model + report together to Git |
refresh_semantic_model |
Refresh model to load data from Lakehouse |
Utilities
| Tool | Description |
|---|---|
generate_theme |
Generate Power BI JSON theme from hex colors |
deploy_report |
Deploy a simple report template (legacy) |
π Workflow Examples
Basic: Describe What You Want
You: "Create a sales dashboard from sales-data.csv. Show revenue by region
as a bar chart and monthly trends as a line chart."
AI: "I'll need your Fabric workspace URL and Azure DevOps repo URL."
You: [paste URLs]
AI: [uploads CSV β creates Delta table β builds semantic model β
generates report with bar chart + line chart β deploys to Fabric]
"Done! Your report 'SalesReport' is live in Fabric."
Advanced: Start from a Screenshot
You: "I want my report to look like this:" [attaches screenshot of existing report]
AI: "I can see card KPIs at top, donut chart on left, and trend line on right.
I'll create the data model and visuals with that layout."
[AI analyzes the screenshot and generates visuals that mimic the layout
and chart types - with your actual data wired up automatically]
"Deployed! Check Fabric to see the report. You can apply colors and
formatting in the Fabric portal."
Pro Tip: Iterative Refinement
The real power is iteration on data and measures. Rapidly experiment:
- "Add a date slicer"
- "Change the bar chart to horizontal"
- "Add a YoY growth measure"
- "Filter to only show top 10 products"
Each change: AI modifies the model/visuals β pushes to Git β syncs to Fabric β done.
Note: For visual styling (colors, fonts, custom formatting), use the Fabric portal after deployment. Programmatic styling via PBIR
objectsis not yet supported by Fabric.
π§ What Happens Under the Hood
When you deploy a report, the MCP server:
1. list_workspaces() β Extract workspace ID from URL
2. list_lakehouses(workspace_id) β Find available Lakehouses
3. upload_csv_to_lakehouse(workspace_id, lakehouse_id, "sales-data.csv")
β Writes to OneLake Files/
4. load_csv_to_lakehouse(workspace_id, lakehouse_id, "fact_Sales", "Files/sales-data.csv")
β Creates Delta table
5. deploy_report_with_model(repo_url, branch, model_name, report_name, ...)
β Pushes TMDL + PBIR to Git
6. sync_workspace(workspace_id)
β Triggers "Update from Git" in Fabric (async polling)
7. refresh_semantic_model(workspace_id, model_name)
β Loads data from Lakehouse into model
Result: Live Power BI report in Fabric!
ποΈ Architecture
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Local CSV βββββΆβ OneLake Storage βββββΆβ Delta Tables β
β (your data) β β (ADLS Gen2) β β (Lakehouse) β
βββββββββββββββββββ ββββββββββββββββββββ ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Azure DevOps ββββββ MCP Server βββββΆβ Fabric API β
β Git Repository β β (this project) β β (sync/refresh) β
ββββββββββ¬βββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β
βΌ
βββββββββββββββββββ ββββββββββββββββββββ
β Fabric Sync βββββΆβ Workspace Items β
β (updateFromGit)β β (Model + Report)β
βββββββββββββββββββ ββββββββββββββββββββ
Key Components:
| File | Purpose |
|---|---|
server.py |
MCP server with all tools |
fabric_api.py |
Fabric REST API client (async polling) |
lakehouse.py |
OneLake upload + Delta table loading |
semantic_model.py |
TMDL semantic model builder (Direct Lake) |
report_builder.py |
PBIR report builder with visuals |
theme_generator.py |
Power BI JSON theme generator |
π§ Configuration
Environment Variables (Optional)
For CI/CD or service principal authentication:
# Windows PowerShell
$env:FABRIC_TENANT_ID="your-tenant-id"
$env:FABRIC_CLIENT_ID="your-client-id"
$env:FABRIC_CLIENT_SECRET="your-client-secret"
Workspace Git Connection
Your Fabric workspace must be connected to an Azure DevOps Git repository:
- Open Fabric portal β Workspace settings β Git integration
- Connect to Azure DevOps
- Select organization, project, repository, branch
- Initialize sync
This is a one-time setup per workspace.
π Project Structure
fabric-mcp-server-powerbi-creator/
βββ src/fabric_mcp/
β βββ server.py # MCP server + tools
β βββ fabric_api.py # Fabric REST API client
β βββ lakehouse.py # OneLake + Delta table operations
β βββ semantic_model.py # TMDL builder (Direct Lake)
β βββ report_builder.py # PBIR builder with visuals
β βββ theme_generator.py # Power BI theme generator
βββ examples/
β βββ deploy_report_e2e.py # Complete workflow example
βββ test-templates/
β βββ sales-dashboard/ # Sample data + template
βββ templates/
β βββ *.json # Power BI theme templates
βββ pyproject.toml
βββ README.md
π§ͺ Testing
Run the example script to test the full workflow:
# 1. First authenticate
az login
# 2. Edit the example file and fill in YOUR values:
# - WORKSPACE_ID (from Fabric workspace URL)
# - LAKEHOUSE_ID (from Lakehouse URL)
# - REPO_URL (Azure DevOps repo)
# - BRANCH
# 3. Run the example
cd fabric-mcp-server-powerbi-creator
$env:PYTHONPATH = "src"
python examples/deploy_report_e2e.py
This will:
- Upload
test-templates/sales-dashboard/sales-data.csvto Lakehouse - Create
fact_SalesDelta table - Deploy
SalesModelsemantic model - Deploy
SalesReportwith 5 visuals - Sync workspace from Git
- Refresh semantic model
β οΈ Troubleshooting
| Issue | Solution |
|---|---|
| "Failed to get token" / 401 Unauthorized | Run az login first to authenticate |
ModuleNotFoundError: azure |
pip install azure-storage-file-datalake azure-identity |
| "Workspace Git state is NotConnected" | Connect workspace to Git in Fabric portal |
| "DiscoverDependenciesFailed" on sync | Delete conflicting items from workspace first |
| Report shows "Error fetching data" | Run refresh_semantic_model() after sync |
| Visuals blank but no error | Verify Delta table has data, refresh model |
| "Invalid workspace ID" | Copy workspace ID from Fabric URL (GUID after /groups/) |
π License
MIT License - see LICENSE file for details.
π Credits
Inspired by FabricAI deployment patterns for Direct Lake semantic models.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.