Azure Retail Pricing MCP Tool#1621
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new MCP tool for querying Azure Retail Pricing information. The tool provides programmatic access to retail prices for all Azure services through the public Azure Retail Prices API at https://prices.azure.com.
Changes:
- Added
pricing_getMCP tool with support for filtering by SKU, service, region, service family, price type, currency, and advanced OData filters - Vendored a TypeSpec-generated client library for the Azure Retail Prices API in the
Client/folder - Implemented comprehensive unit tests and recorded live tests using the test proxy infrastructure
- Updated server documentation, command metadata, and consolidated tools configuration
Reviewed changes
Copilot reviewed 60 out of 60 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.Pricing/src/Services/PricingService.cs | Core service implementing pricing queries with OData filter building and result mapping |
| tools/Azure.Mcp.Tools.Pricing/src/Commands/PricingGetCommand.cs | Command implementation with validation requiring at least one filter and SKU when querying by service |
| tools/Azure.Mcp.Tools.Pricing/src/Client/* | Vendored auto-generated client from TypeSpec for Azure Retail Prices API |
| tools/Azure.Mcp.Tools.Pricing/tests//.cs | Comprehensive unit tests and recorded live tests |
| tools/Azure.Mcp.Tools.Pricing/tests/test-resources.bicep | Empty resource file as API is public and unauthenticated |
| servers/Azure.Mcp.Server/src/Program.cs | Registration of PricingSetup in the server |
| servers/Azure.Mcp.Server/docs/*.md | Documentation updates with test prompts and command examples |
| core/Azure.Mcp.Core/src/Areas/Server/Resources/consolidated-tools.json | Added get_azure_retail_pricing tool metadata |
| Directory.Packages.props | Added System.ClientModel package dependency |
joshfree
left a comment
There was a problem hiding this comment.
This is great but it's missing the CHANGELOG and CODEOWNERS updates
anuchandy
left a comment
There was a problem hiding this comment.
Looks great! I skipped the contents of the client directory since it's TypeSpec-generated. I think we should push the TypeSpec you authored for the pricing service somewhere like the mcp-pr repo, along with generation instructions - this isn't available in the REST API spec repo.
* Get Azure Retail Pricing MCP Tool * fixed recorded tests and tool description * fuxed unit testcases * fix: update live test to require SKU when service is provided * copilot review comments * added codeowners and changelog entry
What does this PR do?
Get Azure Retail Price MCP tool
Documentation: https://learn.microsoft.com/en-us/rest/api/cost-management/retail-prices/azure-retail-prices
API endpoint: https://prices.azure.com/api/retail/prices
Given the documentation and the endpoint, we wrote a typespec for the API and then generated the client. Since we hand-crafted the spec and generated the library ourselves, the best option discussed was to vendor this small client directly into the MCP tools project. The generated client is present in the
\tools\Azure.Mcp.Tools.Pricing\src\Clientfolder.get_azure_retail_pricing MCP tool result
The following prompts are supported with this tool-
Copilot should then clarify how the service works and then ask the user for which SKU under that Azure service they want the price for
GitHub issue number?
[Link to the GitHub issue this PR addresses]Pre-merge Checklist
servers/Azure.Mcp.Server/CHANGELOG.mdand/orservers/Fabric.Mcp.Server/CHANGELOG.mdfor product changes (features, bug fixes, UI/UX, updated dependencies)servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationeng/scripts/Process-PackageReadMe.ps1. See Package README/servers/Azure.Mcp.Server/docs/azmcp-commands.mdand/or/docs/fabric-commands.md.\eng\scripts\Update-AzCommandsMetadata.ps1to update tool metadata in azmcp-commands.md (required for CI)ToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptsconsolidated-tools.json/servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline