# fabric-dw

An MCP server and CLI for Microsoft Fabric Data Warehouses and SQL Analytics Endpoints: run queries, read plans, check permissions and statistics from your agent.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 10
- Author: sdebruyn
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/sdebruyn/fabric-dw-mcp-cli
- Updated: 2026-10-11
- HTML: https://affpapa.org/en/nevibecode/mcp/fabric-dw

## What it does

\`fabric-dw` ships two ways into Microsoft Fabric: the `fdw` command line tool and an MCP server that hands the same operations to an AI assistant as tools. Covered objects include workspaces, warehouses, SQL endpoints, schemas, tables, views, queries, snapshots, restore points, audit, statistics, permissions and SQL pools.

Auth runs through the `FABRIC_AUTH` variable. The default mode follows the `DefaultAzureCredential` chain from `azure-identity`: environment variables, workload or managed identity, Azure CLI, Azure Developer CLI, Azure PowerShell, then an interactive browser. Any one of them is enough — so on a box with no Azure credentials configured, the server has nothing to authenticate with.

Bundled Claude skills — `query-optimizer`, `warehouse-performance` and `dbt-setup` — arrive with the server through the plugin marketplace, one pair of commands for Claude and GitHub Copilot CLI. You can pin a workspace once with `fdw config set workspace <NAME>` and drop `-w` from later calls. A Docker image is published too: its default `ENTRYPOINT` is the MCP server, and you override it to `fabric-dw` when you want the CLI.

On the CLI side, `fdw sql plan` renders an estimated plan as SVG without SSMS or Windows, `fdw queries running` lists what is executing right now, `fdw tables read` shows a table as it looked at an earlier point, and `fdw tables export` writes a point-in-time snapshot to Parquet.

## Requirements
- Needs: Docker
- Environment variables: `FABRIC_AUTH`, `FABRIC_MCP_READONLY`, `FABRIC_MCP_ALLOW_DESTRUCTIVE`, `FABRIC_MCP_WORKSPACES`, `FABRIC_MCP_ALLOW_REMOTE`, `FABRIC_LOG_LEVEL` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env FABRIC_AUTH=<FABRIC_AUTH> --env FABRIC_MCP_READONLY=<FABRIC_MCP_READONLY> --env FABRIC_MCP_ALLOW_DESTRUCTIVE=<FABRIC_MCP_ALLOW_DESTRUCTIVE> --env FABRIC_MCP_WORKSPACES=<FABRIC_MCP_WORKSPACES> --env FABRIC_MCP_ALLOW_REMOTE=<FABRIC_MCP_ALLOW_REMOTE> --transport stdio fabric-dw -- docker run -i --rm -e FABRIC_AUTH -e FABRIC_MCP_READONLY -e FABRIC_MCP_ALLOW_DESTRUCTIVE -e FABRIC_MCP_WORKSPACES -e FABRIC_MCP_ALLOW_REMOTE ghcr.io/sdebruyn/fabric-dw:2026.9.0
```
Replace <…> with your own values. 1 more environment variable is in the server README

### Codex

**Platform CLI**
```bash
codex mcp add fabric-dw --env FABRIC_AUTH=<FABRIC_AUTH> --env FABRIC_MCP_READONLY=<FABRIC_MCP_READONLY> --env FABRIC_MCP_ALLOW_DESTRUCTIVE=<FABRIC_MCP_ALLOW_DESTRUCTIVE> --env FABRIC_MCP_WORKSPACES=<FABRIC_MCP_WORKSPACES> --env FABRIC_MCP_ALLOW_REMOTE=<FABRIC_MCP_ALLOW_REMOTE> -- docker run -i --rm -e FABRIC_AUTH -e FABRIC_MCP_READONLY -e FABRIC_MCP_ALLOW_DESTRUCTIVE -e FABRIC_MCP_WORKSPACES -e FABRIC_MCP_ALLOW_REMOTE ghcr.io/sdebruyn/fabric-dw:2026.9.0
```
Replace <…> with your own values. 1 more environment variable is in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "fabric-dw": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "-e",
                "FABRIC_AUTH",
                "-e",
                "FABRIC_MCP_READONLY",
                "-e",
                "FABRIC_MCP_ALLOW_DESTRUCTIVE",
                "-e",
                "FABRIC_MCP_WORKSPACES",
                "-e",
                "FABRIC_MCP_ALLOW_REMOTE",
                "ghcr.io/sdebruyn/fabric-dw:2026.9.0"
            ],
            "env": {
                "FABRIC_AUTH": "<FABRIC_AUTH>",
                "FABRIC_MCP_READONLY": "<FABRIC_MCP_READONLY>",
                "FABRIC_MCP_ALLOW_DESTRUCTIVE": "<FABRIC_MCP_ALLOW_DESTRUCTIVE>",
                "FABRIC_MCP_WORKSPACES": "<FABRIC_MCP_WORKSPACES>",
                "FABRIC_MCP_ALLOW_REMOTE": "<FABRIC_MCP_ALLOW_REMOTE>"
            }
        }
    }
}
```
Replace <…> with your own values. 1 more environment variable is in the server README

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "fabric-dw": {
            "type": "stdio",
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "-e",
                "FABRIC_AUTH",
                "-e",
                "FABRIC_MCP_READONLY",
                "-e",
                "FABRIC_MCP_ALLOW_DESTRUCTIVE",
                "-e",
                "FABRIC_MCP_WORKSPACES",
                "-e",
                "FABRIC_MCP_ALLOW_REMOTE",
                "ghcr.io/sdebruyn/fabric-dw:2026.9.0"
            ],
            "env": {
                "FABRIC_AUTH": "<FABRIC_AUTH>",
                "FABRIC_MCP_READONLY": "<FABRIC_MCP_READONLY>",
                "FABRIC_MCP_ALLOW_DESTRUCTIVE": "<FABRIC_MCP_ALLOW_DESTRUCTIVE>",
                "FABRIC_MCP_WORKSPACES": "<FABRIC_MCP_WORKSPACES>",
                "FABRIC_MCP_ALLOW_REMOTE": "<FABRIC_MCP_ALLOW_REMOTE>"
            }
        }
    }
}
```
Replace <…> with your own values. 1 more environment variable is in the server README

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e FABRIC_AUTH=<FABRIC_AUTH> -e FABRIC_MCP_READONLY=<FABRIC_MCP_READONLY> -e FABRIC_MCP_ALLOW_DESTRUCTIVE=<FABRIC_MCP_ALLOW_DESTRUCTIVE> -e FABRIC_MCP_WORKSPACES=<FABRIC_MCP_WORKSPACES> -e FABRIC_MCP_ALLOW_REMOTE=<FABRIC_MCP_ALLOW_REMOTE> fabric-dw docker run -i --rm -e FABRIC_AUTH -e FABRIC_MCP_READONLY -e FABRIC_MCP_ALLOW_DESTRUCTIVE -e FABRIC_MCP_WORKSPACES -e FABRIC_MCP_ALLOW_REMOTE ghcr.io/sdebruyn/fabric-dw:2026.9.0
```
Replace <…> with your own values. 1 more environment variable is in the server README

## When to use it
- run a SQL query against a Fabric warehouse from the terminal
- render an estimated query plan as SVG without SSMS
- find long-running queries from the past hour
- export a point-in-time table snapshot to Parquet
- grant or deny access at the column level

## Example prompts
- Show me what is running right now in SalesWH
- Export dbo.orders as it looked two hours ago to Parquet
- Read the plan in `query.sql` and tell me what to rewrite

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40409
- [dbx](https://affpapa.org/en/nevibecode/mcp/dbx.md) — MCP server · ★ 27669
- [Metabase](https://affpapa.org/en/nevibecode/mcp/metabase.md) — MCP server · ★ 49845

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
