microsoft / microsoft/mcp

[BUG] kusto_query does not expose query execution stats for users

Open
#1,786 1 comment 0 reactions 1 assignee Claimed by @danield137 View on GitHub
customer-reported enhancement needs-team-attention server-Azure.Mcp tools-Kusto
Dominant language
C#
Stars
3.7k
Forks
624
Avg merge
2d 20h
Merged PRs (30d)
220

Description

### Describe the bug

When using `kusto_query` from MCP clients, we can get query rows but cannot get execution statistics (CPU, memory, cache, scanned extents, cross-cluster bytes). This makes it hard to troubleshoot expensive queries or explain query cost from agent workflows.

The current query handling is also tied to legacy `/v1/rest/query` assumptions, while modern Kusto query responses are frame-based (`/v2/rest/query`), which makes PrimaryResult/completion error handling brittle.

### Expected behavior

- Query execution should use the v2 frame response format for reliability.
- `kusto_query` should support an optional way to return execution statistics so users can inspect performance/cost data alongside results.
- Completion errors should be surfaced from v2 completion frames.

### Actual behavior

- `kusto_query` returns result rows only.
- There is no user-facing way to request execution stats in the response.
- Completion/error data from v2 frame semantics is not fully exposed to users.

### Reproduction Steps

1. Start Azure MCP server in Kusto namespace.
2. Call `kusto_query` against `https://help.kusto.windows.net`, database `Samples`, query `StormEvents | take 1`.
3. Inspect response payload.
4. Observe that rows are returned, but no execution statistics are available.

### Environment

- Azure MCP Server: `2.0.0-beta.22`
- Client surfaces tested: VS Code / Copilot CLI MCP protocol flow
- OS: Windows

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.