Power BI Modeling MCP -> Claude Desktop  (Windows setup)
========================================================

WHAT IT DOES (per teammate, on their own Windows PC):
  1. Installs Node.js LTS if missing (via winget).
  2. Installs Microsoft's Power BI Modeling MCP server.
  3. Finds the real .exe and writes it into Claude Desktop's config
     (safely merges - your existing Claude settings are kept; a .bak backup is made).
  4. Prints next steps.

HOW TO RUN:
  *** STEP 1 - EXTRACT THE ZIP FIRST. ***
      Right-click the .zip -> "Extract All" -> Extract.
      Do NOT run the .bat from inside the zip preview - it will fail to
      find its .ps1 helper. You must extract both files together first.
  - Open the EXTRACTED folder (it has BOTH files):
        Setup-PowerBI-MCP.bat
        Setup-PowerBI-MCP.ps1
  - Double-click  Setup-PowerBI-MCP.bat
  - Click "Yes" on the admin (UAC) prompt.
  - Wait for "SETUP COMPLETE".
  - Fully quit Claude Desktop (tray -> Exit) and reopen it.

REQUIREMENTS:
  - Windows 10/11.
  - Just run it as YOURSELF (double-click) - do NOT "Run as administrator".
    The MCP and Claude config go into your own profile.
  - If Node.js isn't installed yet, the installer will pop a one-time admin
    prompt JUST for Node (that's fine - Node is shared system-wide). If you
    can't approve admin, ask IT to install Node.js LTS once, then re-run this.
  - The "Config written:" line at the end must show YOUR username
    (C:\Users\<you>\AppData\Roaming\Claude\...). If it shows a different
    account, you ran it as admin - re-run by just double-clicking (no admin).

AFTER SETUP - connect to a model (type in Claude):
    Connect to semantic model '<ModelName>' in Fabric Workspace '<WorkspaceName>'
  or, with the file open in Power BI Desktop:
    Connect to '<FileName>' in Power BI Desktop
  Sign in with your own Morek account when prompted.

IF A MODEL CONNECT FAILS (permissions / "Discover" error):
  That is the cloud side, not this script. The workspace's capacity needs the
  XMLA endpoint set to Read/Write + tenant XMLA settings enabled (one-time admin task).

SAFE TO RE-RUN anytime (updates the install + path).

TO UPDATE THE SERVER LATER:
  Just re-run the .bat - it re-installs and re-points to the new binary path.
