Safe, read-only MCP server for Microsoft Fabric - 25 tools for data engineers
Project description
Microsoft Fabric MCP
Introduction
This MCP server provides data engineers with safe, read-only access to Microsoft Fabric resources through AI assistants like Cursor, Claude, and other MCP-compatible tools.
Built around the Fabric REST API using only GET requests, it includes 27 tools that let you query workspace details, examine table schemas, monitor job execution, and analyze data dependencies - all without any risk of modifying your production data.
Instead of switching between the Fabric portal and your IDE, you can now ask your AI assistant questions like "What tables are in my lakehouse?" or "Show me the schema for the sales table" and get immediate, accurate responses.
🔍 Key Features
- 100% Safe Operations: Uses only GET requests - no data modification possible
- 99% READ-ONLY: 25 read-only tools + 2 cache management tools - safe for production use
- Comprehensive Coverage: 25 tools covering all major Fabric operational areas
- Smart Filtering: Most tools support optional filtering for targeted analysis
- Operational Intelligence: Advanced tools for lineage, dependencies, and resource monitoring
- High Performance: TTL caching for fast responses with cache invalidation on demand
- Enterprise Ready: Designed for production Fabric environments and governance
Available MCP Tools
This MCP server provides 27 comprehensive tools for complete Fabric operational visibility:
📝 Parameter Note: When you see
workspaceas a parameter, it accepts either the workspace name (like "DWH-PROD", "Analytics-Dev") or the workspace ID/GUID. Workspace names are more user-friendly and recommended for most use cases. The system automatically resolves names to IDs with smart caching for performance.
🏢 Core Fabric Management
| Tool | Description | Inputs |
|---|---|---|
list_workspaces |
List all accessible Fabric workspaces | None |
get_workspace |
Get detailed workspace info including workspace identity status | workspace (name/ID) |
list_items |
List all items in workspace with optional type filtering | workspace (name/ID), item_type (optional) |
get_item |
Get detailed properties and metadata for specific item | workspace (name/ID), item_name (name/ID) |
list_connections |
List all connections user has access to across entire tenant | None |
list_lakehouses |
List all lakehouses in specified workspace | workspace (name/ID) |
list_capacities |
List all Fabric capacities user has access to | None |
get_workspace_identity |
Get workspace identity details for a specific workspace | workspace (name/ID) |
list_workspaces_with_identity |
List workspaces that have workspace identities configured | None |
📊 Data & Schema Management
| Tool | Description | Inputs |
|---|---|---|
get_all_schemas |
Get schemas for all Delta tables in lakehouse | workspace (name/ID), lakehouse (name/ID) |
get_table_schema |
Get detailed schema for specific table | workspace (name/ID), lakehouse (name/ID), table_name |
list_tables |
List all tables in lakehouse with format/type info | workspace (name/ID), lakehouse (name/ID) |
list_shortcuts |
List OneLake shortcuts for specific item | workspace (name/ID), item_name (name/ID), parent_path (optional) |
get_shortcut |
Get detailed shortcut configuration and target | workspace (name/ID), item_name (name/ID), shortcut_name, parent_path (optional) |
list_workspace_shortcuts |
Aggregate all shortcuts across workspace items | workspace (name/ID) |
⚡ Job Monitoring & Scheduling
| Tool | Description | Inputs |
|---|---|---|
list_job_instances |
List job instances with status/item filtering for monitoring | workspace (name/ID), item_name (optional), status (optional) |
get_job_instance |
Get detailed job info including errors and timing | workspace (name/ID), item_name (name/ID), job_instance_id |
list_item_schedules |
List all schedules for specific item | workspace (name/ID), item_name (name/ID) |
list_workspace_schedules |
Aggregate all schedules across workspace - complete scheduling overview | workspace (name/ID) |
🎯 Operational Intelligence
| Tool | Description | Inputs |
|---|---|---|
list_compute_usage |
Monitor active jobs and estimate resource consumption | workspace (optional), time_range_hours (default: 24) |
get_item_lineage |
Analyze data flow dependencies upstream/downstream | workspace (name/ID), item_name (name/ID) |
list_item_dependencies |
Map all item dependencies in workspace | workspace (name/ID), item_type (optional) |
get_data_source_usage |
Analyze connection usage patterns across items | workspace (optional), connection_name (optional) |
list_environments |
List Fabric environments for compute/library management | workspace (optional) |
get_environment_details |
Get detailed environment config including Spark settings and libraries | workspace (name/ID), environment_name (name/ID) |
🛠️ Cache Management & Administration
| Tool | Description | Inputs |
|---|---|---|
clear_fabric_data_cache |
Clear all data list caches to see newly created resources immediately | show_stats (optional, default: true) |
clear_name_resolution_cache |
Clear global name→ID resolution caches for workspaces and lakehouses | show_stats (optional, default: true) |
Cache Management System
💡 Note for Users: Cache management is completely optional. The MCP works perfectly without any cache intervention. These tools are only provided for advanced users who need to see newly created resources immediately or troubleshoot specific caching scenarios.
The MCP server uses a sophisticated two-tier caching system for optimal performance:
🔄 Data List Caches (TTL-based)
These caches store lists of resources (workspaces, items, connections, etc.) and automatically expire after a set time:
- Purpose: Speed up repeated queries for resource lists
- Behavior: Automatically refresh when expired
- Use Case: When you create new resources and want to see them immediately in lists
Clear with: clear_fabric_data_cache
🏷️ Name Resolution Caches (Global, Permanent)
These caches store name→ID mappings and persist across all requests:
- Purpose: Avoid repeated API calls to resolve workspace/lakehouse names to IDs
- Behavior: Never expire automatically (name→ID mappings are permanent)
- Use Case: When a workspace/lakehouse is renamed or deleted/recreated with the same name
Clear with: clear_name_resolution_cache
When to Use Each Cache Tool
| Scenario | Tool to Use | Reason |
|---|---|---|
| Created a new workspace/lakehouse | clear_fabric_data_cache |
See new resources in lists |
| Renamed a workspace/lakehouse | clear_name_resolution_cache |
Update name→ID mappings |
| Deleted and recreated a resource with same name | clear_name_resolution_cache |
New resource has different ID |
| General performance troubleshooting | clear_fabric_data_cache |
Refresh all data lists |
| Suspect stale name resolution | clear_name_resolution_cache |
Force fresh name lookups |
Both tools are safe to use and will show detailed statistics about what was cleared.
Getting Started
- Clone this repository
- Install required dependencies using UV (see "Setting Up UV Project" section below)
- Set up Azure CLI authentication (see "Azure CLI Authentication" section below)
- Use the tools as needed for your data engineering tasks
Setting Up UV Project
After cloning this repository, follow these steps to set up the UV project:
- Install UV (if not already installed):
# On macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# On Windows (using PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
- Create a virtual environment:
uv venv
- Activate the virtual environment:
# On macOS/Linux
source .venv/bin/activate
# On Windows
.venv\Scripts\activate
- Install dependencies:
uv pip install -e .
- Verify installation:
uv run fabric_mcp.py
This confirms that everything is working correctly.
Azure CLI Authentication
This toolkit requires Azure CLI to be installed and properly configured for authentication with Microsoft Fabric services.
Azure CLI Setup
- Install Azure CLI (if not already installed):
# For macOS
brew install azure-cli
# For Windows
# Last ned installasjonen fra: https://aka.ms/installazurecliwindows
# Eller bruk winget:
winget install -e --id Microsoft.AzureCLI
# For other platforms, see the official Azure CLI documentation
- Log in to Azure with CLI:
az login
- Verify the login works:
az account show
- If you have multiple subscriptions, select the one you want to use:
az account set --subscription "Name-or-ID-of-subscription"
When this is done, the DefaultAzureCredential in our code will automatically find and use your Azure CLI authentication.
Setting up MCP
To use the MCP (Module Context Protocol) with this toolkit, follow these steps:
-
Make sure you have completed the Azure CLI authentication steps above.
-
Choose your installation method:
🚀 Option A: UVX Installation (Recommended - Easy)
Install the package:
uvx install microsoft-fabric-mcp
Add to Cursor MCP settings:
"mcp_fabric": {
"command": "uvx",
"args": ["run", "microsoft-fabric-mcp"]
}
🛠️ Option B: Local Development (For Contributors)
Clone and install:
git clone https://github.com/Augustab/microsoft_fabric_mcp
cd microsoft_fabric_mcp
uv pip install -e .
Add to Cursor MCP settings:
"mcp_fabric": {
"command": "uv",
"args": [
"--directory",
"/Users/username/Documents/microsoft_fabric_mcp",
"run",
"fabric_mcp.py"
]
}
Replace /Users/username/Documents/microsoft_fabric_mcp with your actual path.
💡 Note: Both methods run the MCP server locally on your machine. The UVX method just makes installation much easier!
-
Once the MCP is configured, you can interact with Microsoft Fabric resources directly from your tools and applications.
-
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.
-
When successfully configured, your MCP will appear in Cursor settings like this:
Windows Setup
Setting up the MCP Command
On Windows, you can create a batch file to easily run the MCP command:
-
Create a file named
run_mcp.batwith the following content:@echo off SET PATH=C:\Users\YourUsername\.local\bin;%PATH% cd C:\path\to\your\microsoft_fabric_mcp\ C:\Users\YourUsername\.local\bin\uv.exe run fabric_mcp.pyExample with real paths:
@echo off SET PATH=C:\Users\YourUsername\.local\bin;%PATH% cd C:\Users\YourUsername\source\repos\microsoft_fabric_mcp\ C:\Users\YourUsername\.local\bin\uv.exe run fabric_mcp.py -
You can then run the MCP command by executing:
cmd /c C:\path\to\your\microsoft_fabric_mcp\run_mcp.batExample:
cmd /c C:\Users\YourUsername\source\repos\microsoft_fabric_mcp\run_mcp.bat
Virtual Environment Permissions
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:
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
This temporarily changes the execution policy for the current PowerShell session only, allowing scripts to run.
Example Usage
Once you have set up the MCP server, you can start interacting with your Fabric resources through your AI assistant. Here's an example of how to use it:
Listing Workspaces in Fabric
You can simply ask your AI assistant to list your workspaces in Fabric:
Can you list my workspaces in Fabric?
Then use either workspace names or IDs in subsequent commands:
Can you show me all the lakehouses in the "DWH-PROD" workspace?
Can you get the schema for the "sales" table in the "GK_Bronze" lakehouse in "DWH-PROD"?
# Or using workspace ID if you have it:
Can you list items in workspace "abc-123-def-456"?
The LLM will automatically understand which MCP tool to use based on your query. It will invoke the list_workspaces tool and display the results:
Advanced Use Cases
The main advantage of this MCP integration becomes clear when working with more complex tasks. For example, you can ask Claude to create a notebook that reads data from a specific table in one lakehouse and upserts it into another table in a silver lakehouse:
Can you create a notebook that reads data from the 'sales' table in the Bronze lakehouse and upserts it into the 'sales_processed' table in the Silver lakehouse? The notebook should take into consideration the schema of both tables.
In this scenario, Claude can use the MCP tools to:
- Get the schema information for both tables
- Understand the data structure and relationships
- Generate appropriate code that handles data types correctly
- Create an efficient upsert operation based on the actual table schemas
This level of context-aware assistance would be impossible without the MCP integration giving Claude access to your actual Fabric resources and schemas.
Permission Handling
By default, the AI assistant will ask for your permission before running MCP tools that interact with your data. This gives you control over what actions are performed.
If you're using Cursor and want to enable faster interactions, you can enable YOLO mode in the settings. With YOLO mode enabled, the AI assistant will execute MCP tools without asking for permission each time.
Note: YOLO mode is convenient but should be used with caution, as it grants the AI assistant more autonomous access to your data sources.
What is Model Context Protocol (MCP)?
The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to Large Language Models (LLMs). Think of MCP like a standardized connection port for AI applications - it provides a standardized way to connect AI models to different data sources and tools.
How MCP Works
MCP follows a client-server architecture:
- MCP Hosts: Programs like Cursor IDE, Windsurf, Claude CLI, or other AI tools that want to access data through MCP
- MCP Clients: Protocol clients that maintain connections with servers
- MCP Servers: Lightweight programs (like this Microsoft Fabric MCP) that expose specific capabilities through the standardized protocol
- Data Sources: Your Fabric resources, databases, and other services that MCP servers can securely access
This architecture allows LLMs to interact with your data and tools in a standardized way, making it possible to:
- Connect to pre-built integrations that your LLM can directly use
- Maintain flexibility to switch between LLM providers
- Keep your data secure within your infrastructure
For this project, we recommend using Cursor as your IDE for the best experience, though Windsurf and Claude CLI are also compatible options.
Contributing
Feel free to contribute additional tools, utilities, or improvements to existing code. Please follow the existing code structure and include appropriate documentation.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file microsoft_fabric_mcp-0.1.1.tar.gz.
File metadata
- Download URL: microsoft_fabric_mcp-0.1.1.tar.gz
- Upload date:
- Size: 33.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
235f4eaadd650c3f5a40b18094bc5f017be03d60fc0e73dc5ea9ef2ec798e126
|
|
| MD5 |
3599769bf9add6bacf1552b8f1e18c2e
|
|
| BLAKE2b-256 |
65fec49db445ab5d0343e6c58d1a737db8c45138e23c272a25ea5b6fcb519a16
|
File details
Details for the file microsoft_fabric_mcp-0.1.1-py3-none-any.whl.
File metadata
- Download URL: microsoft_fabric_mcp-0.1.1-py3-none-any.whl
- Upload date:
- Size: 27.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2d20f7806069b91d3c63030bc6259ac0926e0e9245749a03d8016c1de41bad6
|
|
| MD5 |
afd49925aeb36e105785cc697b1d0beb
|
|
| BLAKE2b-256 |
adedbb2d63855e95edb170e77b3ae3a6ac7154d2a2a5ac92b8d738482709e5b5
|