Skip to content

Add command: azmcp costmanagement query run #2602

@francesco1501

Description

@francesco1501

Summary

Add a new costmanagement toolset starting with azmcp costmanagement query run that retrieves actual Azure costs from the Cost Management Query/Usage API for a subscription or resource group.

Motivation

Azure MCP Server has no tool to retrieve actual Azure costs today. The only cost-adjacent tool is azmcp pricing get, which queries the public retail catalog (estimates, not actual spend). This gap was previously surfaced in:

AWS Billing MCP and GCP have analogous tools; Azure does not.

Scope of this issue (PR1)

azmcp costmanagement query run — read-only, scoped to subscription (optionally narrowed to a resource group). Backed by the GA SDK Azure.ResourceManager.CostManagement 1.0.3.

azmcp costmanagement query run --subscription <sub> \
                               [--resource-group <rg>] \
                               [--timeframe <MonthToDate|BillingMonthToDate|TheCurrentMonth|TheLastBillingMonth|WeekToDate|Custom>] \
                               [--from <YYYY-MM-DD>] [--to <YYYY-MM-DD>] \
                               [--granularity <None|Daily|Monthly>] \
                               [--group-by <ServiceName|ResourceGroupName|ResourceLocation|ResourceId|MeterCategory|MeterSubCategory|ChargeType|BillingPeriod>]

Caller must have Cost Management Reader or Reader role on the scope.

PR is ready and will be opened from francesco1501/mcp:feature/add-costmanagement-query shortly.

cc @anannya03 (CODEOWNER of tools/Azure.Mcp.Tools.Pricing/ and original assignee of #1420) — would appreciate a sanity check on the design before review.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status

Not Started

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions