Forum Discussion

ahmedshalabyy12's avatar
9 months ago
Solved

MCP not working

Hello,
I installed the extension of Power BI MCP in vs code . when I try to connect to my open report always receive strange answers.

so is there anything wrong ?

 



Thank you 

  • Ahmed-Elfeel's avatar
    Ahmed-Elfeel
    9 months ago

    Hi ahmedshalabyy12,

    Based on your description that the Power BI MCP server extension isn't functioning correctly in VS Code.

    So you need to:

    • Uninstall the Power BI MCP extension from VS Code
    • Close VS Code completely
    • Reinstall the extension from Marketplace
    • Restart VS Code

    Or add this JSON in your VS Code setting

    {
      "mcp.servers": {
        "powerbi": {
          "command": "node",
          "args": [
            "C:/Users/[YourUsername]/.vscode/extensions/powerbi-extension-path/mcp-server.js"
          ]
        }
      }
    }

     

    And if you want it for SSMS you should:

    • Open SQL Server Management Studio
    • Connect to Server type Analysis Services
    • Server - localhost:51345
    • This will show your Power BI data model directly

    Or you can just use PowerShell (Temporary)

    # Connect directly via PowerShell
    $server = "localhost:51345"
    $query = "EVALUATE 'YourTableName'"
    Invoke-ASCmd -Server $server -Query $query

     

     
     

     

     

3 Replies

  • Hi ahmedshalabyy12,

    Based on the Microsoft Learn resources the MCP technology for Power BI is still evolving and can be unstable You can try:

    1. Close both VS Code and Power BI Desktop completely

    2. Open Power BI Desktop first - wait until fully loaded

    3. Open your .pbix file - ensure it's completely loaded

    4. Open VS Code

    5. Run Command Palette: MCP: Reset Cached Tools

    6. Retry your Power BI connection

    Also make sure to note the Power BI Port From:

    • Power BI Desktop go to HelpAbout Power BI Desktop

    • Note the Local Analysis Services port number

    • Also test it if it works or not
    Test-NetConnection localhost -Port 51345

     

    You can check this resource also:

    if this post helps, then I would appreciate a thumbs up and mark it as the solution to help the other members find it more quickly.
    • ahmedshalabyy12's avatar
      ahmedshalabyy12
      Helper V

      Thank you Ahmed-Elfeel  
      I did what you said, but the problem it keeps ignoring my commands and asks me to open the report via SSMS, tabular editor, or PowerShell 

      • Ahmed-Elfeel's avatar
        Ahmed-Elfeel
        Super User

        Hi ahmedshalabyy12,

        Based on your description that the Power BI MCP server extension isn't functioning correctly in VS Code.

        So you need to:

        • Uninstall the Power BI MCP extension from VS Code
        • Close VS Code completely
        • Reinstall the extension from Marketplace
        • Restart VS Code

        Or add this JSON in your VS Code setting

        {
          "mcp.servers": {
            "powerbi": {
              "command": "node",
              "args": [
                "C:/Users/[YourUsername]/.vscode/extensions/powerbi-extension-path/mcp-server.js"
              ]
            }
          }
        }

         

        And if you want it for SSMS you should:

        • Open SQL Server Management Studio
        • Connect to Server type Analysis Services
        • Server - localhost:51345
        • This will show your Power BI data model directly

        Or you can just use PowerShell (Temporary)

        # Connect directly via PowerShell
        $server = "localhost:51345"
        $query = "EVALUATE 'YourTableName'"
        Invoke-ASCmd -Server $server -Query $query