Add Azure Service Fabric managed clusters toolset#1696
Add Azure Service Fabric managed clusters toolset#1696anannya03 merged 13 commits intomicrosoft:mainfrom
Conversation
Add new Azure.Mcp.Tools.ServiceFabric toolset with two commands: - servicefabric managedcluster node list: List all nodes in a managed cluster via direct REST API - servicefabric managedcluster nodetype restart: Restart nodes of a specific node type (POST with JSON body) Implementation uses direct ARM REST API calls via IHttpClientFactory + bearer token authentication, since the nodes endpoint is not exposed in the Azure SDK, but Azure Portal uses it to display the list of nodes on the managed cluster view. Includes: - Models matching the actual REST API response schema (nested id + properties) - AOT-safe JSON serialization with ServiceFabricJsonContext - UpdateType option constrained to Default/ByUpgradeDomain via AcceptOnlyFromAmong - 26 unit tests covering both commands - Live test infrastructure (Bicep template, post-deployment script, assets.json) - E2E test prompts in e2eTestPrompts.md
- Add Azure Service Fabric Operations section to azmcp-commands.md - Add Service Fabric to README.md supported services list - Add consolidated tool entries for node list and nodetype restart
|
Thank you for your contribution @linmeng08! We will review the pull request and get back to you soon. |
There was a problem hiding this comment.
Pull request overview
Adds a new Azure.Mcp.Tools.ServiceFabric toolset to Azure MCP Server to manage Service Fabric managed clusters, specifically for listing nodes and restarting nodes in a node type via ARM REST APIs.
Changes:
- Introduces
servicefabric managedcluster node listandservicefabric managedcluster nodetype restartcommands and registers the new area inAzure.Mcp.Server. - Adds Service Fabric REST client/service implementation plus option/model plumbing and System.Text.Json source-gen context.
- Adds unit tests, live/recorded tests scaffolding, and updates server docs/tool catalog entries.
Reviewed changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.ServiceFabric/src/Services/ServiceFabricService.cs | Implements ARM REST calls for node listing + node restart. |
| tools/Azure.Mcp.Tools.ServiceFabric/src/Services/IServiceFabricService.cs | Service contract for Service Fabric operations. |
| tools/Azure.Mcp.Tools.ServiceFabric/src/Commands/ManagedCluster/ManagedClusterNodeListCommand.cs | CLI/tool command for listing managed cluster nodes. |
| tools/Azure.Mcp.Tools.ServiceFabric/src/Commands/ManagedCluster/ManagedClusterNodeTypeRestartCommand.cs | CLI/tool command for restarting managed cluster nodes. |
| tools/Azure.Mcp.Tools.ServiceFabric/src/Commands/ServiceFabricJsonContext.cs | Source-gen JSON context for tool inputs/outputs. |
| tools/Azure.Mcp.Tools.ServiceFabric/src/Commands/BaseServiceFabricCommand.cs | Base command type for Service Fabric commands (subscription-scoped). |
| tools/Azure.Mcp.Tools.ServiceFabric/src/Options/ServiceFabricOptionDefinitions.cs | Command-line option definitions for cluster/node operations. |
| tools/Azure.Mcp.Tools.ServiceFabric/src/Options/BaseServiceFabricOptions.cs | Base options type for Service Fabric commands. |
| tools/Azure.Mcp.Tools.ServiceFabric/src/Options/ManagedCluster/ManagedClusterNodeTypeRestartOptions.cs | Options binding for node restart. |
| tools/Azure.Mcp.Tools.ServiceFabric/src/Options/ManagedCluster/ManagedClusterNodeTypeListOptions.cs | Options binding for node list. |
| tools/Azure.Mcp.Tools.ServiceFabric/src/Models/ManagedClusterNode.cs | Models for node list response payloads. |
| tools/Azure.Mcp.Tools.ServiceFabric/src/Models/RestartNodeRequest.cs | Model for restart request payload. |
| tools/Azure.Mcp.Tools.ServiceFabric/src/Models/RestartNodeResponse.cs | Model for restart response headers/body data. |
| tools/Azure.Mcp.Tools.ServiceFabric/src/ServiceFabricSetup.cs | Registers the new servicefabric area and command groups. |
| tools/Azure.Mcp.Tools.ServiceFabric/src/GlobalUsings.cs | Adds global System.CommandLine usage. |
| tools/Azure.Mcp.Tools.ServiceFabric/src/Azure.Mcp.Tools.ServiceFabric.csproj | New tool project definition. |
| tools/Azure.Mcp.Tools.ServiceFabric/src/AssemblyInfo.cs | InternalsVisibleTo for test projects. |
| tools/Azure.Mcp.Tools.ServiceFabric/tests/test-resources.bicep | Test infra for deploying a managed cluster in CI/live tests. |
| tools/Azure.Mcp.Tools.ServiceFabric/tests/test-resources-post.ps1 | Post-deploy test resource hook placeholder. |
| tools/Azure.Mcp.Tools.ServiceFabric/tests/Azure.Mcp.Tools.ServiceFabric.UnitTests/* | Unit tests for node list + restart commands. |
| tools/Azure.Mcp.Tools.ServiceFabric/tests/Azure.Mcp.Tools.ServiceFabric.LiveTests/* | Recorded/live test scaffolding + node list test. |
| servers/Azure.Mcp.Server/src/Program.cs | Registers the new Service Fabric area. |
| servers/Azure.Mcp.Server/docs/e2eTestPrompts.md | Adds e2e prompts for the new tools. |
| servers/Azure.Mcp.Server/docs/azmcp-commands.md | Adds CLI docs for new commands. |
| servers/Azure.Mcp.Server/README.md | Lists Azure Service Fabric as a supported service area. |
| core/Azure.Mcp.Core/src/Areas/Server/Resources/consolidated-tools.json | Adds consolidated tool mappings/metadata for the new tools. |
| servers/Azure.Mcp.Server/Azure.Mcp.Server.slnx | Adds new tool projects to the server solution filter. |
| Microsoft.Mcp.slnx | Adds new tool projects to the repo solution filter. |
tools/Azure.Mcp.Tools.ServiceFabric/src/Options/BaseServiceFabricOptions.cs
Show resolved
Hide resolved
tools/Azure.Mcp.Tools.ServiceFabric/src/Commands/ServiceFabricJsonContext.cs
Show resolved
Hide resolved
tools/Azure.Mcp.Tools.ServiceFabric/src/Options/ManagedCluster/ManagedClusterNodeListOptions.cs
Outdated
Show resolved
Hide resolved
tools/Azure.Mcp.Tools.ServiceFabric/src/Services/ServiceFabricService.cs
Outdated
Show resolved
Hide resolved
tools/Azure.Mcp.Tools.ServiceFabric/src/Services/ServiceFabricService.cs
Outdated
Show resolved
Hide resolved
|
@anannya03 can you help @linmeng08 get setup (CODEOWNERS, label, permissions) |
|
@chlowell could you also give this a quick review as a Service Fabric fan |
joshfree
left a comment
There was a problem hiding this comment.
Please add an entry to .github/CODEOWNERS and a CHANGELOG entry
Thanks! Added. |
|
The PR looks great! Thanks @linmeng08 |
What does this PR do?
Add Azure Service Fabric managed clusters toolset
Service Fabric managed cluster
Add new Azure.Mcp.Tools.ServiceFabric toolset with two commands:
GitHub issue number?
1695
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