iflow-mcp_augustab-microsoft-fabric-mcp 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 August Asheim Birkeland
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,285 @@
1
+ Metadata-Version: 2.4
2
+ Name: iflow-mcp_augustab-microsoft-fabric-mcp
3
+ Version: 0.1.4
4
+ Summary: Safe, read-only MCP server for Microsoft Fabric - 25 tools for data engineers
5
+ Author-email: August Asheim Birkeland <augbir@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/Augustab/microsoft_fabric_mcp
8
+ Project-URL: Repository, https://github.com/Augustab/microsoft_fabric_mcp
9
+ Project-URL: Issues, https://github.com/Augustab/microsoft_fabric_mcp/issues
10
+ Keywords: microsoft-fabric,mcp,model-context-protocol,data-engineering,fabric-api
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
+ Classifier: Topic :: Database
18
+ Classifier: Topic :: Scientific/Engineering
19
+ Requires-Python: >=3.11
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: azure-identity>=1.20.0
23
+ Requires-Dist: cachetools>=6.2.0
24
+ Requires-Dist: deltalake>=0.25.4
25
+ Requires-Dist: mcp[cli]>=1.3.0
26
+ Requires-Dist: requests>=2.32.3
27
+ Dynamic: license-file
28
+
29
+ # Microsoft Fabric MCP
30
+
31
+ [![PyPI version](https://badge.fury.io/py/microsoft-fabric-mcp.svg)](https://badge.fury.io/py/microsoft-fabric-mcp)
32
+
33
+ A Model Context Protocol server that provides read-only access to Microsoft Fabric resources. Query workspaces, examine table schemas, monitor jobs, and analyze dependencies using natural language.
34
+
35
+ ## Features
36
+
37
+ - **25 tools** covering workspaces, lakehouses, tables, jobs, and dependencies
38
+ - **Read-only operations** - uses only GET requests, no risk of data modification
39
+ - **Smart caching** for fast responses
40
+ - **Works with** Cursor, Claude, and other MCP-compatible AI tools
41
+
42
+ ## Available MCP Tools
43
+
44
+ > **Parameter Note**: `workspace` parameters accept either workspace names (e.g., "DWH-PROD") or workspace IDs. Names are recommended for ease of use.
45
+
46
+ ### 🏢 Core Fabric Management
47
+ | Tool | Description | Inputs |
48
+ |------|-------------|---------|
49
+ | `list_workspaces` | List all accessible Fabric workspaces | None |
50
+ | `get_workspace` | Get detailed workspace info including workspace identity status | `workspace` (name/ID) |
51
+ | `list_items` | List all items in workspace with optional type filtering | `workspace` (name/ID), `item_type` (optional) |
52
+ | `get_item` | Get detailed properties and metadata for specific item | `workspace` (name/ID), `item_name` (name/ID) |
53
+ | `list_connections` | List all connections user has access to across entire tenant | None |
54
+ | `list_lakehouses` | List all lakehouses in specified workspace | `workspace` (name/ID) |
55
+ | `list_capacities` | List all Fabric capacities user has access to | None |
56
+ | `get_workspace_identity` | Get workspace identity details for a specific workspace | `workspace` (name/ID) |
57
+ | `list_workspaces_with_identity` | List workspaces that have workspace identities configured | None |
58
+
59
+ ### 📊 Data & Schema Management
60
+ | Tool | Description | Inputs |
61
+ |------|-------------|---------|
62
+ | `get_all_schemas` | Get schemas for all Delta tables in lakehouse | `workspace` (name/ID), `lakehouse` (name/ID) |
63
+ | `get_table_schema` | Get detailed schema for specific table | `workspace` (name/ID), `lakehouse` (name/ID), `table_name` |
64
+ | `list_tables` | List all tables in lakehouse with format/type info | `workspace` (name/ID), `lakehouse` (name/ID) |
65
+ | `list_shortcuts` | List OneLake shortcuts for specific item | `workspace` (name/ID), `item_name` (name/ID), `parent_path` (optional) |
66
+ | `get_shortcut` | Get detailed shortcut configuration and target | `workspace` (name/ID), `item_name` (name/ID), `shortcut_name`, `parent_path` (optional) |
67
+ | `list_workspace_shortcuts` | Aggregate all shortcuts across workspace items | `workspace` (name/ID) |
68
+
69
+ ### ⚡ Job Monitoring & Scheduling
70
+ | Tool | Description | Inputs |
71
+ |------|-------------|---------|
72
+ | `list_job_instances` | List job instances with status/item filtering for monitoring | `workspace` (name/ID), `item_name` (optional), `status` (optional) |
73
+ | `get_job_instance` | Get detailed job info including errors and timing | `workspace` (name/ID), `item_name` (name/ID), `job_instance_id` |
74
+ | `list_item_schedules` | List all schedules for specific item | `workspace` (name/ID), `item_name` (name/ID) |
75
+ | `list_workspace_schedules` | Aggregate all schedules across workspace - complete scheduling overview | `workspace` (name/ID) |
76
+
77
+ ### 🎯 Operational Intelligence
78
+ | Tool | Description | Inputs |
79
+ |------|-------------|---------|
80
+ | `list_compute_usage` | Monitor active jobs and estimate resource consumption | `workspace` (optional), `time_range_hours` (default: 24) |
81
+ | `get_item_lineage` | Analyze data flow dependencies upstream/downstream | `workspace` (name/ID), `item_name` (name/ID) |
82
+ | `list_item_dependencies` | Map all item dependencies in workspace | `workspace` (name/ID), `item_type` (optional) |
83
+ | `get_data_source_usage` | Analyze connection usage patterns across items | `workspace` (optional), `connection_name` (optional) |
84
+ | `list_environments` | List Fabric environments for compute/library management | `workspace` (optional) |
85
+ | `get_environment_details` | Get detailed environment config including Spark settings and libraries | `workspace` (name/ID), `environment_name` (name/ID) |
86
+
87
+ ## Caching
88
+
89
+ The server caches responses for performance. Use `clear_fabric_data_cache` to refresh resource lists or `clear_name_resolution_cache` after renaming workspaces/lakehouses.
90
+
91
+ ## Getting Started
92
+
93
+ 1. Install UV and Azure CLI (see sections below)
94
+ 2. Set up Azure CLI authentication: `az login`
95
+ 3. Configure MCP in Cursor (see "Setting up MCP" section below)
96
+
97
+ ## Installation
98
+
99
+ ### UV
100
+ ```bash
101
+ # macOS/Linux
102
+ curl -LsSf https://astral.sh/uv/install.sh | sh
103
+
104
+ # Windows
105
+ powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
106
+ ```
107
+
108
+ ## Azure CLI Authentication
109
+
110
+ This toolkit requires Azure CLI to be installed and properly configured for authentication with Microsoft Fabric services.
111
+
112
+ ### Azure CLI Setup
113
+
114
+ 1. Install Azure CLI (if not already installed):
115
+ ```bash
116
+ # For macOS
117
+ brew install azure-cli
118
+
119
+ # For Windows
120
+ # Last ned installasjonen fra: https://aka.ms/installazurecliwindows
121
+ # Eller bruk winget:
122
+ winget install -e --id Microsoft.AzureCLI
123
+
124
+ # For other platforms, see the official Azure CLI documentation
125
+ ```
126
+
127
+ 2. Log in to Azure with CLI:
128
+ ```bash
129
+ az login
130
+ ```
131
+
132
+ 3. Verify the login works:
133
+ ```bash
134
+ az account show
135
+ ```
136
+
137
+ 4. If you have multiple subscriptions, select the one you want to use:
138
+ ```bash
139
+ az account set --subscription "Name-or-ID-of-subscription"
140
+ ```
141
+
142
+ When this is done, the `DefaultAzureCredential` in our code will automatically find and use your Azure CLI authentication.
143
+
144
+ ## Setting up MCP
145
+
146
+ To use the MCP (Module Context Protocol) with this toolkit, follow these steps:
147
+
148
+ 1. Make sure you have completed the Azure CLI authentication steps above.
149
+
150
+ 2. **Choose your installation method:**
151
+
152
+ ### Option A: UVX Installation (Recommended)
153
+
154
+ Add to Cursor MCP settings:
155
+ ```json
156
+ "mcp_fabric": {
157
+ "command": "uvx",
158
+ "args": ["microsoft-fabric-mcp"]
159
+ }
160
+ ```
161
+
162
+ ### Option B: Local Development
163
+
164
+ **Clone and install:**
165
+ ```bash
166
+ git clone https://github.com/Augustab/microsoft_fabric_mcp
167
+ cd microsoft_fabric_mcp
168
+ uv pip install -e .
169
+ ```
170
+
171
+ **Add to Cursor MCP settings:**
172
+ ```json
173
+ "mcp_fabric": {
174
+ "command": "uv",
175
+ "args": [
176
+ "--directory",
177
+ "/Users/username/Documents/microsoft_fabric_mcp",
178
+ "run",
179
+ "fabric_mcp.py"
180
+ ]
181
+ }
182
+ ```
183
+
184
+ Replace `/Users/username/Documents/microsoft_fabric_mcp` with your actual path.
185
+
186
+ > **💡 Note**: Both methods run the MCP server locally on your machine. The UVX method just makes installation much easier!
187
+
188
+ 3. Once the MCP is configured, you can interact with Microsoft Fabric resources directly from your tools and applications.
189
+
190
+ 4. You can use the provided MCP tools to list workspaces, lakehouses, and tables, as well as extract schema information as documented in the tools section.
191
+
192
+ 5. When successfully configured, your MCP will appear in Cursor settings like this:
193
+
194
+ <div align="center">
195
+ <img src="images/fmcp.png" alt="Successful MCP setup in Cursor" title="MCP setup as shown in Cursor settings" width="50%">
196
+ </div>
197
+
198
+ ## Windows Setup
199
+
200
+ ### Setting up the MCP Command
201
+
202
+ On Windows, you can create a batch file to easily run the MCP command:
203
+
204
+ 1. Create a file named `run_mcp.bat` with the following content:
205
+ ```
206
+ @echo off
207
+ SET PATH=C:\Users\YourUsername\.local\bin;%PATH%
208
+ cd C:\path\to\your\microsoft_fabric_mcp\
209
+ C:\Users\YourUsername\.local\bin\uv.exe run fabric_mcp.py
210
+ ```
211
+
212
+ Example with real paths:
213
+ ```
214
+ @echo off
215
+ SET PATH=C:\Users\YourUsername\.local\bin;%PATH%
216
+ cd C:\Users\YourUsername\source\repos\microsoft_fabric_mcp\
217
+ C:\Users\YourUsername\.local\bin\uv.exe run fabric_mcp.py
218
+ ```
219
+
220
+ 2. You can then run the MCP command by executing:
221
+ ```
222
+ cmd /c C:\path\to\your\microsoft_fabric_mcp\run_mcp.bat
223
+ ```
224
+
225
+ Example:
226
+ ```
227
+ cmd /c C:\Users\YourUsername\source\repos\microsoft_fabric_mcp\run_mcp.bat
228
+ ```
229
+
230
+ ### Virtual Environment Permissions
231
+
232
+ When activating the virtual environment using `.venv\Scripts\activate` on Windows, you might encounter permission issues. To resolve this, run the following command in PowerShell before activation:
233
+
234
+ ```powershell
235
+ Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
236
+ ```
237
+
238
+ This temporarily changes the execution policy for the current PowerShell session only, allowing scripts to run.
239
+
240
+ ## Example Usage
241
+
242
+ After setup, you can query your Fabric resources through your AI assistant:
243
+
244
+ ### Listing Workspaces in Fabric
245
+
246
+ Ask your AI assistant natural language questions:
247
+
248
+ ```
249
+ Can you list my workspaces in Fabric?
250
+ Can you show me all the lakehouses in the "DWH-PROD" workspace?
251
+ Can you get the schema for the "sales" table in the "GK_Bronze" lakehouse?
252
+ ```
253
+
254
+ The AI will automatically select the appropriate MCP tool and display results:
255
+
256
+ <div align="center">
257
+ <img src="images/list_workspaces_example.png" alt="Example of listing Fabric workspaces" title="Example of listing workspaces in Fabric" width="450" />
258
+ </div>
259
+
260
+ ### Advanced Use Cases
261
+
262
+ For complex tasks, the AI can access multiple resources to generate accurate code:
263
+
264
+ ```
265
+ Create a notebook that reads from the 'sales' table in Bronze lakehouse and upserts to 'sales_processed' in Silver lakehouse, considering both schemas.
266
+ ```
267
+
268
+ The AI will:
269
+ 1. Get schemas for both tables
270
+ 2. Generate code with correct data types
271
+ 3. Create an efficient upsert operation
272
+
273
+ ### Permission Handling
274
+
275
+ The AI will ask permission before running MCP tools. In Cursor, you can enable YOLO mode for automatic execution without prompts.
276
+
277
+ ## About Model Context Protocol
278
+
279
+ Model Context Protocol (MCP) is an open standard that enables AI assistants to securely connect to external data sources and tools. This server implements MCP to provide AI assistants with direct access to your Microsoft Fabric resources.
280
+
281
+ Learn more: [Model Context Protocol Documentation](https://www.anthropic.com/news/model-context-protocol)
282
+
283
+ ## Contributing
284
+
285
+ Feel free to contribute additional tools, utilities, or improvements to existing code. Please follow the existing code structure and include appropriate documentation.
@@ -0,0 +1,257 @@
1
+ # Microsoft Fabric MCP
2
+
3
+ [![PyPI version](https://badge.fury.io/py/microsoft-fabric-mcp.svg)](https://badge.fury.io/py/microsoft-fabric-mcp)
4
+
5
+ A Model Context Protocol server that provides read-only access to Microsoft Fabric resources. Query workspaces, examine table schemas, monitor jobs, and analyze dependencies using natural language.
6
+
7
+ ## Features
8
+
9
+ - **25 tools** covering workspaces, lakehouses, tables, jobs, and dependencies
10
+ - **Read-only operations** - uses only GET requests, no risk of data modification
11
+ - **Smart caching** for fast responses
12
+ - **Works with** Cursor, Claude, and other MCP-compatible AI tools
13
+
14
+ ## Available MCP Tools
15
+
16
+ > **Parameter Note**: `workspace` parameters accept either workspace names (e.g., "DWH-PROD") or workspace IDs. Names are recommended for ease of use.
17
+
18
+ ### 🏢 Core Fabric Management
19
+ | Tool | Description | Inputs |
20
+ |------|-------------|---------|
21
+ | `list_workspaces` | List all accessible Fabric workspaces | None |
22
+ | `get_workspace` | Get detailed workspace info including workspace identity status | `workspace` (name/ID) |
23
+ | `list_items` | List all items in workspace with optional type filtering | `workspace` (name/ID), `item_type` (optional) |
24
+ | `get_item` | Get detailed properties and metadata for specific item | `workspace` (name/ID), `item_name` (name/ID) |
25
+ | `list_connections` | List all connections user has access to across entire tenant | None |
26
+ | `list_lakehouses` | List all lakehouses in specified workspace | `workspace` (name/ID) |
27
+ | `list_capacities` | List all Fabric capacities user has access to | None |
28
+ | `get_workspace_identity` | Get workspace identity details for a specific workspace | `workspace` (name/ID) |
29
+ | `list_workspaces_with_identity` | List workspaces that have workspace identities configured | None |
30
+
31
+ ### 📊 Data & Schema Management
32
+ | Tool | Description | Inputs |
33
+ |------|-------------|---------|
34
+ | `get_all_schemas` | Get schemas for all Delta tables in lakehouse | `workspace` (name/ID), `lakehouse` (name/ID) |
35
+ | `get_table_schema` | Get detailed schema for specific table | `workspace` (name/ID), `lakehouse` (name/ID), `table_name` |
36
+ | `list_tables` | List all tables in lakehouse with format/type info | `workspace` (name/ID), `lakehouse` (name/ID) |
37
+ | `list_shortcuts` | List OneLake shortcuts for specific item | `workspace` (name/ID), `item_name` (name/ID), `parent_path` (optional) |
38
+ | `get_shortcut` | Get detailed shortcut configuration and target | `workspace` (name/ID), `item_name` (name/ID), `shortcut_name`, `parent_path` (optional) |
39
+ | `list_workspace_shortcuts` | Aggregate all shortcuts across workspace items | `workspace` (name/ID) |
40
+
41
+ ### ⚡ Job Monitoring & Scheduling
42
+ | Tool | Description | Inputs |
43
+ |------|-------------|---------|
44
+ | `list_job_instances` | List job instances with status/item filtering for monitoring | `workspace` (name/ID), `item_name` (optional), `status` (optional) |
45
+ | `get_job_instance` | Get detailed job info including errors and timing | `workspace` (name/ID), `item_name` (name/ID), `job_instance_id` |
46
+ | `list_item_schedules` | List all schedules for specific item | `workspace` (name/ID), `item_name` (name/ID) |
47
+ | `list_workspace_schedules` | Aggregate all schedules across workspace - complete scheduling overview | `workspace` (name/ID) |
48
+
49
+ ### 🎯 Operational Intelligence
50
+ | Tool | Description | Inputs |
51
+ |------|-------------|---------|
52
+ | `list_compute_usage` | Monitor active jobs and estimate resource consumption | `workspace` (optional), `time_range_hours` (default: 24) |
53
+ | `get_item_lineage` | Analyze data flow dependencies upstream/downstream | `workspace` (name/ID), `item_name` (name/ID) |
54
+ | `list_item_dependencies` | Map all item dependencies in workspace | `workspace` (name/ID), `item_type` (optional) |
55
+ | `get_data_source_usage` | Analyze connection usage patterns across items | `workspace` (optional), `connection_name` (optional) |
56
+ | `list_environments` | List Fabric environments for compute/library management | `workspace` (optional) |
57
+ | `get_environment_details` | Get detailed environment config including Spark settings and libraries | `workspace` (name/ID), `environment_name` (name/ID) |
58
+
59
+ ## Caching
60
+
61
+ The server caches responses for performance. Use `clear_fabric_data_cache` to refresh resource lists or `clear_name_resolution_cache` after renaming workspaces/lakehouses.
62
+
63
+ ## Getting Started
64
+
65
+ 1. Install UV and Azure CLI (see sections below)
66
+ 2. Set up Azure CLI authentication: `az login`
67
+ 3. Configure MCP in Cursor (see "Setting up MCP" section below)
68
+
69
+ ## Installation
70
+
71
+ ### UV
72
+ ```bash
73
+ # macOS/Linux
74
+ curl -LsSf https://astral.sh/uv/install.sh | sh
75
+
76
+ # Windows
77
+ powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
78
+ ```
79
+
80
+ ## Azure CLI Authentication
81
+
82
+ This toolkit requires Azure CLI to be installed and properly configured for authentication with Microsoft Fabric services.
83
+
84
+ ### Azure CLI Setup
85
+
86
+ 1. Install Azure CLI (if not already installed):
87
+ ```bash
88
+ # For macOS
89
+ brew install azure-cli
90
+
91
+ # For Windows
92
+ # Last ned installasjonen fra: https://aka.ms/installazurecliwindows
93
+ # Eller bruk winget:
94
+ winget install -e --id Microsoft.AzureCLI
95
+
96
+ # For other platforms, see the official Azure CLI documentation
97
+ ```
98
+
99
+ 2. Log in to Azure with CLI:
100
+ ```bash
101
+ az login
102
+ ```
103
+
104
+ 3. Verify the login works:
105
+ ```bash
106
+ az account show
107
+ ```
108
+
109
+ 4. If you have multiple subscriptions, select the one you want to use:
110
+ ```bash
111
+ az account set --subscription "Name-or-ID-of-subscription"
112
+ ```
113
+
114
+ When this is done, the `DefaultAzureCredential` in our code will automatically find and use your Azure CLI authentication.
115
+
116
+ ## Setting up MCP
117
+
118
+ To use the MCP (Module Context Protocol) with this toolkit, follow these steps:
119
+
120
+ 1. Make sure you have completed the Azure CLI authentication steps above.
121
+
122
+ 2. **Choose your installation method:**
123
+
124
+ ### Option A: UVX Installation (Recommended)
125
+
126
+ Add to Cursor MCP settings:
127
+ ```json
128
+ "mcp_fabric": {
129
+ "command": "uvx",
130
+ "args": ["microsoft-fabric-mcp"]
131
+ }
132
+ ```
133
+
134
+ ### Option B: Local Development
135
+
136
+ **Clone and install:**
137
+ ```bash
138
+ git clone https://github.com/Augustab/microsoft_fabric_mcp
139
+ cd microsoft_fabric_mcp
140
+ uv pip install -e .
141
+ ```
142
+
143
+ **Add to Cursor MCP settings:**
144
+ ```json
145
+ "mcp_fabric": {
146
+ "command": "uv",
147
+ "args": [
148
+ "--directory",
149
+ "/Users/username/Documents/microsoft_fabric_mcp",
150
+ "run",
151
+ "fabric_mcp.py"
152
+ ]
153
+ }
154
+ ```
155
+
156
+ Replace `/Users/username/Documents/microsoft_fabric_mcp` with your actual path.
157
+
158
+ > **💡 Note**: Both methods run the MCP server locally on your machine. The UVX method just makes installation much easier!
159
+
160
+ 3. Once the MCP is configured, you can interact with Microsoft Fabric resources directly from your tools and applications.
161
+
162
+ 4. You can use the provided MCP tools to list workspaces, lakehouses, and tables, as well as extract schema information as documented in the tools section.
163
+
164
+ 5. When successfully configured, your MCP will appear in Cursor settings like this:
165
+
166
+ <div align="center">
167
+ <img src="images/fmcp.png" alt="Successful MCP setup in Cursor" title="MCP setup as shown in Cursor settings" width="50%">
168
+ </div>
169
+
170
+ ## Windows Setup
171
+
172
+ ### Setting up the MCP Command
173
+
174
+ On Windows, you can create a batch file to easily run the MCP command:
175
+
176
+ 1. Create a file named `run_mcp.bat` with the following content:
177
+ ```
178
+ @echo off
179
+ SET PATH=C:\Users\YourUsername\.local\bin;%PATH%
180
+ cd C:\path\to\your\microsoft_fabric_mcp\
181
+ C:\Users\YourUsername\.local\bin\uv.exe run fabric_mcp.py
182
+ ```
183
+
184
+ Example with real paths:
185
+ ```
186
+ @echo off
187
+ SET PATH=C:\Users\YourUsername\.local\bin;%PATH%
188
+ cd C:\Users\YourUsername\source\repos\microsoft_fabric_mcp\
189
+ C:\Users\YourUsername\.local\bin\uv.exe run fabric_mcp.py
190
+ ```
191
+
192
+ 2. You can then run the MCP command by executing:
193
+ ```
194
+ cmd /c C:\path\to\your\microsoft_fabric_mcp\run_mcp.bat
195
+ ```
196
+
197
+ Example:
198
+ ```
199
+ cmd /c C:\Users\YourUsername\source\repos\microsoft_fabric_mcp\run_mcp.bat
200
+ ```
201
+
202
+ ### Virtual Environment Permissions
203
+
204
+ When activating the virtual environment using `.venv\Scripts\activate` on Windows, you might encounter permission issues. To resolve this, run the following command in PowerShell before activation:
205
+
206
+ ```powershell
207
+ Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
208
+ ```
209
+
210
+ This temporarily changes the execution policy for the current PowerShell session only, allowing scripts to run.
211
+
212
+ ## Example Usage
213
+
214
+ After setup, you can query your Fabric resources through your AI assistant:
215
+
216
+ ### Listing Workspaces in Fabric
217
+
218
+ Ask your AI assistant natural language questions:
219
+
220
+ ```
221
+ Can you list my workspaces in Fabric?
222
+ Can you show me all the lakehouses in the "DWH-PROD" workspace?
223
+ Can you get the schema for the "sales" table in the "GK_Bronze" lakehouse?
224
+ ```
225
+
226
+ The AI will automatically select the appropriate MCP tool and display results:
227
+
228
+ <div align="center">
229
+ <img src="images/list_workspaces_example.png" alt="Example of listing Fabric workspaces" title="Example of listing workspaces in Fabric" width="450" />
230
+ </div>
231
+
232
+ ### Advanced Use Cases
233
+
234
+ For complex tasks, the AI can access multiple resources to generate accurate code:
235
+
236
+ ```
237
+ Create a notebook that reads from the 'sales' table in Bronze lakehouse and upserts to 'sales_processed' in Silver lakehouse, considering both schemas.
238
+ ```
239
+
240
+ The AI will:
241
+ 1. Get schemas for both tables
242
+ 2. Generate code with correct data types
243
+ 3. Create an efficient upsert operation
244
+
245
+ ### Permission Handling
246
+
247
+ The AI will ask permission before running MCP tools. In Cursor, you can enable YOLO mode for automatic execution without prompts.
248
+
249
+ ## About Model Context Protocol
250
+
251
+ Model Context Protocol (MCP) is an open standard that enables AI assistants to securely connect to external data sources and tools. This server implements MCP to provide AI assistants with direct access to your Microsoft Fabric resources.
252
+
253
+ Learn more: [Model Context Protocol Documentation](https://www.anthropic.com/news/model-context-protocol)
254
+
255
+ ## Contributing
256
+
257
+ Feel free to contribute additional tools, utilities, or improvements to existing code. Please follow the existing code structure and include appropriate documentation.