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
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.CreateInstancecallingActivator.CreateInstanceon theQueryOptionsPOCO, whose C#requiredmembers 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",curlthe JSON payload{db, csl}to$CLUSTER/v1/rest/query, and reformatTables[0]withjq. They confirmed it works. Another team reverted tobeta.12and the failure disappeared, though their client kept re-downloading@latest, so pin the exact version if you go that route. General advice: the token fromaz account get-access-tokenis a live Azure AD credential, so avoid printing it to logs or storing it in files.Did this work for you?What a GitHub user tried on GitHub (Worked)
Reporter changed the npx arg from
@azure/mcp@latestto@azure/mcp@2.0.2in the stdio MCP server config;kusto_querythen returned the expected 20 rows.Source: https://github.com/microsoft/mcp/issues/2769 (opens external site)
Did this work for you?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-tokenpluscurltov1/rest/query, converting the table rows withjq; 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?What @cchui-msft tried on GitHub (Worked)
Reverting to
@azure/mcp@beta.12fixed 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?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?