{
  "markdown": "<p align=\"center\">\n  <a href=\"https://fdw.debruyn.dev\">\n    <img src=\"https://raw.githubusercontent.com/sdebruyn/fabric-dw-mcp-cli/main/docs/assets/logo.svg\" alt=\"fabric-dw logo\" width=\"200\" />\n  </a>\n</p>\n<h1 align=\"center\">fabric-dw</h1>\n\n<p align=\"center\">\n  <a href=\"https://fdw.debruyn.dev\"><img src=\"https://img.shields.io/badge/docs-fdw.debruyn.dev-blue\" alt=\"Documentation\"></a>\n  <a href=\"https://github.com/sdebruyn/fabric-dw-mcp-cli/actions/workflows/ci.yml\"><img src=\"https://github.com/sdebruyn/fabric-dw-mcp-cli/actions/workflows/ci.yml/badge.svg\" alt=\"CI\"></a>\n  <a href=\"https://codecov.io/gh/sdebruyn/fabric-dw-mcp-cli\"><img src=\"https://codecov.io/gh/sdebruyn/fabric-dw-mcp-cli/graph/badge.svg\" alt=\"codecov\"></a>\n  <a href=\"https://pypi.org/project/fabric-dw/\"><img src=\"https://img.shields.io/pypi/v/fabric-dw\" alt=\"PyPI version\"></a>\n  <a href=\"https://pypi.org/project/fabric-dw/\"><img src=\"https://img.shields.io/pypi/pyversions/fabric-dw\" alt=\"Python versions\"></a>\n  <a href=\"LICENSE\"><img src=\"https://img.shields.io/github/license/sdebruyn/fabric-dw-mcp-cli\" alt=\"License\"></a>\n</p>\n\nPython CLI and MCP server for Microsoft Fabric Data Warehouses and SQL Analytics Endpoints: administer, query, optimize, and secure them from your terminal or your AI agent.\n\n**Full documentation: [fdw.debruyn.dev](https://fdw.debruyn.dev)**\n\n📣 **Just announced!** Read the story behind `fabric-dw` in the [announcement blog post](https://debruyn.dev/2026/introducing-the-fabric-data-warehouse-cli-and-mcp-server/).\n\n## Description\n\n`fabric-dw` provides two interfaces for managing Microsoft Fabric Data Warehouses and SQL Analytics Endpoints:\n\n- **CLI**: a command-line tool for common DW administration tasks.\n- **MCP server**: a [Model Context Protocol](https://modelcontextprotocol.io) server that exposes DW operations as tools for AI assistants.\n\nAuthentication is configured via the `FABRIC_AUTH` environment variable. The default (`FABRIC_AUTH=default`) uses [`azure-identity` `DefaultAzureCredential`](https://learn.microsoft.com/python/api/azure-identity/azure.identity.defaultazurecredential?WT.mc_id=MVP_310840), which walks environment variables, Workload/Managed Identity, Azure CLI, Azure Developer CLI, Azure PowerShell, and interactive browser in order. Any of these will satisfy it. See the [Authentication](https://fdw.debruyn.dev/authentication/) docs for the full chain, all supported sources, and debugging tips.\n\n## Installation\n\n```bash\npip install fabric-dw\n# or run without installing:\nuvx fabric-dw --help\n# or install persistently on PATH:\nuv tool install fabric-dw\n```\n\nAfter installation, the `fdw` command is a short alias for `fabric-dw`; both invoke the same entry point. See the [Install](https://fdw.debruyn.dev/install/) docs for MCP server setup, upgrading, and prerelease builds.\n\n## Quick Start\n\n### CLI\n\nThe workspace is a **global root option** `-w` / `--workspace` placed before the command group. Set a default once with `fdw config set workspace <NAME>` and omit `-w` on every subsequent call. Workspace resolution order: (1) `-w` flag, (2) `FABRIC_DW_DEFAULT_WORKSPACE` env var, (3) configured default.\n\n```bash\n# Run without installing; install to get the fdw alias\nuvx fabric-dw --help\n\n# Set a default workspace once; all subsequent commands pick it up\nfdw config set workspace SalesWS\n```\n\n```bash\n# -- Run and explain SQL --\n\n# Execute a query against a warehouse\nfdw sql exec SalesWH -q \"SELECT TOP 10 * FROM dbo.orders ORDER BY order_date DESC\"\n\n# Capture an estimated execution plan as SVG -- no SSMS or Windows needed\nfdw sql plan SalesWH -f query.sql --format svg -o plan.svg\n\n# -- Performance mission-control --\n\n# See what is running right now\nfdw queries running SalesWH\n\n# Long-running queries from the past hour\nfdw queries long-running SalesWH --ago 1h\n\n# Kill a runaway session by ID\nfdw queries kill SalesWH 55\n\n# Most-repeated queries over the past 24 hours\nfdw queries frequent SalesWH --ago 24h\n\n# -- Optimize --\n\n# Inspect a statistics histogram with inline terminal bar charts\nfdw statistics show SalesWH dbo.orders st_order_date --histogram\n\n# Re-cluster a table on a new key (transactional CTAS-swap, auto-rollback on failure)\nfdw tables cluster-by SalesWH dbo.orders --cluster-by customer_id\n\n# -- Time travel + export --\n\n# Browse the table as it looked 2 hours ago\nfdw tables read SalesWH dbo.orders --ago 2h\n\n# Export a point-in-time snapshot to Parquet\nfdw tables export SalesWH dbo.orders --output snapshot.parquet --ago 2h\n\n# -- Governance --\n\n# Grant SELECT on a specific table\nfdw permissions sql grant SalesWH SELECT --to analyst@company.com --object dbo.orders\n\n# Deny access to sensitive columns (column-level security)\nfdw permissions cls deny SalesWH SELECT --to contractor@company.com \\\n    --object dbo.orders --columns salary,bonus\n\n# Create a row-level security policy (filter rows by SalesRep)\nfdw permissions rls create SalesWH rls.SalesFilter \\\n    --filter \"rls.fn_sales_filter(SalesRep)\" --on dbo.orders\n\n# -- Load + scaffold --\n\n# Load a local Parquet file and auto-create the table from its schema\nfdw tables load SalesWH dbo.orders --file orders.parquet --create\n\n# Scaffold a full dbt-fabric project wired to the warehouse\nfdw dbt init SalesWH ./my-dbt-project --project-name sales_dw --with-sources\n```\n\n### MCP Server\n\nAdd to your MCP client configuration (e.g. Claude Desktop, VS Code):\n\n```json\n{\n  \"mcpServers\": {\n    \"fabric-dw\": {\n      \"command\": \"uvx\",\n      \"args\": [\"--from\", \"fabric-dw\", \"fabric-dw-mcp\"]\n    }\n  }\n}\n```\n\nThe MCP server exposes all CLI operations as MCP tools (workspaces, warehouses, SQL endpoints, schemas, tables, views, queries, snapshots, restore points, audit, statistics, permissions, sql-pools). Bundled Claude Code agent skills (query-optimizer, warehouse-performance, dbt-setup) are included for deeper AI-assisted analysis. Set `FABRIC_AUTH` in the environment if you need a non-default auth mode.\n\nBoth the skills and the MCP server install in one command via the `fabric-dw` plugin marketplace, for Claude Code and GitHub Copilot CLI alike: `/plugin marketplace add sdebruyn/fabric-dw-mcp-cli` then `/plugin install fabric-dw@fabric-dw`. See the [Agent Skills](https://fdw.debruyn.dev/skills/) docs for details.\n\n## Run in Docker\n\nThe Docker image's default `ENTRYPOINT` is the **MCP server** (`fabric-dw-mcp`). Use it as-is with your MCP client, or override the entrypoint to run the CLI instead.\n\n```bash\ndocker pull ghcr.io/sdebruyn/fabric-dw:latest\n\n# Run the MCP server (default entrypoint, connect via stdio from your MCP client):\ndocker run --rm -i \\\n  -e AZURE_CLIENT_ID=… \\\n  -e AZURE_TENANT_ID=… \\\n  -e AZURE_CLIENT_SECRET=… \\\n  -e FABRIC_AUTH=sp \\\n  ghcr.io/sdebruyn/fabric-dw\n\n# Run the CLI instead (override the entrypoint):\ndocker run --rm \\\n  --entrypoint fabric-dw \\\n  -e AZURE_CLIENT_ID=… \\\n  -e AZURE_TENANT_ID=… \\\n  -e AZURE_CLIENT_SECRET=… \\\n  -e FABRIC_AUTH=sp \\\n  ghcr.io/sdebruyn/fabric-dw --help\n```\n\nDev images (built from every main merge): `ghcr.io/sdebruyn/fabric-dw:main` or `:<version>.dev<N>`.\n\nPackage page: [ghcr.io/sdebruyn/fabric-dw](https://github.com/sdebruyn/fabric-dw-mcp-cli/pkgs/container/fabric-dw)\n\n#### Security environment variables\n\n| Variable | Default | Description |\n|---|---|---|\n| `FABRIC_MCP_READONLY` | unset | Set to `1` to restrict `execute_sql` to SELECT/WITH and block all mutating tools. |\n| `FABRIC_MCP_ALLOW_DESTRUCTIVE` | unset | Set to `1` to enable permanently-destructive tools (`delete_*`, `clear_table`, `restore_warehouse_in_place`). Disabled by default. |\n| `FABRIC_MCP_WORKSPACES` | unset | Comma-separated workspace names or GUIDs the server may touch. Unset = all workspaces allowed. |\n| `FABRIC_MCP_ALLOW_REMOTE` | unset | Set to `1` to allow the HTTP transport (`--transport http`) to bind on a non-loopback address. A warning is logged; ensure an authenticating reverse proxy with TLS fronts the endpoint, and pass `--allowed-host` so Host validation stays on. See [Hosting the MCP server](https://fdw.debruyn.dev/reference/hosting-mcp-server/). |\n\n#### HTTP transport\n\nThe MCP server can be started in HTTP mode for remote clients:\n\n```bash\nfabric-dw-mcp --transport http [--host 127.0.0.1] [--port 8000]\n```\n\nIt binds to loopback by default, where Host and Origin validation is handled for you. Binding anywhere else requires `FABRIC_MCP_ALLOW_REMOTE=1` and `--allowed-host`, and the endpoint has **no built-in authentication or TLS**, so always front it with an authenticating reverse proxy. See [Hosting the MCP server](https://fdw.debruyn.dev/reference/hosting-mcp-server/) for that setup.\n\n## Develop in a container\n\nOpen the repo in [GitHub Codespaces](https://github.com/codespaces) or VS Code's Remote-Containers extension. The devcontainer pre-installs Python 3.14, uv, Azure CLI, and the GitHub CLI.\n\n[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/sdebruyn/fabric-dw-mcp-cli)\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for dev setup, branch flow, and how to run tests locally.\n\n📖 Docs: [fdw.debruyn.dev](https://fdw.debruyn.dev) (or run `uv run --only-group docs zensical serve` locally).\n\n## Security\n\nPlease report vulnerabilities privately. See [SECURITY.md](SECURITY.md).\n\n## Code of Conduct\n\nThis project follows the [Contributor Covenant 2.1](CODE_OF_CONDUCT.md).\n\n## License\n\n[MIT](LICENSE). Copyright (c) 2026 Sam Debruyn\n",
  "bytes": 9429,
  "sha": "2375c1438a52bc63b6e97e08c6a294f0a9dba917ce35b15d079fe89642cb0d28",
  "repo_slug": "sdebruyn/fabric-dw-mcp-cli",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_sdebruyn_fabric_dw_mcp_b9daf45b/readme"
}