Microsoft Fabric MCP Server

$uvx ms-fabric-mcp-server
README.md

Enables AI agents to interact with Microsoft Fabric via MCP tools.

ms-fabric-mcp-server

A Model Context Protocol (MCP) server for Microsoft Fabric. Exposes Fabric operations (workspaces, notebooks, SQL, Livy, pipelines, jobs) as MCP tools that AI agents can invoke.

⚠️ Warning: This package is intended for development environments only and should not be used in production. It includes tools that can perform destructive operations (e.g., delete_item, delete_lakehouse_file, delete_activity_from_pipeline) and execute arbitrary code via Livy Spark sessions. Always review AI-generated tool calls before execution.

Quick Start

The fastest way to use this MCP server is with uvx:

uvx ms-fabric-mcp-server

Installation

# Using uv (recommended)
uv pip install ms-fabric-mcp-server

# Using pip
pip install ms-fabric-mcp-server

# With SQL support (requires pyodbc)
pip install ms-fabric-mcp-server[sql]

# With OpenTelemetry tracing
pip install ms-fabric-mcp-server[sql,telemetry]

Authentication

Uses DefaultAzureCredential from azure-identity - no explicit credential configuration needed. This automatically tries multiple authentication methods:

  1. Environment credentials (AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET)
  2. Managed Identity (when running on Azure)
  3. Azure CLI credentials (az login)
  4. VS Code credentials
  5. Azure PowerShell credentials

No Fabric-specific auth environment variables are needed - it just works if you're authenticated via any of the above methods.

Usage

VS Code Integration

Add to your VS Code MCP settings (.vscode/mcp.json or User settings):

{
  "servers": {
    "MS Fabric MCP Server": {
      "type": "stdio",
      "command": "uvx",
      "args": ["ms-fabric-mcp-server"]
    }
  }
}

Claude Desktop Integration

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "fabric": {
      "command": "uvx",
      "args": ["ms-fabric-mcp-server"]
    }
  }
}

Codex Integration

Add to your Codex config.toml:

[mcp_servers.ms_fabric_mcp]
command = "uvx"
args = ["ms-fabric-mcp-server"]

Running Standalone

# Using uvx (no installation needed)
uvx ms-fabric-mcp-server

# Direct execution (if installed)
ms-fabric-mcp-server

# Via Python module
python -m ms_fabric_mcp_server

# With MCP Inspector (development)
npx @modelcontextprotocol/inspector uvx ms-fabric-mcp-server

Logging & Debugging (optional)

MCP stdio servers must keep protocol traffic on stdout, so redirect stderr to capture logs. Giving the agent read access to the log file is a powerful way to debug failures. You can also set AZURE_LOG_LEVEL (Azure SDK) and MCP_LOG_LEVEL (server) to control verbosity.

VS Code (Bash):

{
  "servers": {
    "MS Fabric MCP Server": {
      "type": "stdio",
      "command": "bash",
      "args": [
        "-lc",
        "LOG_DIR=\"$HOME/mcp_logs\"; LOG_FILE=\"$LOG_DIR/ms-fabric-mcp-$(date +%Y%m%d_%H%M%S).log\"; uvx ms-fabric-mcp-server 2> \"$LOG_FILE\""
      ],
      "env": {
        "AZURE_LOG_LEVEL": "info",
        "MCP_LOG_LEVEL": "INFO"
      }
    }
  }
}

VS Code (PowerShell):

{
  "servers": {
    "MS Fabric MCP Server": {
      "type": "stdio",
      "command": "powershell",
      "args": [
        "-NoProfile",
        "-Command",
        "$logDir=\"$env:USERPROFILE\\mcp_logs\"; New-Item -ItemType Directory -Force -Path $logDir | Out-Null; $ts=Get-Date -Format yyyyMMdd_HHmmss; $logFile=\"$logDir\\ms-fabric-mcp-$ts.log\"; uvx ms-fabric-mcp-server 2> $logFile"
      ],
      "env": {
        "AZURE_LOG_LEVEL": "info",
        "MCP_LOG_LEVEL": "INFO"
      }
    }
  }
}

Programmatic Usage (Library Mode)

from fastmcp import FastMCP
from ms_fabric_mcp_server import register_fabric_tools

# Create your own server
mcp = FastMCP("my-custom-server")

# Register all Fabric tools
register_fabric_tools(mcp)

# Add your own customizations...

mcp.run()

Configuration

Environment variables (all optional with sensible defaults):

Variable Default Description
FABRIC_BASE_URL https://api.fabric.microsoft.com/v1 Fabric API base URL
FABRIC_SCOPES https://api.fabric.microsoft.com/.default OAuth scopes
FABRIC_API_CALL_TIMEOUT 30 API timeout (seconds)
FABRIC_MAX_RETRIES 3 Max retry attempts
FABRIC_RETRY_BACKOFF 2.0 Backoff facto

Tools (8)

delete_itemDeletes a specific item from a Microsoft Fabric workspace.
delete_lakehouse_fileDeletes a file from a Fabric Lakehouse.
delete_activity_from_pipelineRemoves an activity from a Fabric data pipeline.
manage_workspacesOperations for managing Fabric workspaces.
manage_notebooksOperations for managing and interacting with Fabric notebooks.
execute_sql_queryExecutes SQL queries against Fabric data warehouses or lakehouses.
manage_livy_sessionsManage and execute code via Livy Spark sessions.
manage_pipelinesOperations for managing and running Fabric pipelines and jobs.

Environment Variables

FABRIC_BASE_URLFabric API base URL (default: https://api.fabric.microsoft.com/v1)
FABRIC_SCOPESOAuth scopes (default: https://api.fabric.microsoft.com/.default)
FABRIC_API_CALL_TIMEOUTAPI timeout in seconds
FABRIC_MAX_RETRIESMax retry attempts
AZURE_CLIENT_IDAzure Service Principal Client ID
AZURE_TENANT_IDAzure Tenant ID
AZURE_CLIENT_SECRETAzure Service Principal Client Secret

Configuration

claude_desktop_config.json
{
  "mcpServers": {
    "fabric": {
      "command": "uvx",
      "args": ["ms-fabric-mcp-server"]
    }
  }
}

Try it

List all the workspaces in my Microsoft Fabric account.
Run a SQL query to count the rows in the 'Sales' table in my Lakehouse.
Start a new Livy Spark session and run a simple PySpark script.
Trigger the 'Daily_Ingestion' pipeline and check its status.
Delete the old temporary file from my Lakehouse storage.

Frequently Asked Questions

What are the key features of Microsoft Fabric MCP Server?

Comprehensive Fabric operations including workspaces, notebooks, SQL, and pipelines.. Support for Livy Spark sessions to execute arbitrary code.. Seamless Azure authentication using DefaultAzureCredential (CLI, VS Code, or Env Vars).. Extensible library mode for programmatic integration into custom FastMCP servers..

What can I use Microsoft Fabric MCP Server for?

Data engineers automating the management of Fabric pipelines and notebooks.. Data analysts querying Fabric Lakehouses using natural language via AI agents.. DevOps teams managing Fabric workspace items and permissions through automated scripts.. Developers debugging Spark sessions and Livy jobs directly from an MCP-enabled chat interface..

How do I install Microsoft Fabric MCP Server?

Install Microsoft Fabric MCP Server by running: uvx ms-fabric-mcp-server

What MCP clients work with Microsoft Fabric MCP Server?

Microsoft Fabric MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Use Microsoft Fabric MCP Server with Conare

Manage MCP servers visually, upload persistent context, and never start from zero with Claude Code & Codex.

Try Free