Detect issues. Auto-fix problems. Optimize your Fabric tenant.
Force Fabric MCP Server
Detect issues. Auto-fix problems. Optimize your Fabric tenant. An MCP server that scans Lakehouses, Warehouses, Eventhouses, and Semantic Models with 120 rules — and can auto-fix 45 of them.
Quick Start • Detect • Auto-Fix • Rules • Architecture
✨ Key Features
🔍 Detect — 120 Rules Across 4 Fabric Items
| Item | Rules | What's Scanned |
|---|---|---|
| 🏠 Lakehouse | 29 | SQL Endpoint + OneLake Delta Log (VACUUM history, file sizes, partitioning, retention) |
| 🏗️ Warehouse | 39 | Schema, query performance, security (PII, RLS), database config |
| 📊 Eventhouse | 20/db | Extent fragmentation, caching/retention/merge/encoding/partitioning policies, ingestion, query performance, materialized views, stored functions |
| 📐 Semantic Model | 32 | DAX expression anti-patterns, model structure, COLUMNSTATISTICS BPA |
| 120 total |
🔧 Fix — 45 Auto-Fixable Issues
| Item | Auto-Fixes | Method |
|---|---|---|
| 🏗️ Warehouse | 12 fixes | SQL DDL executed directly |
| 🏠 Lakehouse | 14 fixes | REST API (3) + Notebook Spark SQL (11) |
| 📐 Semantic Model | 12 fixes | model.bim REST API (6) + Notebook sempy (6) |
| 📊 Eventhouse | 7 fixes | KQL management commands (with dry-run preview) |
| 45 total |
📊 Unified Output
Every scan returns a clean results table — only issues shown, passed rules counted in summary:
29 rules — ✅ 18 passed | 🔴 1 failed | 🟡 10 warning
| Rule | Status | Finding | Recommendation |
|------|--------|---------|----------------|
| LH-007 Key Columns Are NOT NULL | 🔴 | 16 key column(s) allow NULL: table.finding_id, ... | Add NOT NULL constraints |
| LH-017 Regular VACUUM Executed | 🟡 | 4 table(s) need VACUUM: table1, table2, ... | Run VACUUM weekly |
🚀 Quick Start
Prerequisites
- Node.js 18+
- Azure CLI with
az logincompleted - Fabric capacity with items to scan
Install
git clone https://github.com/tmdaidevs/Force-Fabric-MCP-Server.git
cd Force-Fabric-MCP-Server
npm install
npm run build
Configure VS Code
Add to .vscode/mcp.json in your project:
{
"servers": {
"fabric-optimization": {
"type": "stdio",
"command": "node",
"args": ["dist/index.js"],
"cwd": "/path/to/Force-Fabric-MCP-Server"
}
}
}
Use
1. "Login to Fabric with azure_cli"
2. "List all lakehouses in workspace <id>"
3. "Scan lakehouse <id> in workspace <id>"
4. "Fix warehouse <id> in workspace <id>"
🔍 Detect & Scan
Available Scan Tools
| Tool | What It Does |
|---|---|
lakehouse_optimization_recommendations |
Scans SQL Endpoint + reads Delta Log files from OneLake |
warehouse_optimization_recommendations |
Connects via SQL and runs 39 diagnostic queries |
warehouse_analyze_query_patterns |
Focused analysis of slow/frequent/failed queries |
eventhouse_optimization_recommendations |
Runs KQL diagnostics on each KQL database |
semantic_model_optimization_recommendations |
Executes DAX + MDSCHEMA DMVs for BPA analysis |
Data Sources Used
┌─────────────────────────────────────┐
│ Fabric REST API │
│ Workspaces, Items, Metadata │
└──────────────┬──────────────────────┘
│
┌──────────────┬───────────────┼───────────────┬──────────────┐
▼ ▼ ▼ ▼ ▼
┌─────────────┐ ┌──────────┐ ┌──────────────┐ ┌──────────┐ ┌──────────────┐
│ SQL Client │ │ KQL REST │ │ OneLake ADLS │ │ DAX API │ │ MDSCHEMA DMV │
│ (tedious) │ │ API │ │ Gen2 API │ │executeQry│ │ via REST │
└──────┬──────┘ └────┬─────┘ └──────┬───────┘ └────┬─────┘ └──────┬───────┘
│ │ │ │ │
Lakehouse SQL Eventhouse Delta Log JSON Semantic Semantic
Warehouse SQL KQL DBs File Metadata Model DAX Model Meta
🔧 Auto-Fix
Warehouse Fixes (`warehouse_fix`)
Run all safe fixes or specify individual rule IDs:
| Rule ID | What It Fixes | SQL Command |
|---|---|---|
| WH-001 | Missing primary keys | ALTER TABLE ADD CONSTRAINT PK NOT ENFORCED |
| WH-008 | Stale statistics (>30 days) | UPDATE STATISTICS [table] |
| WH-009 | Disabled constraints | ALTER TABLE WITH CHECK CHECK CONSTRAINT ALL |
| WH-016 | Missing audit columns | ALTER TABLE ADD created_at DATETIME2 DEFAULT GETDATE() |
| WH-018 | Unmasked sensitive data | `ALTER COLUM |
Tools (6)
lakehouse_optimization_recommendationsScans SQL Endpoint and reads Delta Log files from OneLake for optimization.warehouse_optimization_recommendationsConnects via SQL and runs 39 diagnostic queries on the warehouse.warehouse_analyze_query_patternsFocused analysis of slow, frequent, or failed queries in the warehouse.eventhouse_optimization_recommendationsRuns KQL diagnostics on each KQL database in the eventhouse.semantic_model_optimization_recommendationsExecutes DAX and MDSCHEMA DMVs for BPA analysis of semantic models.warehouse_fixApplies automated fixes for identified warehouse issues.Configuration
{"servers": {"fabric-optimization": {"type": "stdio", "command": "node", "args": ["dist/index.js"], "cwd": "/path/to/Force-Fabric-MCP-Server"}}}