Repository navigation
Fixed order of the columns in resource - #4
Merged
Merged
Conversation
Patrick Hallisey (hallipr)
added a commit
that referenced
this pull request
Aug 20, 2025
- Publish platform packages first to prevent wrapper package deployment with unresolved dependencies - Copy the repo licence and readme files into packages - Move executables in packages to /dist/ - Move ESRP task into Release template - Bump version to 0.0.9
Vinay Gera (g2vinay)
added a commit
to g2vinay/mcp
that referenced
this pull request
Mar 12, 2026
…atus Two prompts were semantically ambiguous, causing the evaluator to rank the wrong tool first: - 'Show me the health status of the storage account <name>' pulled toward storage_blob_container_get (score 0.559 vs RH rank microsoft#4). Fixed: 'What is the Azure Resource Health availability status of the storage account <name>?' - 'List availability status for all resources in my subscription' pulled toward group_list/redis_list (score 0.582 vs RH rank microsoft#3-4). Fixed: 'Get Azure Resource Health availability status for all resources in my subscription' Result: resourcehealth area score 81.8% (9/11) -> 100% (11/11).
Shraddha Jain (shrja-ms)
added a commit
to shrja-ms/mcp
that referenced
this pull request
Apr 16, 2026
- #2: Separate auth errors (401/403) from not-found (404) in ResolveVaultTypeAsync and AutoDetectAndExecuteAsync. Auth failures on DPP now throw UnauthorizedAccessException with RBAC guidance instead of being swallowed as KeyNotFoundException. - microsoft#4: NormalizeImmutabilityState now throws ArgumentException on unrecognized values instead of silently passing them through. - microsoft#5: Add RsvDatasourceRegistryTests with comprehensive coverage for Resolve, ResolveOrDefault, ResolveFromProtectedItemName, and profile properties. Add BindOptions_BindsOptionsCorrectly tests to all 15 command test files. Add service tests for auth error separation and invalid immutability state.
Shraddha Jain (shrja-ms)
added a commit
that referenced
this pull request
Apr 17, 2026
* Add Azure Backup MCP toolset - Drop 1 (15 commands) Implements the first subset of Azure Backup MCP tools with 15 commands: - Vault: get (consolidated get+list), create, update - Policy: get (consolidated get+list), create - Protected Item: get (consolidated get+list), protect - Protectable Item: list - Backup: status - Job: get (consolidated get+list) - Recovery Point: get (consolidated get+list) - Governance: find-unprotected, immutability, soft-delete - DR: enablecrr Key design decisions: - Consolidated get+list into single 'get' commands with optional identifier - Full service layer included for extensibility in future drops - Dual vault architecture (RSV + Backup vault) with auto-detection - 99 unit tests covering all 15 commands Infrastructure changes: - Added Azure.ResourceManager.RecoveryServices 1.1.1 - Added Azure.ResourceManager.RecoveryServicesBackup 1.3.0 - Added Azure.ResourceManager.DataProtectionBackup 1.7.0 - Registered AzureBackupSetup in Program.cs and both slnx files * Fix CONTRIBUTING.md compliance gaps, add LiveTests project and test infrastructure - Remove 227 code comments from 18 source files - Add Azure Backup section to azmcp-commands.md - Add 30 e2e test prompts to e2eTestPrompts.md - Update README.md with Azure Backup service listing - Add CODEOWNERS entry for Azure Backup toolset - Add 7 consolidated tool groups to consolidated-tools.json - Add changelog entry YAML - Create test-resources.bicep and test-resources-post.ps1 - Create LiveTests project with 6 integration tests (vault, policy, governance, job) - Add assets.json for test proxy recording support - Update Microsoft.Mcp.slnx and Azure.Mcp.Server.slnx with LiveTests project - All 99 unit tests pass, all 6 live tests pass (6/6) * Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <[email protected]> * Address PR review comments: split model files, fix Bicep template - Remove unused tenantId parameter from test-resources.bicep - Interpolate testApplicationOid in role assignment description - Split WorkflowResult.cs: move WorkflowStep to its own file - Split HealthCheckResult.cs: move HealthCheckItemDetail to its own file * Upgrade Azure Backup packages to AOT-compatible versions - Azure.ResourceManager.RecoveryServicesBackup: 1.3.0 -> 1.3.1 - Azure.ResourceManager.RecoveryServices: 1.1.1 -> 1.2.0 - Azure.ResourceManager.DataProtectionBackup: 1.7.0 -> 1.7.1 - Azure.Core: 1.50.0 -> 1.51.1 (transitive dependency) - Azure.ResourceManager: 1.13.2 -> 1.14.0 (transitive dependency) - System.ClientModel: 1.8.0 -> 1.9.0 (transitive dependency) Resolves CI trim/AOT failures (NETSDK1144/IL2026) caused by non-AOT-compatible Azure.ResourceManager.RecoveryServicesBackup 1.3.0. * Fix consolidated-tools.json: split backup entries by metadata to match command annotations The consolidated mode validation requires all commands in a group to have identical ToolMetadata. The backup entries were incorrectly grouping read-only and write commands together, causing ConsolidatedModeTests to fail in Debug mode. Restructured 6 backup entries into 3 entries grouped by matching metadata: - get_azure_backup_details: 8 read-only commands (ReadOnly=true) - create_azure_backup_resources: 3 create commands (Destructive=true, Idempotent=false) - update_azure_backup_settings: 4 update commands (Destructive=true, Idempotent=true) * Fix LiveTests namespace: use Microsoft.Mcp.Tests instead of Azure.Mcp.Tests * Remove assets.json until test recordings are available The CI runs recorded tests for LiveTests projects that have assets.json. With an empty Tag (no recordings), the test proxy returns 404, causing all 6 LiveTests to fail across 4 platforms (24 failures). Remove assets.json so Test-Code.ps1 skips recorded tests for AzureBackup. Will re-add after recording test sessions per docs/recorded-tests.md. * Apply dotnet format to fix CI Analyze check dotnet format --verify-no-changes was failing due to single-line if statements that should use multi-line formatting per editorconfig. Auto-fixed 19 files in AzureBackup toolset. * Address Copilot PR review comments - Fix argument order bug in GovernanceSoftDeleteCommand (vaultType and softDeleteRetentionDays were swapped in ConfigureSoftDeleteAsync call) - Make ImmutabilityState, SoftDelete, and WorkloadType options required (fixes null-forgiving operator on optional fields) - Fix test-resources.bicep baseName default to use take() for maxLength safety - Update e2eTestPrompts.md governance prompts from 'Check' to 'Configure' - Update unit tests to reflect required option changes * Implement FindUnprotectedResourcesAsync with real Azure resource scanning Replace the stub that returned an empty list with a real implementation that: 1. Lists all Recovery Services and Backup vaults across the subscription 2. Collects datasource ARM IDs from all protected items in every vault 3. Lists generic resources of protectable types (VMs, SQL, Storage, etc.) 4. Returns resources whose IDs are not in the protected set Also supports optional filtering by resource type, resource group, and tags. AzureBackupService now extends BaseAzureService (with ITenantService) to obtain ARM client access for listing generic subscription resources. * Align datasource types to supported list and fix broken DPP registry tests - Remove MySQLFlexible from DPP registry (not a supported datasource type) - Fix s_protectableResourceTypes: remove Microsoft.Sql (SQL-in-VM is a VM workload), remove MySQL, add ElasticSAN and CosmosDB - Update WorkloadType and DatasourceType option descriptions - Rewrite DppBackupOperationsHelperTests to DppDatasourceRegistryTests (fix pre-existing build errors from refactored static methods to registry pattern) * Address Copilot review: validation, naming, docs fixes - Rename DppBackupOperationsHelperTests.cs to DppDatasourceRegistryTests.cs to match class name - VaultGetCommand: validate --resource-group is provided when --vault is specified (return 400) - VaultCreateCommand: validate --vault-type is provided (return 400 with helpful message) - Fix --redundancy description to use full names (GeoRedundant, LocallyRedundant, etc.) - Fix e2eTestPrompts: replace invalid AzureStorage with AzureFileShare workload type - Fix azmcp-commands.md: show --workload-type as required (not optional) for policy create * Address latest Copilot review: docs alignment, VaultTypeResolver validation, e2e prompts - Fix vault create docs: --vault-type shown as required (not optional) - Fix governance docs: --immutability-state and --soft-delete shown as required - Update README prompts: use 'configure' for destructive ops, include vault-type and location - VaultTypeResolver.IsVaultTypeSpecified: throw ArgumentException on invalid non-empty vault type - Fix backup_status e2e prompts: include required --location parameter * PR standards compliance: fix broken markdown, add assets.json, remove dead code - Fix azmcp-commands.md: add missing closing code fence after DR section (broke all subsequent markdown) - Add assets.json for LiveTests (required for recorded test infrastructure) - Fix e2eTestPrompts: governance find-unprotected use <resource_type> matching actual option name - Remove 5 unused *ListOptions classes (VaultList, JobList, PolicyList, ProtectedItemList, RecoveryPointList) * Remove empty assets.json to fix CI recorded test failures The assets.json with empty Tag causes CI to run recorded tests in Playback mode with no recordings, resulting in 404 errors. Removing until recordings are pushed. * Fix live test failures: add required governance params and recording sanitizers - Add missing 'soft-delete' parameter to GovernanceSoftDelete test - Add missing 'immutability-state' parameter to GovernanceImmutability test - Add TestMatcher and BodyRegexSanitizers for recorded test infrastructure - Remove assets.json (empty Tag causes CI Playback failures) * Address active Copilot review comments: fix validation, IDs, command names, polling - Remove unused using directives from AzureBackupCommandTests.cs - Fix ProtectableItemListCommand Id to valid GUID format - Replace manual BadRequest check with command validator for --vault-type in VaultCreateCommand - Fix incorrect command name 'azurebackup protectable_item_list' to 'azurebackup protectableitem list' in RsvBackupOperations - Replace hardcoded Task.Delay(30000) with polling loop for container visibility in VM protection * Fix azmcp-commands.md section ordering and e2e vault_create prompts - Move Azure Backup section from middle of App Service section to correct alphabetical position (after App Service, before Azure CLI) - Add vault-type to e2e vault_create prompts ('rsv' and 'dpp') * Address PR review comments: parallelize FindUnprotectedResources, use random GUIDs, update changelog * Fix namespace renames after upstream/main merge: Azure.Mcp.Core.Extensions -> Microsoft.Mcp.Core.Extensions, Azure.Mcp.Core.Commands -> Microsoft.Mcp.Core.Commands * Fix CI Build Analyze: correct import ordering and restore assets.json * Fix e2eTestPrompts.md: correct alphabetical section ordering * Merge upstream/main and fix namespace renames: Azure.Mcp.Core -> Microsoft.Mcp.Core, update tool metadata * Fix CI Analyze: correct import ordering in all 15 unit test files (System -> Azure -> Microsoft -> NSubstitute -> Xunit) * Fix LiveTests build: add missing using Microsoft.Mcp.Tests.Generated.Models for CustomDefaultMatcher * Remove empty assets.json to skip recorded tests until recordings are available * Add recorded test recordings with populated Tag, add DPP vault to test-resources.bicep * Remove redundant JsonPropertyName attributes from all model records (camelCase handled by AzureBackupJsonContext) * Address PR feedback: VaultUpdate validation, GetErrorMessage overrides, trim unused options, expand live+unit test coverage * Update recorded test assets for expanded live test coverage (12/15 tools) * Address PR review: remove stub BackupStatus command, replace Task.FromResult stubs with NotImplementedException, fix DrEnableCrr error message, parallelize vault listing * Implement real BackupStatus command using Azure SDK Replace the previously removed stub BackupStatus command with a real implementation that calls the Azure Backup Management Status API via Azure.ResourceManager.RecoveryServicesBackup SDK. Changes: - Implement GetBackupStatusAsync in AzureBackupService using BackupStatusContent - Re-create BackupStatusCommand and BackupStatusOptions - Re-register command in AzureBackupSetup, JsonContext, consolidated-tools - Add comprehensive unit tests (BackupStatusCommandTests) - Restore docs and e2e test prompts * Fix DPP implementations, add DPP live tests, address review feedback - Implement real Azure SDK calls for DPP ConfigureImmutabilityAsync, ConfigureSoftDeleteAsync, and ConfigureCrossRegionRestoreAsync - Fix DPP UpdateVaultAsync to wire soft-delete, immutability, and tags - Add ConfigureCrossRegionRestoreAsync to IDppBackupOperations - Route CRR through DPP in AzureBackupService (was hardcoded RSV-only) - Add 10 DPP live tests covering vault, policy, governance, jobs, DR - Add GetErrorMessage override to GovernanceFindUnprotectedCommand - Fix baseName maxLength in test-resources.bicep (24 -> 20) - Remove development artifacts (PR-Body.md, ManualTestCases.md, etc.) - Update recorded test assets for 22 live tests (RSV + DPP) * Address PR review: constructor injection, remove unused interface surface, trim service files * Address Jon PR review: fix comma-split resourceTypeFilter, TagFilter description, narrow InquireAsync catch, fix GenerateInstanceName duplication, update recordings * Address Jon review: resilient Task.WhenAll for partial results, validate workload types in DPP/RSV registries, update recordings * Address Jon review: explicit .AsRequired() for vault, policy, protectedItem, datasourceId, location option registrations * Address Copilot review: add VM/SQL aliases, fix option descriptions, clarify VaultGet resource-group, fix naming mode comment, fix DatasourceId description * Address alzimmermsft review: remove redundant JsonPropertyName, use terser new(), add governance/vault validators, fix CRR error message, move VaultGet validation to RegisterOptions * AzureBackup: Fix tests, remove redundant options, add XML docs and datasource registry improvements * Address PR review: remove unused usings, add --redundancy to VaultUpdateCommand * Address PR review comments: vault-type auto-detect fixes, option warnings, service tests - Fix ResolveVaultTypeAsync/AutoDetectAndExecuteAsync to catch 401/403 alongside 404 so DPP-only users aren't blocked when RSV probe returns Forbidden/Unauthorized - Add CollectUnsupportedPolicyOptionWarnings to return Warning in CreatePolicyAsync response when unimplemented options (schedule-frequency, weekly/monthly/yearly retention) are provided - Fix OperationCanceledException swallowed in ListVaultsAsync and FindUnprotectedResourcesAsync catch-all blocks - Reject --vault-type=dpp for ListProtectableItemsAsync (RSV-only operation) - Update option descriptions to clearly state not-yet-applied status - Update ProtectableItemListCommand description to note RSV-only - Fix CS0649 build error for BaseAzureService.s_defaultPollInterval in Release builds - Add AzureBackupServiceTests with 22 tests covering orchestration layer: auto-detect fallback (404/403/401), both-stacks-fail, partial ListVaults failure, cancellation propagation, unsupported option warnings, vault-type validation - Re-record all 48 live test sessions with updated assets tag * Address PR review: input validation, vault-type checks, sealed classes, OData sanitization - Add vault-type validation ('rsv'/'dpp') in BaseAzureBackupCommand and VaultGetCommand - Add ParseIdentityType validation in RSV/DPP, identity-type validator in VaultUpdateCommand - Add soft-delete retention days range (14-180) validators in GovernanceSoftDeleteCommand and VaultUpdateCommand - Throw NotSupportedException for unsupported policy options instead of silent warning - Add per-vault try/catch isolation in FindUnprotectedResourcesAsync - Add ValidateAndParseResourceTypeFilter with regex validation for OData safety - Harden NormalizeWorkloadTypeForFilter with strict allowlist - Add ConfigureStorageRedundancyAsync for RSV redundancy updates, throw for DPP - Apply tags via patchData.Tags in RSV UpdateVaultAsync - Seal AzureBackupService, RsvBackupOperations, DppBackupOperations, AzureBackupSetup - Add 47 new unit tests (235 total pass) * Address PR review: remove custom GetErrorMessage from GovernanceSoftDeleteCommand - Remove custom GetErrorMessage override per alzimmermsft feedback (default handler provides richer RequestFailedException handling) - Remove unused 'using System.Net' since HttpStatusCode is no longer referenced - Update corresponding unit tests to match default error handler messages * fixed unit tests and resolved other review comments * Added missing option in azmcp-commands * dotnet format * Fix Azure Backup bugs, update unit tests, re-record live tests Bug fixes (11): - BackupVaultInfo: 14-field constructor with full detail extraction - BackupPolicyInfo: 8-field constructor with full detail extraction - AzureBackupService: RG filter, backup status mapping, immutability normalization - RsvBackupOperations: BackupResourceVaultConfig for soft-delete, SoftDeleteFeatureState mapping, friendly name matching, container auto-discovery, 180s timeout - DppBackupOperations: MapToVaultInfo/MapToPolicyInfo detail extraction, friendly name matching - DppDatasourceRegistry: CosmosDB profile (PT4H/Incremental/BackupHourly) - VaultGetCommand: Pass resourceGroup to ListVaultsAsync - IAzureBackupService: Add resourceGroup param to ListVaultsAsync Unit tests: 244 pass, 9 new tests added Live tests: 43 pass (re-recorded with updated assertions) * Address PR review comments #2, #4, #5 - #2: Separate auth errors (401/403) from not-found (404) in ResolveVaultTypeAsync and AutoDetectAndExecuteAsync. Auth failures on DPP now throw UnauthorizedAccessException with RBAC guidance instead of being swallowed as KeyNotFoundException. - #4: NormalizeImmutabilityState now throws ArgumentException on unrecognized values instead of silently passing them through. - #5: Add RsvDatasourceRegistryTests with comprehensive coverage for Resolve, ResolveOrDefault, ResolveFromProtectedItemName, and profile properties. Add BindOptions_BindsOptionsCorrectly tests to all 15 command test files. Add service tests for auth error separation and invalid immutability state. * Merge main and suppress NU1903 for unpatched System.Security.Cryptography.Xml CVEs * Remove NuGetAuditSuppress for System.Security.Cryptography.Xml - package is pinned to patched 10.0.6 --------- Co-authored-by: Copilot Autofix powered by AI <[email protected]> Co-authored-by: anannya03 <[email protected]> Co-authored-by: Anannya Patra <[email protected]>
Colby Timm (colbytimm)
pushed a commit
to colbytimm/microsoft-mcp
that referenced
this pull request
Apr 25, 2026
* Add Azure Backup MCP toolset - Drop 1 (15 commands) Implements the first subset of Azure Backup MCP tools with 15 commands: - Vault: get (consolidated get+list), create, update - Policy: get (consolidated get+list), create - Protected Item: get (consolidated get+list), protect - Protectable Item: list - Backup: status - Job: get (consolidated get+list) - Recovery Point: get (consolidated get+list) - Governance: find-unprotected, immutability, soft-delete - DR: enablecrr Key design decisions: - Consolidated get+list into single 'get' commands with optional identifier - Full service layer included for extensibility in future drops - Dual vault architecture (RSV + Backup vault) with auto-detection - 99 unit tests covering all 15 commands Infrastructure changes: - Added Azure.ResourceManager.RecoveryServices 1.1.1 - Added Azure.ResourceManager.RecoveryServicesBackup 1.3.0 - Added Azure.ResourceManager.DataProtectionBackup 1.7.0 - Registered AzureBackupSetup in Program.cs and both slnx files * Fix CONTRIBUTING.md compliance gaps, add LiveTests project and test infrastructure - Remove 227 code comments from 18 source files - Add Azure Backup section to azmcp-commands.md - Add 30 e2e test prompts to e2eTestPrompts.md - Update README.md with Azure Backup service listing - Add CODEOWNERS entry for Azure Backup toolset - Add 7 consolidated tool groups to consolidated-tools.json - Add changelog entry YAML - Create test-resources.bicep and test-resources-post.ps1 - Create LiveTests project with 6 integration tests (vault, policy, governance, job) - Add assets.json for test proxy recording support - Update Microsoft.Mcp.slnx and Azure.Mcp.Server.slnx with LiveTests project - All 99 unit tests pass, all 6 live tests pass (6/6) * Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <[email protected]> * Address PR review comments: split model files, fix Bicep template - Remove unused tenantId parameter from test-resources.bicep - Interpolate testApplicationOid in role assignment description - Split WorkflowResult.cs: move WorkflowStep to its own file - Split HealthCheckResult.cs: move HealthCheckItemDetail to its own file * Upgrade Azure Backup packages to AOT-compatible versions - Azure.ResourceManager.RecoveryServicesBackup: 1.3.0 -> 1.3.1 - Azure.ResourceManager.RecoveryServices: 1.1.1 -> 1.2.0 - Azure.ResourceManager.DataProtectionBackup: 1.7.0 -> 1.7.1 - Azure.Core: 1.50.0 -> 1.51.1 (transitive dependency) - Azure.ResourceManager: 1.13.2 -> 1.14.0 (transitive dependency) - System.ClientModel: 1.8.0 -> 1.9.0 (transitive dependency) Resolves CI trim/AOT failures (NETSDK1144/IL2026) caused by non-AOT-compatible Azure.ResourceManager.RecoveryServicesBackup 1.3.0. * Fix consolidated-tools.json: split backup entries by metadata to match command annotations The consolidated mode validation requires all commands in a group to have identical ToolMetadata. The backup entries were incorrectly grouping read-only and write commands together, causing ConsolidatedModeTests to fail in Debug mode. Restructured 6 backup entries into 3 entries grouped by matching metadata: - get_azure_backup_details: 8 read-only commands (ReadOnly=true) - create_azure_backup_resources: 3 create commands (Destructive=true, Idempotent=false) - update_azure_backup_settings: 4 update commands (Destructive=true, Idempotent=true) * Fix LiveTests namespace: use Microsoft.Mcp.Tests instead of Azure.Mcp.Tests * Remove assets.json until test recordings are available The CI runs recorded tests for LiveTests projects that have assets.json. With an empty Tag (no recordings), the test proxy returns 404, causing all 6 LiveTests to fail across 4 platforms (24 failures). Remove assets.json so Test-Code.ps1 skips recorded tests for AzureBackup. Will re-add after recording test sessions per docs/recorded-tests.md. * Apply dotnet format to fix CI Analyze check dotnet format --verify-no-changes was failing due to single-line if statements that should use multi-line formatting per editorconfig. Auto-fixed 19 files in AzureBackup toolset. * Address Copilot PR review comments - Fix argument order bug in GovernanceSoftDeleteCommand (vaultType and softDeleteRetentionDays were swapped in ConfigureSoftDeleteAsync call) - Make ImmutabilityState, SoftDelete, and WorkloadType options required (fixes null-forgiving operator on optional fields) - Fix test-resources.bicep baseName default to use take() for maxLength safety - Update e2eTestPrompts.md governance prompts from 'Check' to 'Configure' - Update unit tests to reflect required option changes * Implement FindUnprotectedResourcesAsync with real Azure resource scanning Replace the stub that returned an empty list with a real implementation that: 1. Lists all Recovery Services and Backup vaults across the subscription 2. Collects datasource ARM IDs from all protected items in every vault 3. Lists generic resources of protectable types (VMs, SQL, Storage, etc.) 4. Returns resources whose IDs are not in the protected set Also supports optional filtering by resource type, resource group, and tags. AzureBackupService now extends BaseAzureService (with ITenantService) to obtain ARM client access for listing generic subscription resources. * Align datasource types to supported list and fix broken DPP registry tests - Remove MySQLFlexible from DPP registry (not a supported datasource type) - Fix s_protectableResourceTypes: remove Microsoft.Sql (SQL-in-VM is a VM workload), remove MySQL, add ElasticSAN and CosmosDB - Update WorkloadType and DatasourceType option descriptions - Rewrite DppBackupOperationsHelperTests to DppDatasourceRegistryTests (fix pre-existing build errors from refactored static methods to registry pattern) * Address Copilot review: validation, naming, docs fixes - Rename DppBackupOperationsHelperTests.cs to DppDatasourceRegistryTests.cs to match class name - VaultGetCommand: validate --resource-group is provided when --vault is specified (return 400) - VaultCreateCommand: validate --vault-type is provided (return 400 with helpful message) - Fix --redundancy description to use full names (GeoRedundant, LocallyRedundant, etc.) - Fix e2eTestPrompts: replace invalid AzureStorage with AzureFileShare workload type - Fix azmcp-commands.md: show --workload-type as required (not optional) for policy create * Address latest Copilot review: docs alignment, VaultTypeResolver validation, e2e prompts - Fix vault create docs: --vault-type shown as required (not optional) - Fix governance docs: --immutability-state and --soft-delete shown as required - Update README prompts: use 'configure' for destructive ops, include vault-type and location - VaultTypeResolver.IsVaultTypeSpecified: throw ArgumentException on invalid non-empty vault type - Fix backup_status e2e prompts: include required --location parameter * PR standards compliance: fix broken markdown, add assets.json, remove dead code - Fix azmcp-commands.md: add missing closing code fence after DR section (broke all subsequent markdown) - Add assets.json for LiveTests (required for recorded test infrastructure) - Fix e2eTestPrompts: governance find-unprotected use <resource_type> matching actual option name - Remove 5 unused *ListOptions classes (VaultList, JobList, PolicyList, ProtectedItemList, RecoveryPointList) * Remove empty assets.json to fix CI recorded test failures The assets.json with empty Tag causes CI to run recorded tests in Playback mode with no recordings, resulting in 404 errors. Removing until recordings are pushed. * Fix live test failures: add required governance params and recording sanitizers - Add missing 'soft-delete' parameter to GovernanceSoftDelete test - Add missing 'immutability-state' parameter to GovernanceImmutability test - Add TestMatcher and BodyRegexSanitizers for recorded test infrastructure - Remove assets.json (empty Tag causes CI Playback failures) * Address active Copilot review comments: fix validation, IDs, command names, polling - Remove unused using directives from AzureBackupCommandTests.cs - Fix ProtectableItemListCommand Id to valid GUID format - Replace manual BadRequest check with command validator for --vault-type in VaultCreateCommand - Fix incorrect command name 'azurebackup protectable_item_list' to 'azurebackup protectableitem list' in RsvBackupOperations - Replace hardcoded Task.Delay(30000) with polling loop for container visibility in VM protection * Fix azmcp-commands.md section ordering and e2e vault_create prompts - Move Azure Backup section from middle of App Service section to correct alphabetical position (after App Service, before Azure CLI) - Add vault-type to e2e vault_create prompts ('rsv' and 'dpp') * Address PR review comments: parallelize FindUnprotectedResources, use random GUIDs, update changelog * Fix namespace renames after upstream/main merge: Azure.Mcp.Core.Extensions -> Microsoft.Mcp.Core.Extensions, Azure.Mcp.Core.Commands -> Microsoft.Mcp.Core.Commands * Fix CI Build Analyze: correct import ordering and restore assets.json * Fix e2eTestPrompts.md: correct alphabetical section ordering * Merge upstream/main and fix namespace renames: Azure.Mcp.Core -> Microsoft.Mcp.Core, update tool metadata * Fix CI Analyze: correct import ordering in all 15 unit test files (System -> Azure -> Microsoft -> NSubstitute -> Xunit) * Fix LiveTests build: add missing using Microsoft.Mcp.Tests.Generated.Models for CustomDefaultMatcher * Remove empty assets.json to skip recorded tests until recordings are available * Add recorded test recordings with populated Tag, add DPP vault to test-resources.bicep * Remove redundant JsonPropertyName attributes from all model records (camelCase handled by AzureBackupJsonContext) * Address PR feedback: VaultUpdate validation, GetErrorMessage overrides, trim unused options, expand live+unit test coverage * Update recorded test assets for expanded live test coverage (12/15 tools) * Address PR review: remove stub BackupStatus command, replace Task.FromResult stubs with NotImplementedException, fix DrEnableCrr error message, parallelize vault listing * Implement real BackupStatus command using Azure SDK Replace the previously removed stub BackupStatus command with a real implementation that calls the Azure Backup Management Status API via Azure.ResourceManager.RecoveryServicesBackup SDK. Changes: - Implement GetBackupStatusAsync in AzureBackupService using BackupStatusContent - Re-create BackupStatusCommand and BackupStatusOptions - Re-register command in AzureBackupSetup, JsonContext, consolidated-tools - Add comprehensive unit tests (BackupStatusCommandTests) - Restore docs and e2e test prompts * Fix DPP implementations, add DPP live tests, address review feedback - Implement real Azure SDK calls for DPP ConfigureImmutabilityAsync, ConfigureSoftDeleteAsync, and ConfigureCrossRegionRestoreAsync - Fix DPP UpdateVaultAsync to wire soft-delete, immutability, and tags - Add ConfigureCrossRegionRestoreAsync to IDppBackupOperations - Route CRR through DPP in AzureBackupService (was hardcoded RSV-only) - Add 10 DPP live tests covering vault, policy, governance, jobs, DR - Add GetErrorMessage override to GovernanceFindUnprotectedCommand - Fix baseName maxLength in test-resources.bicep (24 -> 20) - Remove development artifacts (PR-Body.md, ManualTestCases.md, etc.) - Update recorded test assets for 22 live tests (RSV + DPP) * Address PR review: constructor injection, remove unused interface surface, trim service files * Address Jon PR review: fix comma-split resourceTypeFilter, TagFilter description, narrow InquireAsync catch, fix GenerateInstanceName duplication, update recordings * Address Jon review: resilient Task.WhenAll for partial results, validate workload types in DPP/RSV registries, update recordings * Address Jon review: explicit .AsRequired() for vault, policy, protectedItem, datasourceId, location option registrations * Address Copilot review: add VM/SQL aliases, fix option descriptions, clarify VaultGet resource-group, fix naming mode comment, fix DatasourceId description * Address alzimmermsft review: remove redundant JsonPropertyName, use terser new(), add governance/vault validators, fix CRR error message, move VaultGet validation to RegisterOptions * AzureBackup: Fix tests, remove redundant options, add XML docs and datasource registry improvements * Address PR review: remove unused usings, add --redundancy to VaultUpdateCommand * Address PR review comments: vault-type auto-detect fixes, option warnings, service tests - Fix ResolveVaultTypeAsync/AutoDetectAndExecuteAsync to catch 401/403 alongside 404 so DPP-only users aren't blocked when RSV probe returns Forbidden/Unauthorized - Add CollectUnsupportedPolicyOptionWarnings to return Warning in CreatePolicyAsync response when unimplemented options (schedule-frequency, weekly/monthly/yearly retention) are provided - Fix OperationCanceledException swallowed in ListVaultsAsync and FindUnprotectedResourcesAsync catch-all blocks - Reject --vault-type=dpp for ListProtectableItemsAsync (RSV-only operation) - Update option descriptions to clearly state not-yet-applied status - Update ProtectableItemListCommand description to note RSV-only - Fix CS0649 build error for BaseAzureService.s_defaultPollInterval in Release builds - Add AzureBackupServiceTests with 22 tests covering orchestration layer: auto-detect fallback (404/403/401), both-stacks-fail, partial ListVaults failure, cancellation propagation, unsupported option warnings, vault-type validation - Re-record all 48 live test sessions with updated assets tag * Address PR review: input validation, vault-type checks, sealed classes, OData sanitization - Add vault-type validation ('rsv'/'dpp') in BaseAzureBackupCommand and VaultGetCommand - Add ParseIdentityType validation in RSV/DPP, identity-type validator in VaultUpdateCommand - Add soft-delete retention days range (14-180) validators in GovernanceSoftDeleteCommand and VaultUpdateCommand - Throw NotSupportedException for unsupported policy options instead of silent warning - Add per-vault try/catch isolation in FindUnprotectedResourcesAsync - Add ValidateAndParseResourceTypeFilter with regex validation for OData safety - Harden NormalizeWorkloadTypeForFilter with strict allowlist - Add ConfigureStorageRedundancyAsync for RSV redundancy updates, throw for DPP - Apply tags via patchData.Tags in RSV UpdateVaultAsync - Seal AzureBackupService, RsvBackupOperations, DppBackupOperations, AzureBackupSetup - Add 47 new unit tests (235 total pass) * Address PR review: remove custom GetErrorMessage from GovernanceSoftDeleteCommand - Remove custom GetErrorMessage override per alzimmermsft feedback (default handler provides richer RequestFailedException handling) - Remove unused 'using System.Net' since HttpStatusCode is no longer referenced - Update corresponding unit tests to match default error handler messages * fixed unit tests and resolved other review comments * Added missing option in azmcp-commands * dotnet format * Fix Azure Backup bugs, update unit tests, re-record live tests Bug fixes (11): - BackupVaultInfo: 14-field constructor with full detail extraction - BackupPolicyInfo: 8-field constructor with full detail extraction - AzureBackupService: RG filter, backup status mapping, immutability normalization - RsvBackupOperations: BackupResourceVaultConfig for soft-delete, SoftDeleteFeatureState mapping, friendly name matching, container auto-discovery, 180s timeout - DppBackupOperations: MapToVaultInfo/MapToPolicyInfo detail extraction, friendly name matching - DppDatasourceRegistry: CosmosDB profile (PT4H/Incremental/BackupHourly) - VaultGetCommand: Pass resourceGroup to ListVaultsAsync - IAzureBackupService: Add resourceGroup param to ListVaultsAsync Unit tests: 244 pass, 9 new tests added Live tests: 43 pass (re-recorded with updated assertions) * Address PR review comments microsoft#2, microsoft#4, microsoft#5 - microsoft#2: Separate auth errors (401/403) from not-found (404) in ResolveVaultTypeAsync and AutoDetectAndExecuteAsync. Auth failures on DPP now throw UnauthorizedAccessException with RBAC guidance instead of being swallowed as KeyNotFoundException. - microsoft#4: NormalizeImmutabilityState now throws ArgumentException on unrecognized values instead of silently passing them through. - microsoft#5: Add RsvDatasourceRegistryTests with comprehensive coverage for Resolve, ResolveOrDefault, ResolveFromProtectedItemName, and profile properties. Add BindOptions_BindsOptionsCorrectly tests to all 15 command test files. Add service tests for auth error separation and invalid immutability state. * Merge main and suppress NU1903 for unpatched System.Security.Cryptography.Xml CVEs * Remove NuGetAuditSuppress for System.Security.Cryptography.Xml - package is pinned to patched 10.0.6 --------- Co-authored-by: Copilot Autofix powered by AI <[email protected]> Co-authored-by: anannya03 <[email protected]> Co-authored-by: Anannya Patra <[email protected]>
Shraddha Jain (shrja-ms)
added a commit
to shrja-ms/mcp
that referenced
this pull request
May 4, 2026
Telemetry report skill (SKILL.md + kql-queries.md): - Add case-sensitivity note for Kusto bag key access (microsoft#6) - Fix week-over-week query range to include current partial week (microsoft#7) - Add InvalidOperationException to MCP Tool Bug classification (microsoft#8) - Add missing KQL queries 11-13 for WorkloadType, DatasourceType, OperationScope custom dimensions (microsoft#9) - Fix live test count to use [Fact] only, avoiding double-count with [LiveTestOnly] on same method (microsoft#5) - Update decision tree to include InvalidOperationException Add-tool skill (SKILL.md): - Fix broken relative link to new-command.md (5 levels up, not 3) (#1) - Fix live test snippet to use [Fact] + CallToolAsync pattern, not non-existent [RecordedTest]/RunCommandAndAssert (#2, microsoft#11) - Add missing Update-AzCommandsMetadata.ps1 step after docs update (microsoft#3) - Add AOT/native build verification step (Build-Local.ps1 -BuildNative) (microsoft#4) - Fix vault/vaultType to reference AzureBackupOptionDefinitions, not OptionDefinitions.Common (microsoft#10) - Expand git add scope to include README.md and eng/vscode/README.md (microsoft#12) - Add commands metadata regeneration and AOT build to PR checklist
Shraddha Jain (shrja-ms)
added a commit
that referenced
this pull request
May 8, 2026
…workflow (#2570) * azurebackup: Add weekly telemetry report skill Add a Copilot skill under tools/Azure.Mcp.Tools.AzureBackup/skills/ that automates generation of weekly telemetry reports by: - Running KQL queries against the ddazureclients Kusto cluster - Classifying errors into Customer (4xx) / Azure Service / MCP Tool Bug - Correlating with merged PRs, releases, and known bug IDs - Producing an Outlook-compatible HTML report Includes: - SKILL.md with full procedure and error classification decision tree - references/kql-queries.md with all 10 production KQL queries - assets/report-template.html with Outlook-compatible HTML template * azurebackup: Add 'add-tool' skill for new command workflow Add a Copilot skill that guides the full lifecycle of adding a new Azure Backup MCP command: - Phase 1: Implementation (options, service, command, registration) - Phase 2: Input validation checklist - Phase 3: Unit tests with required test patterns - Phase 4: Live tests with Record/Playback workflow - Phase 5: CI validation (build, format, spell check) - Phase 6: ToolDescriptionEvaluator scoring - Phase 7: Documentation updates - Phase 8: PR submission checklist * azurebackup: Fix telemetry report skill - BUG-1 status and test count methodology - BUG-1 (backup_status ArgumentNullException) is fixed in #2518 (code included in merged PR, though PR title only lists BUG-3,4,5,6,8) - Fix unit test count methodology: count [Fact] + [InlineData] for runnable test cases, not [Fact] + [Theory] for method count - Add Release column to bug tracker table - Add note about verifying PR diff vs title for bug coverage * azurebackup: Address all 12 PR review comments on skills Telemetry report skill (SKILL.md + kql-queries.md): - Add case-sensitivity note for Kusto bag key access (#6) - Fix week-over-week query range to include current partial week (#7) - Add InvalidOperationException to MCP Tool Bug classification (#8) - Add missing KQL queries 11-13 for WorkloadType, DatasourceType, OperationScope custom dimensions (#9) - Fix live test count to use [Fact] only, avoiding double-count with [LiveTestOnly] on same method (#5) - Update decision tree to include InvalidOperationException Add-tool skill (SKILL.md): - Fix broken relative link to new-command.md (5 levels up, not 3) (#1) - Fix live test snippet to use [Fact] + CallToolAsync pattern, not non-existent [RecordedTest]/RunCommandAndAssert (#2, #11) - Add missing Update-AzCommandsMetadata.ps1 step after docs update (#3) - Add AOT/native build verification step (Build-Local.ps1 -BuildNative) (#4) - Fix vault/vaultType to reference AzureBackupOptionDefinitions, not OptionDefinitions.Common (#10) - Expand git add scope to include README.md and eng/vscode/README.md (#12) - Add commands metadata regeneration and AOT build to PR checklist * azurebackup: Convert relative links to absolute paths for CI link checker The link verification step requires absolute paths from repo root, not relative paths. Convert all ./references/ and ../../../ links to /tools/Azure.Mcp.Tools.AzureBackup/skills/... format. * azurebackup: Use full GitHub URLs for CI link checker Link checker requires https://github.com/microsoft/mcp/blob/main/... format, not repo-root-relative paths. * azurebackup: Add InvalidOperationException to Query 1, replace Power BI URLs with placeholder - Query 1 (primary per-tool health) was missing InvalidOperationException in the McpToolBug case, causing inconsistency with Queries 2 and 4 - Replace hardcoded Power BI dashboard URLs in report template with {{POWERBI_DASHBOARD_URL}} placeholder (public repo, internal GUIDs)
Vinay Gera (g2vinay)
added a commit
to g2vinay/mcp
that referenced
this pull request
Jul 9, 2026
- HTTP test processes: disable stdout/stderr redirection (never read by HTTP tests) to eliminate child-process pipe-buffer hang risk. Stdio tests that read stdout keep stdout redirect but disable stderr. (Copilot microsoft#1/microsoft#2) - SendWithRetryAsync: dispose the 404 HttpResponseMessage before retrying to prevent socket/handler leaks. (Copilot microsoft#5/microsoft#6) - WriteMissingRoutingHeaderResponse: emit a proper JSON-RPC 2.0 error envelope and use JsonEncodedText.Encode + .ToString() for correct string escaping. (Copilot microsoft#3 / my F1) - RegistryServerProvider class doc: replace the misleading Authorization Hardening bullet list with accurate language — only HTTPS + non-empty scope checks are performed here; issuer/app-type/PRM checks are delegated to Azure Identity. (Copilot microsoft#4 / my F3)
Vinay Gera (g2vinay)
added a commit
that referenced
this pull request
Jul 23, 2026
* Phase 1 MCP stateless migration baseline * Phase 1 elicitation wrapper hardening and HTTP stateless transport tests * Phase 1 core test harness migration: fix obsolete SDK API errors and add negative HTTP test * Phase 1 mode coverage and session-affinity regression tests - Add ServerModeCoverageTests: stdio stateless tools/list for single, namespace, and all modes without initialize handshake (Workstream I item 5) - Add Mcp-Session-Id absence assertion to HTTP positive test in ConsolidatedModeTests (Workstream I item 7 / Workstream B): server must not set Mcp-Session-Id under the 2026-07-28 stateless protocol * Phase 1 Workstream B item 2: Mcp-Method/body mismatch rejection test Add negative test that sends Mcp-Method: tools/call in headers but tools/list in the JSON body. Under the 2026-07-28 protocol header/body agreement is required for explicit gateway routing; server must respond with a 4xx client error for a mismatch. * Phase 2: harden HTTP header/meta conformance tests * Phase 2: enforce required MCP HTTP routing headers * Phase 2: implement W3C trace context propagation - Add W3C trace context support (traceparent, tracestate, baggage) to _meta handling - Capture trace context fields in both CallToolHandler and ListToolsHandler - Add W3C trace context tags to telemetry constants (w3c.traceparent, w3c.tracestate, w3c.baggage) - Add comprehensive test for W3C trace context propagation in HTTP mode - Verified Azure telemetry enrichment remains compatible with new trace context capture * Phase 3: establish deterministic tool resolution fallback for sampling deprecation Workstream E: Sampling deprecation and deterministic routing - Add telemetry tracking for sampling vs deterministic resolution (resolution.method, sampling.attempted, sampling.succeeded, resolution.confidence) - Implement DeterministicToolResolution utility with token-based matching and Levenshtein distance for command/tool inference - Support deterministic fallback when sampling is unavailable or deprecated - Add 8 comprehensive unit tests validating tool name and command matching - Fix pre-existing RequestContext constructor issue in ToolLoaderTelemetryTests Strategy: Keep sampling as optional enhancement while building deterministic path parity through telemetry measurement. Enables Phase 3 sampling deprecation roadmap. * Phase 2: finalize session-affinity disposition and operator guidance - Record Workstream B item 4 decision: session-affinity package remains optional for explicit legacy/custom state-routing scenarios only - Keep package out of default Azure MCP runtime assumptions - Update operator guidance to header-first stateless routing for MCP 2026-07-28 (Mcp-Method/Mcp-Name) - Clarify when not to enable session affinity in distributed package README * Phase 2: add stateless server/discover discovery coverage - Add consolidated-mode HTTP integration test for server/discover with MCP 2026-07-28 routing headers - Validate discovery succeeds without initialize handshake - Validate stateless response does not emit Mcp-Session-Id - Record Workstream C progress in migration proposal * Phase 2: codify startup/discovery split and list cache semantics * Phase 2: mark cache metadata emission as SDK-gated * MCP 2026-07-28: fix HTTP routing-header conformance and registry OAuth validation Phase 2 (Workstream B / SEP-2243): gate Mcp-Method/Mcp-Name enforcement on the 2026-07-28 protocol version and require Mcp-Name only for named methods (tools/call, resources/read, prompts/get), preserving legacy 2025-11-25 HTTP interop. Correct and extend ConsolidatedMode header tests (named-method rejection, non-named-method acceptance, legacy initialize interop). Workstream G: add outbound OAuth validation to RegistryServerProvider, remove misleading dead issuer-binding branch, and correct the OAuth resource-parameter RFC citation (RFC 8707) in Authentication.md. Workstream I item 6: add ServerToolLoader external-server discovery and proxy-routing fallback tests. Docs: record Phase 1/2 and Workstream G verification findings in the migration proposal. * Remove MCP migration proposal doc from PR (design/proposal doc, not shipped) * Fix test harness for MCP 2026-07-28 beta SDK (Workstream I) The beta SDK (2.0.0-preview.1) added a private protected abstract member (ResolveInputRequestsAsync) to McpClient, making it impossible to proxy with NSubstitute or subclass from a test assembly; every Substitute.For<McpClient>() threw TypeLoadException at mock-creation time. Add a reusable LoopbackMcpClient test helper that builds a real McpClient over an in-process loopback transport (forcing the legacy 2025-11-25 handshake) and answers requests via a responder. Convert all McpClient mock sites (MockMcpClientBuilder, MockMcpDiscoveryStrategyBuilder, ServerToolLoaderTests, SingleProxyToolLoaderTests, BaseDiscoveryStrategyTests) to the loopback client, and observe client disposal via a transport-backed tracker. Also fix three pre-existing migration test gaps surfaced by the full run: - ServerStartCommandTests.InvalidMode: expect ClientTransportClosedException (wrapping IOException), the SDK's new early-transport-failure type. - ClientToolTests ping: assert ping is unavailable on the 2026-07-28 protocol (method name retained for recorded-session matching). - McpRuntimeTests null-parameter test: pass null Params so the runtime null-guard is exercised. Core, Microsoft.Mcp.Core, and Azure.Mcp.Server test suites are green. * Fix whitespace formatting in migrated tool-loader tests Normalize over-indented lines flagged by dotnet format (WHITESPACE) that were introduced during the SDK RequestContext API migration edits. * Make InvalidMode test platform-agnostic ClientTransportClosedException.InnerException is platform-dependent (IOException on Windows, null on Linux CI). Assert only the outer ClientTransportClosedException, which is thrown consistently and already proves the invalid mode fails to start the server. * Address Copilot PR review: test hangs, 404 leak, error body, doc - HTTP test processes: disable stdout/stderr redirection (never read by HTTP tests) to eliminate child-process pipe-buffer hang risk. Stdio tests that read stdout keep stdout redirect but disable stderr. (Copilot #1/#2) - SendWithRetryAsync: dispose the 404 HttpResponseMessage before retrying to prevent socket/handler leaks. (Copilot #5/#6) - WriteMissingRoutingHeaderResponse: emit a proper JSON-RPC 2.0 error envelope and use JsonEncodedText.Encode + .ToString() for correct string escaping. (Copilot #3 / my F1) - RegistryServerProvider class doc: replace the misleading Authorization Hardening bullet list with accurate language — only HTTPS + non-empty scope checks are performed here; issuer/app-type/PRM checks are delegated to Azure Identity. (Copilot #4 / my F3) * Fix Fabric ServerStartupTests: restore stderr redirection broken by redirect fix The previous change (afb871c) set RedirectStandardError = false on all Fabric test blocks. However all three tests call process.BeginErrorReadLine() and assert on the captured stderr to detect DI errors — BeginErrorReadLine() requires RedirectStandardError = true and throws InvalidOperationException otherwise. Restored to true in all three test blocks. * Fix import ordering in McpServerElicitationExtensionsTests * Fix Authentication.md: clarify issuer validation is a deployment requirement, not server-enforced Three places in Authentication.md overclaimed that the Azure MCP Server enforces issuer validation for outbound registry connections. The code (ValidateOAuthConfiguration) only checks HTTPS and non-empty scopes; issuer/audience validation is performed by the downstream resource via Azure Identity bearer tokens. Updated: (1) the remote auth layer description, (2) the MCP 2026-07-28 note box, (3) the OAuth requirements table — separating enforced checks (HTTPS, non-empty scopes) from deployment requirements (issuer, app-type, scope registration). Addresses RickWinter review comment. * Defer DeterministicToolResolution and dead telemetry constants to Phase 3 PR DeterministicToolResolution.cs (220 lines) and its test file (189 lines) have no production callers — all three loader paths still guard intent resolution with SupportsSampling(), so a client without sampling gets the learn response and never reaches this resolver. The four companion telemetry constants (ResolutionMethod, SamplingAttempted, SamplingSucceeded, ResolutionConfidence) are also never emitted. Per RickWinter's review, defer to the Phase 3 PR that actually wires up deterministic routing so the surface lands with its integration tests. The code is preserved in commit ae8ff11 and can be cherry-picked into the Phase 3 branch. * Harden W3C trace context capture: validate inputs before recording to telemetry CaptureToolCallMeta accepted traceparent, tracestate, and baggage verbatim from untrusted MCP _meta fields. An attacker controlling tool-call input could stuff arbitrary data into these fields and have it written into distributed traces. - traceparent: validate against the W3C format regex (^[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$) before adding the tag; silently drop malformed values. - tracestate: cap at 512 chars per W3C spec guidance; drop if longer. - baggage: removed entirely. Baggage is an unbounded cross-service propagation bag, not a trace identifier. Recording it verbatim lets callers write arbitrary key-value pairs into telemetry. Remove the TagName.Baggage constant as it is now unused. * Fix Insights build against MCP SDK 2.0.0-preview.1: suppress deprecated sampling APIs Azure.Mcp.Tools.Insights was added to main after this branch was cut. When CI merges the PR into main the Insights source is compiled against the upgraded SDK, which made four sampling APIs error-level obsolete (MCP9005): CreateMessageRequestParams, SamplingMessage, McpServer.SampleAsync, ClientCapabilities.Sampling. Additionally, CommandContext.McpServer and CommandContext.ProgressToken were removed from CommandContext in this migration, causing CS1061 errors in InsightsGetCommand. Fixes: - Restore McpServer? and ProgressToken? to CommandContext (neither type is deprecated; only McpServer.SampleAsync is). - Restore McpServer = request.Server / ProgressToken = request.Params.ProgressToken in CommandFactoryToolLoader and NamespaceToolLoader. - Add NoWarn>MCP9005 to the Insights src and test csproj files with a comment noting migration to MRTR is tracked as Phase 3 work. All 54 Insights unit tests pass. * Fix broken link in Authentication.md: correct csharp-sdk issue URL * Address review: per-request client info, routing-header middleware docs, telemetry tests, changelog Three open review comments addressed: Comment 2 (alzimmermsft): In the 2026-07-28 stateless protocol there is no initialize handshake, so request.Server.ClientInfo is null on every request. Clients embed their identity in each request's _meta under 'io.modelcontextprotocol/clientInfo'. Update TelemetryService.StartActivity to read client name/version from _meta when present (per-request wins over session-level clientInfo). - McpHelper: add ClientInfoMetaKey/ClientInfoNameKey/ClientInfoVersionKey constants - ITelemetryService.StartActivity: add RequestParams? parameter - TelemetryService: extract SetClientNameAndVersion helper; reads from _meta when requestParams != null - McpRuntime: pass request.Params to both StartActivity calls Comment 1 (vukelich): Document why ValidateMcpRoutingHeadersMiddleware exists alongside the SDK's own ValidateMcpHeaders. The SDK validates post-body-parse; at the Kestrel 30 MB limit it throws BadHttpRequestException instead of a clean JSON-RPC error. Our middleware rejects before the body is read. Updated block comment in ServiceStartCommand.cs. New tests (15 total): - McpRuntimeTests: 9 tests for CaptureToolCallMeta (valid/invalid traceparent, tracestate length cap, baggage never recorded, null meta) - TelemetryServiceTests: 6 tests for SetClientNameAndVersion (null/null, session-only, _meta-only, _meta wins over session, non-string values ignored, missing key) - Exposes CaptureToolCallMeta as internal TestHook_CaptureToolCallMeta; adds Azure.Mcp.Core.Tests to InternalsVisibleTo Changelog: added servers/Azure.Mcp.Server/changelog-entries/1784709301470.yaml for the MCP 2026-07-28 migration. * Add inline comments explaining elicitation wrapper and stateless ClientInfo behaviour * Fix OTLP trace export: register SDK and ASP.NET Core activity sources Two bugs in the OTLP trace pipeline (pre-existing on main, not introduced by this PR): 1. AddSource('Azure.Mcp.Server') was registered in ConfigureOpenTelemetryTracerProvider but not in the OTLP WithTracing chain. These are separate TracerProviderBuilder instances so the OTLP exporter never received those spans. Fixed by also calling AddSource in the OTLP WithTracing block. 2. ListToolsHandler/ToolExecuted spans are children of the ASP.NET Core HTTP request span. Without AddAspNetCoreInstrumentation(), the root HTTP span is unsampled and the entire trace tree is dropped. Added AddAspNetCoreInstrumentation() to the OTLP WithTracing chain so the full POST / -> ListToolsHandler -> (child ops) trace hierarchy appears in Aspire/OTLP collectors. Also added AddSource for ModelContextProtocol and ModelContextProtocol.Server to export MCP SDK-internal spans in the same trace. Validated locally: old server (no fix) shows zero tool traces in Aspire even after a successful tools/call. New server (with fix) shows full POST / + ToolExecuted trace hierarchy with ClientName, ClientVersion, w3c.traceparent, and w3c.tracestate tags.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed order of the columns in code resource and added language (typescript)