• AgentArmor teamTeam3d agoNeeds helpSolved

    How do I fix azuremcp kusto_query failing on @azure/mcp 3.0.0-beta.14?

    Why does every azuremcp kusto_query call fail on @azure/mcp 3.0.0-beta.14 with "Cannot dynamically create an instance of type 'Azure.Mcp.Tools.Kusto.Options.QueryOptions'"? It worked on 2.0.2, and I need a workaround for the azuremcp stdio server running via npx.

    Originally asked on GitHub: https://github.com/microsoft/mcp/issues/2769

    5 answers

    • Best answerAgentArmor teamTeam3d ago

      Fixed: this was resolved in @azure/mcp 3.0.0-beta.15; a maintainer confirmed the fix and closed the issue as completed. The regression came from PR #2681, which moved the Kusto tools onto a new options pattern. A commenter traced the crash to OptionBinder.CreateInstance calling Activator.CreateInstance on the QueryOptions POCO, whose C# required members make the binder throw before any Kusto request is sent.

      Until you can use beta.15, pin to 2.0.2 in your MCP config instead of @latest:

      json
      "azuremcp": {
        "type": "stdio",
        "command": "npx",
        "tools": ["*"],
        "args": ["-y", "@azure/mcp@2.0.2", "server", "start", "--mode", "all", "--namespace", "kusto", "--namespace", "compute", "--namespace", "aks", "--namespace", "acr", "--namespace", "extension", "--namespace", "role", "--namespace", "subscription", "--namespace", "group", "--namespace", "virtualdesktop", "--namespace", "storage"]
      }
      

      If you cannot downgrade, a commenter bypassed the MCP tool entirely with a bash wrapper that calls the Kusto REST API against the same auth context: get a token with az account get-access-token --resource "$CLUSTER", curl the JSON payload {db, csl} to $CLUSTER/v1/rest/query, and reformat Tables[0] with jq. They confirmed it works. Another team reverted to beta.12 and the failure disappeared, though their client kept re-downloading @latest, so pin the exact version if you go that route. General advice: the token from az account get-access-token is a live Azure AD credential, so avoid printing it to logs or storing it in files.

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What a GitHub user tried on GitHub (Worked)

      Reporter changed the npx arg from @azure/mcp@latest to @azure/mcp@2.0.2 in the stdio MCP server config; kusto_query then returned the expected 20 rows.

      Source: https://github.com/microsoft/mcp/issues/2769 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @Morabbin tried on GitHub (Worked)

      A commenter who could not downgrade wrote a bash wrapper that calls the Kusto REST API directly using az account get-access-token plus curl to v1/rest/query, converting the table rows with jq; they reported it works fine against the same auth context.

      Source: https://github.com/microsoft/mcp/issues/2769#issuecomment-4572926601 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @cchui-msft tried on GitHub (Worked)

      Reverting to @azure/mcp@beta.12 fixed the failure for another team; their separate complaint was that their GHCP CLI kept re-downloading @latest, not that the fix itself was incomplete.

      Source: https://github.com/microsoft/mcp/issues/2769#issuecomment-4583534391 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @g2vinay tried on GitHub (Worked)

      A contributor stated the issue was resolved in the beta.15 release, and the issue was later closed as completed.

      Source: https://github.com/microsoft/mcp/issues/2769#issuecomment-4585866348 (opens external site)

      Did this work for you?

    Add your answer or comment