-
Notifications
You must be signed in to change notification settings - Fork 347
Onboard Azure Advisor MCP Tool - List Advisor Recommendations #1519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Onboard Azure Advisor MCP Tool - List Advisor Recommendations #1519
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new Azure Advisor MCP tool to list Azure Advisor recommendations in a subscription. The implementation follows the established patterns in the codebase for Azure resource querying using Azure Resource Graph.
Changes:
- Added new Azure.Mcp.Tools.Advisor tool with service layer, commands, models, and unit tests
- Integrated the Advisor tool into Azure.Mcp.Server with proper service registration
- Updated documentation (README, command list, test prompts, consolidated tools) to include the new Advisor functionality
Reviewed changes
Copilot reviewed 28 out of 30 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.Advisor/src/Azure.Mcp.Tools.Advisor.csproj | Project file for the new Advisor tool with package references |
| tools/Azure.Mcp.Tools.Advisor/src/Services/AdvisorService.cs | Service implementation for querying Advisor recommendations via Azure Resource Graph |
| tools/Azure.Mcp.Tools.Advisor/src/Services/IAdvisorService.cs | Service interface definition |
| tools/Azure.Mcp.Tools.Advisor/src/Services/Models/*.cs | Data models for parsing Advisor recommendation responses |
| tools/Azure.Mcp.Tools.Advisor/src/Commands/BaseAdvisorCommand.cs | Base command class with subscription and resource group options |
| tools/Azure.Mcp.Tools.Advisor/src/Commands/Recommendation/RecommendationListCommand.cs | Command implementation for listing recommendations |
| tools/Azure.Mcp.Tools.Advisor/src/Commands/AdvisorJsonContext.cs | JSON serialization context for AOT compatibility |
| tools/Azure.Mcp.Tools.Advisor/src/Models/Recommendation.cs | Public recommendation model returned to users |
| tools/Azure.Mcp.Tools.Advisor/src/Options/*.cs | Options classes for command parameters |
| tools/Azure.Mcp.Tools.Advisor/src/AdvisorSetup.cs | Service registration and command group setup |
| tools/Azure.Mcp.Tools.Advisor/src/AssemblyInfo.cs | InternalsVisibleTo configuration for test projects |
| tools/Azure.Mcp.Tools.Advisor/src/GlobalUsings.cs | Global using directives |
| tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.UnitTests/*.cs | Unit test implementation with comprehensive coverage |
| tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.UnitTests/Azure.Mcp.Tools.Advisor.UnitTests.csproj | Unit test project file |
| tools/Azure.Mcp.Tools.Advisor/tests/Azure.Mcp.Tools.Advisor.LiveTests/Azure.Mcp.Tools.Advisor.LiveTests.csproj | Live test project file (no test implementation) |
| tools/Azure.Mcp.Tools.Advisor/tests/test-resources.bicep | Empty test resources file (appropriate for Advisor which doesn't need specific resources) |
| tools/Azure.Mcp.Tools.Advisor/tests/test-resources-post.ps1 | Empty post-deployment script |
| servers/Azure.Mcp.Server/src/Program.cs | Registration of AdvisorSetup in the main server |
| servers/Azure.Mcp.Server/README.md | Updated documentation to include Advisor in service list and examples |
| servers/Azure.Mcp.Server/docs/azmcp-commands.md | Added Advisor commands documentation |
| servers/Azure.Mcp.Server/docs/e2eTestPrompts.md | Added test prompts for Advisor tool |
| servers/Azure.Mcp.Server/changelog-entries/1768817429669.yaml | Changelog entry for the new feature |
| core/Azure.Mcp.Core/src/Areas/Server/Resources/consolidated-tools.json | Added Advisor tool definition and fixed formatting |
| eng/tools/ToolDescriptionEvaluator/prompts/prompts.json | Added test prompts for tool description evaluation |
| AzureMcp.sln | Added Advisor projects to the solution |
| .github/CODEOWNERS | Added code ownership for Advisor tool |
...ols.Advisor/tests/Azure.Mcp.Tools.Advisor.LiveTests/Azure.Mcp.Tools.Advisor.LiveTests.csproj
Outdated
Show resolved
Hide resolved
| using System.CommandLine; | ||
| using System.Net; | ||
| using System.Text.Json; | ||
| using Azure.Mcp.Core.Options; | ||
| using Azure.Mcp.Tools.Advisor.Commands; | ||
| using Azure.Mcp.Tools.Advisor.Commands.Recommendation; | ||
| using Azure.Mcp.Tools.Advisor.Services; | ||
| using Microsoft.Extensions.DependencyInjection; | ||
| using Microsoft.Extensions.Logging; | ||
| using Microsoft.Mcp.Core.Models.Command; | ||
| using NSubstitute; | ||
| using Xunit; | ||
|
|
||
| namespace Azure.Mcp.Tools.Advisor.UnitTests.Recommendation; | ||
|
|
||
| public class RecommendationGetCommandTests |
Copilot
AI
Jan 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file name "RecommendationGetCommandTests.cs" doesn't match the test class name "RecommendationGetCommandTests" which tests "RecommendationListCommand". According to coding guidelines, the file should be renamed to "RecommendationListCommandTests.cs" to match both the class name and the command being tested.
tools/Azure.Mcp.Tools.Advisor/src/Azure.Mcp.Tools.Advisor.csproj
Outdated
Show resolved
Hide resolved
|
|
||
| namespace Azure.Mcp.Tools.Advisor.UnitTests.Recommendation; | ||
|
|
||
| public class RecommendationGetCommandTests |
Copilot
AI
Jan 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test class name "RecommendationGetCommandTests" is inconsistent with the command class name "RecommendationListCommand". The test class should be named "RecommendationListCommandTests" to maintain naming consistency and make it easier to identify which command is being tested.
tools/Azure.Mcp.Tools.Advisor/src/Services/Models/RecommendationData.cs
Outdated
Show resolved
Hide resolved
tools/Azure.Mcp.Tools.Advisor/src/Services/Models/RecommendationData.cs
Outdated
Show resolved
Hide resolved
Doc comments and NULL check related fixes to automated PR comments. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ankiga-MSFT/msft-advisor-mcp into ankiga-MSFT/msft-advisor-mcp-v1
@microsoft-github-policy-service agree company="Microsoft" |
|
@ankiga-MSFT The PR looks good to me. I had a few questions:
|
core/Azure.Mcp.Core/src/Areas/Server/Resources/consolidated-tools.json
Outdated
Show resolved
Hide resolved
|
What does this PR do?
Onboard Azure Advisor MCP Tool - List Advisor Recommendations
GitHub issue number?
1517
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