From ce069143f985bda608ab9c0db7342e4e645de284 Mon Sep 17 00:00:00 2001
From: alzimmermsft <48699787+alzimmermsft@users.noreply.github.com>
Date: Thu, 23 Jul 2026 12:26:49 -0400
Subject: [PATCH 1/5] Initial work
---
.editorconfig | 27 +-
Directory.Build.props | 2 +
.../src/Options/RetryOptionsExtensions.cs | 3 -
.../Azure/BaseAzureResourceService.cs | 4 +
.../src/Services/Azure/BaseAzureService.cs | 2 +
.../Services/Azure/Tenant/ITenantService.cs | 14 +-
.../TenantServiceCollectionExtensions.cs | 7 +-
.../AccessTokenHandlerTests.cs | 1 +
.../Commands/Runtime/McpRuntimeTests.cs | 4 +-
...viceCollectionExtensionsSerializedTests.cs | 12 +-
.../ToolLoading/NamespaceToolLoaderTests.cs | 7 +-
.../Server/Helpers/MockMcpClientBuilder.cs | 7 +-
.../MockMcpDiscoveryStrategyBuilder.cs | 2 +
.../AssemblyAttributes.cs | 5 +-
.../Client/MockClientTests.cs | 2 +-
.../McpServerElicitationExtensionsTests.cs | 36 +-
.../RecordedCommandTestHarness.cs | 1 +
.../SubscriptionCommandUnitTestsBase.cs | 3 +
.../src/AccessTokenHandler.cs | 2 +-
.../ConsolidatedToolDiscoveryStrategy.cs | 2 +
.../ConsolidatedToolServerProvider.cs | 2 +-
.../Discovery/RegistryDiscoveryStrategy.cs | 8 +-
.../Discovery/RegistryServerProvider.cs | 1 -
.../Server/Commands/OptionSchemaGenerator.cs | 8 +-
.../Server/Commands/Runtime/McpRuntime.cs | 1 +
.../Commands/ServiceCollectionExtensions.cs | 10 +-
.../Server/Commands/ServiceStartCommand.cs | 1 +
.../Commands/ToolLoading/IToolLoader.cs | 2 +-
.../Commands/ToolLoading/ServerToolLoader.cs | 1 +
.../ToolLoading/SingleProxyToolLoader.cs | 3 +-
...gistryServerServiceCollectionExtensions.cs | 1 -
.../src/Areas/Server/ServerJsonContext.cs | 7 +-
.../src/Areas/Server/ServerSetup.cs | 4 +-
.../src/Commands/CommandFactory.cs | 2 +-
.../src/Commands/ICommandFactory.cs | 2 +
.../src/Extensions/ActivityExtensions.cs | 1 +
.../McpServerElicitationExtensions.cs | 3 +-
.../src/Extensions/OpenTelemetryExtensions.cs | 27 +-
.../src/Helpers/McpHelper.cs | 1 +
.../src/Helpers/OptionParsingHelpers.cs | 9 +-
.../src/Models/Command/CommandContext.cs | 4 +-
.../IAzureTokenCredentialProvider.cs | 3 +-
.../Caching/HttpServiceCacheService.cs | 1 -
.../ExternalProcessService.cs | 18 +-
.../UnixMachineInformationProvider.cs | 6 +-
.../Client/CommandTestsBase.cs | 1 +
.../Client/Helpers/BinaryContentHelper.cs | 2 +-
.../Client/Helpers/CustomTestTransport.cs | 2 +-
.../Client/Helpers/McpTestUtilities.cs | 6 +-
.../Client/Helpers/RecordingPathResolver.cs | 2 +-
.../Client/LiveServerFixture.cs | 2 -
.../Microsoft.Mcp.Tests/Client/TestProxy.cs | 7 +-
...oftClientModelTestFrameworkModelFactory.cs | 2 +
...EnvironmentVariablesBeforeTestAttribute.cs | 31 +-
eng/tools/CopilotCliTester/src/AgentRunner.cs | 11 +-
.../CopilotCliTester/src/AgentRunnerUtils.cs | 9 +-
.../src/CopilotCliTester.csproj | 1 +
.../src/Models/EmbeddingModels.cs | 2 +-
.../src/Models/McpModels.cs | 2 +-
.../src/Models/SourceGenerationContext.cs | 2 +-
.../src/Models/SuccessRateMetrics.cs | 2 +-
.../ToolDescriptionEvaluator/src/Program.cs | 12 +-
.../src/Services/EmbeddingService.cs | 4 +-
.../src/ToolDescriptionEvaluator.csproj | 1 +
.../src/VectorDb/VectorDB.cs | 2 +-
.../src/AppConfiguration.cs | 4 +-
.../src/Models/CommandLineOptions.cs | 2 +
eng/tools/ToolMetadataExporter/src/Program.cs | 10 +-
.../src/Services/AzmcpProgram.cs | 2 +-
.../ToolMetadataExporter/src/ToolAnalyzer.cs | 2 +-
.../src/ToolMetadataExporter.csproj | 1 +
eng/tools/ToolMetadataExporter/src/Utility.cs | 6 +-
.../Services/AzmcpProgramTests.cs | 5 +-
.../ToolAnalyzerTests.cs | 3 +-
servers/Azure.Mcp.Server/src/Program.cs | 1 -
.../src/Properties/AssemblyInfo.cs | 5 +-
.../CommandTypeInventoryTests.cs | 1 -
servers/Fabric.Mcp.Server/src/Program.cs | 2 +-
servers/Template.Mcp.Server/src/Program.cs | 2 +-
.../src/Services/AcrService.cs | 5 +-
.../AssemblyAttributes.cs | 5 +-
.../src/Commands/AdvisorJsonContext.cs | 3 +
.../src/Services/Models/RecommendationData.cs | 2 +-
.../Models/RecommendationDescription.cs | 2 +-
.../Models/RecommendationProperties.cs | 2 +-
.../Models/RecommendationResourceMetadata.cs | 2 +-
.../src/Services/AksService.cs | 53 +-
.../src/Models/KeyValueSetting.cs | 4 +-
.../src/Services/AppConfigService.cs | 6 +-
.../src/Services/AppLensService.cs | 6 +-
.../src/Models/DetectorDetails.cs | 2 +-
.../src/Models/DiagnosisResult.cs | 2 +-
.../Services/ApplicationInsightsService.cs | 5 +-
.../src/Services/IProfilerDataService.cs | 3 +
.../src/Services/ProfilerDataService.cs | 4 +
.../Services/Policy/PolicyCreateValidator.cs | 8 -
.../src/Services/Policy/RsvPolicyBuilder.cs | 48 --
.../src/Services/IDatadogService.cs | 3 +
.../Design/DesignCommandTests.cs | 1 -
.../src/Services/ICommunicationService.cs | 2 +
.../Util/DeploymentPlanTemplateUtil.cs | 4 +
.../src/AssemblyInfo.cs | 3 +
.../EventHubsCommandTests.cs | 26 -
.../src/ExtensionSetup.cs | 1 +
.../src/Services/CliInstallService.cs | 2 +-
.../src/Services/IFileSharesService.cs | 1 +
.../FileSharesCommandTests.cs | 2 -
.../Services/Helpers/GitHubUrlValidator.cs | 2 +-
.../src/Services/GrafanaService.cs | 9 +-
.../src/Services/IGrafanaService.cs | 2 +
.../src/Services/IInsightsService.cs | 9 +
.../src/Commands/IoTHub/IoTHubGetCommand.cs | 1 -
.../src/GlobalUsings.cs | 1 -
.../src/Services/IIoTHubService.cs | 1 -
.../src/Services/IoTHubService.cs | 1 -
.../IoTHub/IoTHubGetCommandTests.cs | 2 -
.../src/Services/IKeyVaultService.cs | 11 +
.../AssemblyAttributes.cs | 5 +-
.../src/Services/IKustoService.cs | 1 -
.../src/Services/KustoService.cs | 7 +-
.../Commands/FileSystem/Sku/SkuGetCommand.cs | 3 -
.../src/Services/MarketplaceService.cs | 2 +
.../Detectors/DotNetAppTypeDetector.cs | 4 +-
.../Pipeline/WorkspaceAnalyzer.cs | 1 -
.../src/Models/MetricTimeSeries.cs | 121 ++--
.../src/Models/RoundedDoubleArrayConverter.cs | 55 +-
.../src/Services/IResourceResolverService.cs | 1 +
.../src/Services/MonitorHealthModelService.cs | 2 -
.../src/Services/MonitorService.cs | 3 +-
.../src/Services/MonitorWebTestService.cs | 5 +-
.../Tools/Instrumentation/OrchestratorTool.cs | 2 +
.../Log/WorkspaceLogQueryCommandTests.cs | 1 -
.../Metrics/MonitorMetricsServiceTests.cs | 1 -
.../MonitorCommandTests.cs | 19 -
.../src/Options/AuthTypes.cs | 11 +-
.../Services/PostgresServiceRowLimitTests.cs | 2 -
.../src/Services/IResourceHealthService.cs | 3 +
.../src/Services/IServiceBusService.cs | 8 +-
.../IFastTranscriptionRecognizer.cs | 1 +
.../Services/SpeechServiceTests.cs | 3 -
.../Commands/Server/ServerCreateCommand.cs | 2 -
.../src/Services/Models/SqlDatabaseData.cs | 2 +-
.../Services/Models/SqlDatabaseProperties.cs | 2 +-
.../Services/Models/SqlFirewallRuleData.cs | 2 +-
.../Models/SqlFirewallRuleProperties.cs | 2 +-
.../Models/SqlServerAadAdministratorData.cs | 2 +-
.../SqlServerAadAdministratorProperties.cs | 2 +-
.../src/Services/Models/SqlSku.cs | 2 +-
.../src/Services/SqlService.cs | 31 -
.../src/Models/SreAgentThreadModels.cs | 1 -
.../ScheduledTasksDeleteOptions.cs | 1 -
.../src/Services/ISreAgentService.cs | 1 -
.../AssemblyAttributes.cs | 3 +
.../SreAgentCommandTests.cs | 583 +++++++++---------
.../src/Services/StorageService.cs | 14 +-
.../Workbooks/CreateWorkbooksCommand.cs | 2 +-
.../src/Services/FabricPublicApiService.cs | 1 -
.../src/Models/OneLakeJsonContext.cs | 1 -
.../src/Services/OneLakeService.cs | 74 +--
.../Services/OneLakeServiceLroTests.cs | 1 -
160 files changed, 723 insertions(+), 931 deletions(-)
diff --git a/.editorconfig b/.editorconfig
index 9c0d816014..e4dea92413 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -15,6 +15,7 @@ indent_size = 4
# C# files
[*.cs]
+file_header_template = Copyright (c) Microsoft Corporation.\nLicensed under the MIT License.
# New line preferences
csharp_new_line_before_open_brace = all # vs-default: any
csharp_new_line_before_else = true # vs-default: true
@@ -33,7 +34,7 @@ csharp_indent_switch_labels = true # vs-default: true
csharp_indent_labels = one_less_than_current # vs-default: one_less_than_current
# Modifier preferences
-csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
+csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:error
# avoid this. unless absolutely necessary
dotnet_style_qualification_for_field = false:suggestion # vs-default: false:none
@@ -83,7 +84,7 @@ dotnet_naming_style.camel_case_underscore_style.required_prefix = _
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
# Code style defaults
-csharp_using_directive_placement = outside_namespace:suggestion
+csharp_using_directive_placement = outside_namespace:error
dotnet_sort_system_directives_first = true # vs-default: true
csharp_prefer_braces = true:refactoring
csharp_preserve_single_line_blocks = true # vs-default: true
@@ -91,10 +92,13 @@ csharp_preserve_single_line_statements = false # vs-default: true
csharp_prefer_static_local_function = true:suggestion
csharp_prefer_simple_using_statement = false:none
csharp_style_prefer_switch_expression = true:suggestion
+csharp_style_namespace_declarations = file_scoped:error
+csharp_style_namespace_match_folder = true:error
# Code quality
dotnet_style_readonly_field = true:suggestion
-dotnet_code_quality_unused_parameters = non_public:suggestion
+# Safe to warn on all unused parameters as the project is shipped as an application and not a library.
+dotnet_code_quality_unused_parameters = all:error
# Expression-level preferences
dotnet_style_object_initializer = true:suggestion # vs-default: true:suggestion
@@ -167,6 +171,23 @@ dotnet_code_quality.ca1802.api_surface = private, internal
# CA2016: Forward the CancellationToken parameter to methods that take one
dotnet_diagnostic.CA2016.severity = error
+# Diagnostics without corresponding editorconfig options
+# Unused usings
+dotnet_diagnostic.IDE0005.severity = error
+# Invalid string formatting
+dotnet_diagnostic.IDE0043.severity = error
+# Unused/unread private members
+dotnet_diagnostic.IDE0051.severity = error
+dotnet_diagnostic.IDE0052.severity = error
+# Require file header
+dotnet_diagnostic.IDE0073.severity = error
+# Make methods synchronous (remove async modifier from methods without any await statements)
+dotnet_diagnostic.IDE0390.severity = error
+dotnet_diagnostic.IDE0391.severity = error
+
+#
+dotnet_diagnostic.CS1591.severity = none
+
# Xml project files
[*.{csproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}]
indent_size = 2
diff --git a/Directory.Build.props b/Directory.Build.props
index 5562f7fc96..7636c6c1a3 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -20,6 +20,8 @@
See: https://learn.microsoft.com/nuget/reference/errors-and-warnings/nu1901-nu1904
-->
$(WarningsNotAsErrors);NU1901;NU1902
+ true
+ true
diff --git a/core/Azure.Mcp.Core/src/Options/RetryOptionsExtensions.cs b/core/Azure.Mcp.Core/src/Options/RetryOptionsExtensions.cs
index b5da950138..42e5140477 100644
--- a/core/Azure.Mcp.Core/src/Options/RetryOptionsExtensions.cs
+++ b/core/Azure.Mcp.Core/src/Options/RetryOptionsExtensions.cs
@@ -1,9 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
-using System;
-using System.Collections.Generic;
-using System.Text;
using Azure.Core;
using Microsoft.Mcp.Core.Options;
diff --git a/core/Azure.Mcp.Core/src/Services/Azure/BaseAzureResourceService.cs b/core/Azure.Mcp.Core/src/Services/Azure/BaseAzureResourceService.cs
index d68d8523d9..766cddaf01 100644
--- a/core/Azure.Mcp.Core/src/Services/Azure/BaseAzureResourceService.cs
+++ b/core/Azure.Mcp.Core/src/Services/Azure/BaseAzureResourceService.cs
@@ -156,7 +156,9 @@ protected async Task> ExecuteResourceQueryAsync(
/// The subscription ID or name
/// Optional retry policy configuration
/// Function to convert JsonElement to the target type
+ /// Optional table name to query (default: "resources")
/// Optional additional KQL filter condition
+ /// Optional tenant to use for the query
/// Cancellation token
/// Single resource converted to the specified type, or null if not found
protected async Task ExecuteSingleResourceQueryAsync(
@@ -183,6 +185,7 @@ protected async Task> ExecuteResourceQueryAsync(
/// The API version to set for the specified resource type.
/// Optional tenant to use when creating the client.
/// Optional retry policy used by token acquisition.
+ /// Cancellation token
/// An initialized configured with the requested API version.
protected async Task CreateArmClientWithApiVersionAsync(string resourceTypeForApiVersion, string apiVersion, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default)
{
@@ -224,6 +227,7 @@ protected static async Task GetGenericResourceAsync(ArmClient a
/// The Azure location for the resource.
/// The content to create or update the resource with.
/// The JSON type information for serialization.
+ /// Cancellation token
/// The instance for the requested resource.
/// Thrown when a required parameter is null.
/// Thrown when the content is invalid.
diff --git a/core/Azure.Mcp.Core/src/Services/Azure/BaseAzureService.cs b/core/Azure.Mcp.Core/src/Services/Azure/BaseAzureService.cs
index 7687afbf3e..46d02931c3 100644
--- a/core/Azure.Mcp.Core/src/Services/Azure/BaseAzureService.cs
+++ b/core/Azure.Mcp.Core/src/Services/Azure/BaseAzureService.cs
@@ -253,6 +253,8 @@ protected static T ConfigureRetryPolicy(T clientOptions, RetryPolicyOptions?
/// Optional Azure tenant ID or name.
/// Optional retry policy configuration.
/// Optional ARM client options.
+ /// Cancellation token.
+ /// An initialized instance.
protected async Task CreateArmClientAsync(
string? tenantIdOrName = null,
RetryPolicyOptions? retryPolicy = null,
diff --git a/core/Azure.Mcp.Core/src/Services/Azure/Tenant/ITenantService.cs b/core/Azure.Mcp.Core/src/Services/Azure/Tenant/ITenantService.cs
index 4d88d6a2ee..e0fa817618 100644
--- a/core/Azure.Mcp.Core/src/Services/Azure/Tenant/ITenantService.cs
+++ b/core/Azure.Mcp.Core/src/Services/Azure/Tenant/ITenantService.cs
@@ -31,7 +31,7 @@ public interface ITenantService
/// Gets the tenant ID from either a tenant ID or tenant name.
///
/// The tenant ID or tenant name.
- /// A cancellation token.
+ /// A cancellation token.
///
/// A task representing the asynchronous operation, with the tenant ID or
/// if not found.
@@ -40,7 +40,7 @@ public interface ITenantService
/// Thrown when a tenant with the specified name is not found.
///
///
- /// Thrown when the tenant has a TenantId.
+ /// Thrown when the tenant has a TenantId.
///
Task GetTenantId(string tenantIdOrName, CancellationToken cancellationToken);
@@ -48,7 +48,7 @@ public interface ITenantService
/// Gets the tenant ID by tenant name.
///
/// The tenant name.
- /// A cancellation token.
+ /// A cancellation token.
///
/// A task representing the asynchronous operation, with the tenant ID or
/// if not found.
@@ -57,7 +57,7 @@ public interface ITenantService
/// Thrown when a tenant with the specified name is not found.
///
///
- /// Thrown when the tenant has a TenantId.
+ /// Thrown when the tenant has a TenantId.
///
Task GetTenantIdByName(string tenantName, CancellationToken cancellationToken);
@@ -65,7 +65,7 @@ public interface ITenantService
/// Gets the tenant name by tenant ID.
///
/// The tenant ID.
- /// A cancellation token.
+ /// A cancellation token.
///
/// A task representing the asynchronous operation, with the tenant name or if not found.
///
@@ -73,7 +73,7 @@ public interface ITenantService
/// Thrown when a tenant with the specified ID is not found.
///
///
- /// Thrown when the tenant has a DisplayName.
+ /// Thrown when the tenant has a DisplayName.
///
Task GetTenantNameById(string tenantId, CancellationToken cancellationToken);
@@ -90,7 +90,7 @@ public interface ITenantService
/// Gets an instance of .
///
/// Optional tenant ID. Use in most cases.
- /// A cancellation token.
+ /// A cancellation token.
///
/// A task representing the asynchronous operation, with a value of .
///
diff --git a/core/Azure.Mcp.Core/src/Services/Azure/Tenant/TenantServiceCollectionExtensions.cs b/core/Azure.Mcp.Core/src/Services/Azure/Tenant/TenantServiceCollectionExtensions.cs
index 97679b84ff..05fb25c125 100644
--- a/core/Azure.Mcp.Core/src/Services/Azure/Tenant/TenantServiceCollectionExtensions.cs
+++ b/core/Azure.Mcp.Core/src/Services/Azure/Tenant/TenantServiceCollectionExtensions.cs
@@ -29,11 +29,12 @@ public static class TenantServiceCollectionExtensions
///
/// -
///
- /// via .
- /// This can be overridden using
- /// based on parsed command line arguments and environment variables.
+ /// via .
///
///
+ /// -
+ /// via .
+ ///
///
///
public static IServiceCollection AddAzureTenantService(this IServiceCollection services)
diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/AccessTokenHandlerTests.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/AccessTokenHandlerTests.cs
index 32911ea42a..9d993856b7 100644
--- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/AccessTokenHandlerTests.cs
+++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/AccessTokenHandlerTests.cs
@@ -4,6 +4,7 @@
using System.Net;
using System.Net.Http.Headers;
using Azure.Core;
+using Microsoft.Mcp.Core;
using Microsoft.Mcp.Core.Services.Azure.Authentication;
using NSubstitute;
using Xunit;
diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/Runtime/McpRuntimeTests.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/Runtime/McpRuntimeTests.cs
index 286f1cd9f5..461238d64f 100644
--- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/Runtime/McpRuntimeTests.cs
+++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/Runtime/McpRuntimeTests.cs
@@ -1,7 +1,7 @@
-#pragma warning disable MCP9003 // Obsolete RequestContext constructor - migrating during Phase 1
-#pragma warning disable MCP9005 // Deprecated Sampling/Logging APIs - backward compat during Phase 1
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
+#pragma warning disable MCP9003 // Obsolete RequestContext constructor - migrating during Phase 1
+#pragma warning disable MCP9005 // Deprecated Sampling/Logging APIs - backward compat during Phase 1
using System.Diagnostics;
using System.Text.Json;
diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ServiceCollectionExtensionsSerializedTests.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ServiceCollectionExtensionsSerializedTests.cs
index a4b6268f54..c429d3bbfb 100644
--- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ServiceCollectionExtensionsSerializedTests.cs
+++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ServiceCollectionExtensionsSerializedTests.cs
@@ -12,10 +12,6 @@
namespace Azure.Mcp.Core.Tests.Areas.Server.Commands;
-// This is intentionally placed after the namespace declaration to avoid
-// conflicts with Azure.Mcp.Core.Areas.Server.Options
-using Options = Microsoft.Extensions.Options.Options;
-
public class ServiceCollectionExtensionsSerializedTests
{
private static readonly Assembly s_testAssembly = typeof(ServiceCollectionExtensionsTests).Assembly;
@@ -65,7 +61,7 @@ public void InitializeConfigurationAndOptions_HttpTransport()
{
Transport = TransportTypes.Http,
};
- var services = SetupBaseServices().AddSingleton(Options.Create(serviceStartOptions));
+ var services = SetupBaseServices().AddSingleton(Microsoft.Extensions.Options.Options.Create(serviceStartOptions));
// Act
services.InitializeConfigurationAndOptions(s_serverAssembly);
@@ -121,7 +117,7 @@ public void InitializeConfigurationAndOptions_WithSupportLoggingFolder_DisablesT
{
SupportLoggingFolder = "/tmp/logs"
};
- var services = SetupBaseServices().AddSingleton(Options.Create(serviceStartOptions));
+ var services = SetupBaseServices().AddSingleton(Microsoft.Extensions.Options.Options.Create(serviceStartOptions));
// Act
Environment.SetEnvironmentVariable("AZURE_MCP_COLLECT_TELEMETRY", null);
@@ -145,7 +141,7 @@ public void InitializeConfigurationAndOptions_WithSupportLoggingFolderAndEnvVarT
{
SupportLoggingFolder = "/tmp/logs"
};
- var services = SetupBaseServices().AddSingleton(Options.Create(serviceStartOptions));
+ var services = SetupBaseServices().AddSingleton(Microsoft.Extensions.Options.Options.Create(serviceStartOptions));
// Act
Environment.SetEnvironmentVariable("AZURE_MCP_COLLECT_TELEMETRY", "true");
@@ -171,7 +167,7 @@ public void InitializeConfigurationAndOptions_WithEmptyOrWhitespaceSupportLoggin
{
SupportLoggingFolder = folderPath
};
- var services = SetupBaseServices().AddSingleton(Options.Create(serviceStartOptions));
+ var services = SetupBaseServices().AddSingleton(Microsoft.Extensions.Options.Options.Create(serviceStartOptions));
// Act
Environment.SetEnvironmentVariable("AZURE_MCP_COLLECT_TELEMETRY", null);
diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ToolLoading/NamespaceToolLoaderTests.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ToolLoading/NamespaceToolLoaderTests.cs
index 6337634a2e..a100c13fab 100644
--- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ToolLoading/NamespaceToolLoaderTests.cs
+++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ToolLoading/NamespaceToolLoaderTests.cs
@@ -1,8 +1,9 @@
-#pragma warning disable MCP9003 // Obsolete RequestContext constructor - migrating during Phase 1
-#pragma warning disable MCP9005 // Deprecated Sampling/Logging APIs - backward compat during Phase 1
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
+#pragma warning disable MCP9003 // Obsolete RequestContext constructor - migrating during Phase 1
+#pragma warning disable MCP9005 // Deprecated Sampling/Logging APIs - backward compat during Phase 1
+
using System.Text.Json;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
@@ -854,7 +855,7 @@ public async Task GetChildToolList_WithReadOnlyOption_ReturnsOnlyReadOnlyTools()
}
[Fact]
- public async Task GetChildToolList_WithIsHttpOption_DoesNotReturnLocalRequiredTools()
+ public void GetChildToolList_WithIsHttpOption_DoesNotReturnLocalRequiredTools()
{
// Arrange
var options = Microsoft.Extensions.Options.Options.Create(new ServiceStartOptions
diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Helpers/MockMcpClientBuilder.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Helpers/MockMcpClientBuilder.cs
index 5bf6256f23..b9a6e8fc25 100644
--- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Helpers/MockMcpClientBuilder.cs
+++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Helpers/MockMcpClientBuilder.cs
@@ -1,14 +1,13 @@
-#pragma warning disable MCP9003 // Obsolete RequestContext constructor - migrating during Phase 1
-#pragma warning disable MCP9005 // Deprecated Sampling/Logging APIs - backward compat during Phase 1
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
+#pragma warning disable MCP9003 // Obsolete RequestContext constructor - migrating during Phase 1
+#pragma warning disable MCP9005 // Deprecated Sampling/Logging APIs - backward compat during Phase 1
+
using System.Text.Json;
using Microsoft.Mcp.Core.Areas.Server;
using ModelContextProtocol.Client;
using ModelContextProtocol.Protocol;
-using NSubstitute;
-using Xunit;
namespace Azure.Mcp.Core.Tests.Areas.Server.Helpers;
diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Helpers/MockMcpDiscoveryStrategyBuilder.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Helpers/MockMcpDiscoveryStrategyBuilder.cs
index d9229b6171..7898bbf520 100644
--- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Helpers/MockMcpDiscoveryStrategyBuilder.cs
+++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Helpers/MockMcpDiscoveryStrategyBuilder.cs
@@ -25,6 +25,7 @@ public sealed class MockMcpDiscoveryStrategyBuilder
/// The display name of the server. If null, uses the serverId.
/// The description of the server. If null, uses a default description.
/// The mock client to return for this server.
+ /// Optional tool prefix for the server.
/// The current instance for method chaining.
public MockMcpDiscoveryStrategyBuilder AddServer(string serverId, string? serverName = null, string? description = null, McpClient? client = null, string? toolPrefix = null)
{
@@ -64,6 +65,7 @@ public MockMcpDiscoveryStrategyBuilder AddServer(string serverId, string? server
/// The display name of the server. If null, uses the serverId.
/// The description of the server. If null, uses a default description.
/// The MockMcpClientBuilder to use for creating the client.
+ /// Optional tool prefix for the server.
/// The current instance for method chaining.
public MockMcpDiscoveryStrategyBuilder AddServer(string serverId, string? serverName, string? description, MockMcpClientBuilder clientBuilder, string? toolPrefix = null)
{
diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/AssemblyAttributes.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/AssemblyAttributes.cs
index 69da1d7967..9068d23bfb 100644
--- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/AssemblyAttributes.cs
+++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/AssemblyAttributes.cs
@@ -1,2 +1,5 @@
-[assembly: Microsoft.Mcp.Tests.Helpers.ClearEnvironmentVariablesBeforeTest]
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+[assembly: Microsoft.Mcp.Tests.Helpers.ClearEnvironmentVariablesBeforeTest]
[assembly: Xunit.CollectionBehavior(Xunit.CollectionBehavior.CollectionPerAssembly)]
diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Client/MockClientTests.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Client/MockClientTests.cs
index 9db986c6ea..bb8310e396 100644
--- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Client/MockClientTests.cs
+++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Client/MockClientTests.cs
@@ -1,4 +1,4 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System.Text.Json;
diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Extensions/McpServerElicitationExtensionsTests.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Extensions/McpServerElicitationExtensionsTests.cs
index d3c44ec24b..23b4d1f18d 100644
--- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Extensions/McpServerElicitationExtensionsTests.cs
+++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Extensions/McpServerElicitationExtensionsTests.cs
@@ -72,7 +72,7 @@ public void ShouldTriggerElicitation_WithJsonObjectMetadata_ReturnsExpectedResul
JsonObject metadata = [new(McpHelper.SecretHintMetaKey, secretValue)];
// Act
- var result = server.ShouldTriggerElicitation("tool1", metadata);
+ var result = server.ShouldTriggerElicitation(metadata);
// Assert
Assert.Equal(expected, result);
@@ -85,7 +85,7 @@ public void ShouldTriggerElicitation_WithNullMetadata_ReturnsFalse()
var server = CreateMockServer();
// Act
- var result = server.ShouldTriggerElicitation("tool1", null);
+ var result = server.ShouldTriggerElicitation(null);
// Assert
Assert.False(result);
@@ -102,7 +102,7 @@ public void ShouldTriggerElicitation_WithNonJsonObjectMetadata_ReturnsFalse()
var metadata = new Dictionary { { "SecretHint", true } };
// Act
- var result = server.ShouldTriggerElicitation("tool1", metadata);
+ var result = server.ShouldTriggerElicitation(metadata);
// Assert
Assert.False(result);
@@ -118,7 +118,7 @@ public void ShouldTriggerElicitation_WithNonSupportingClient_ReturnsFalse()
JsonObject metadata = [new(McpHelper.SecretHintMetaKey, true)];
// Act
- var result = server.ShouldTriggerElicitation("tool1", metadata);
+ var result = server.ShouldTriggerElicitation(metadata);
// Assert
Assert.False(result);
@@ -138,7 +138,7 @@ public void ShouldTriggerElicitation_WithMissingSecretProperty_ReturnsFalse()
};
// Act
- var result = server.ShouldTriggerElicitation("tool1", metadata);
+ var result = server.ShouldTriggerElicitation(metadata);
// Assert
Assert.False(result);
@@ -155,7 +155,7 @@ public void ShouldTriggerElicitation_WithSecretPropertyButInvalidValue_ReturnsFa
JsonObject metadata = [new(McpHelper.SecretHintMetaKey, "not_a_boolean")];
// Act
- var result = server.ShouldTriggerElicitation("tool1", metadata);
+ var result = server.ShouldTriggerElicitation(metadata);
// Assert
Assert.False(result);
@@ -337,7 +337,7 @@ public void ShouldTriggerElicitation_WithDestructiveHint_ReturnsExpectedResult(b
};
// Act
- var result = server.ShouldTriggerElicitation("tool1", metadata);
+ var result = server.ShouldTriggerElicitation(metadata);
// Assert
Assert.Equal(expected, result);
@@ -357,7 +357,7 @@ public void ShouldTriggerElicitation_WithDestructiveHintButInvalidValue_ReturnsF
};
// Act
- var result = server.ShouldTriggerElicitation("tool1", metadata);
+ var result = server.ShouldTriggerElicitation(metadata);
// Assert
Assert.False(result);
@@ -377,7 +377,7 @@ public void ShouldTriggerElicitation_WithMissingDestructiveHint_ReturnsFalse()
};
// Act
- var result = server.ShouldTriggerElicitation("tool1", metadata);
+ var result = server.ShouldTriggerElicitation(metadata);
// Assert
Assert.False(result);
@@ -398,7 +398,7 @@ public void ShouldTriggerElicitation_WithBothSecretAndDestructiveTrue_ReturnsTru
];
// Act
- var result = server.ShouldTriggerElicitation("tool1", metadata);
+ var result = server.ShouldTriggerElicitation(metadata);
// Assert
Assert.True(result);
@@ -419,7 +419,7 @@ public void ShouldTriggerElicitation_WithSecretFalseAndDestructiveTrue_ReturnsTr
];
// Act
- var result = server.ShouldTriggerElicitation("tool1", metadata);
+ var result = server.ShouldTriggerElicitation(metadata);
// Assert
Assert.True(result);
@@ -440,7 +440,7 @@ public void ShouldTriggerElicitation_WithSecretFalseAndDestructiveFalse_ReturnsF
];
// Act
- var result = server.ShouldTriggerElicitation("tool1", metadata);
+ var result = server.ShouldTriggerElicitation(metadata);
// Assert
Assert.False(result);
@@ -459,7 +459,7 @@ public void ShouldTriggerElicitation_WithDestructiveHintAndNonSupportingClient_R
};
// Act
- var result = server.ShouldTriggerElicitation("tool1", metadata);
+ var result = server.ShouldTriggerElicitation(metadata);
// Assert
Assert.False(result);
@@ -509,7 +509,7 @@ public void ShouldTriggerElicitation_WithUrlCapabilityOnly_SecretMetadataControl
JsonObject metadata = [new(McpHelper.SecretHintMetaKey, secretValue)];
// Act
- var result = server.ShouldTriggerElicitation("tool1", metadata);
+ var result = server.ShouldTriggerElicitation(metadata);
// Assert
Assert.Equal(expected, result);
@@ -535,7 +535,7 @@ public void ShouldTriggerElicitation_WithUrlCapabilityAndMissingSecret_ReturnsFa
};
// Act
- var result = server.ShouldTriggerElicitation("tool1", metadata);
+ var result = server.ShouldTriggerElicitation(metadata);
// Assert
Assert.False(result);
@@ -583,7 +583,7 @@ public void ShouldTriggerElicitation_WithExplicitFormCapabilityAndSecretMetadata
JsonObject metadata = [new(McpHelper.SecretHintMetaKey, true)];
// Act
- var result = server.ShouldTriggerElicitation("tool1", metadata);
+ var result = server.ShouldTriggerElicitation(metadata);
// Assert
Assert.True(result);
@@ -606,7 +606,7 @@ public void ShouldTriggerElicitation_WithExplicitFormCapabilityAndSecretFalse_Re
JsonObject metadata = [new(McpHelper.SecretHintMetaKey, false)];
// Act
- var result = server.ShouldTriggerElicitation("tool1", metadata);
+ var result = server.ShouldTriggerElicitation(metadata);
// Assert
Assert.False(result);
@@ -632,7 +632,7 @@ public void ShouldTriggerElicitation_WithExplicitFormCapabilityAndNestedSecret_R
};
// Act
- var result = server.ShouldTriggerElicitation("tool1", metadata);
+ var result = server.ShouldTriggerElicitation(metadata);
// Assert
Assert.False(result);
diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/RecordingFramework/RecordedCommandTestHarness.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/RecordingFramework/RecordedCommandTestHarness.cs
index 46d5b9a506..ae51e665a0 100644
--- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/RecordingFramework/RecordedCommandTestHarness.cs
+++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/RecordingFramework/RecordedCommandTestHarness.cs
@@ -13,6 +13,7 @@ namespace Azure.Mcp.Core.Tests.RecordingFramework;
///
///
///
+///
internal sealed class RecordedCommandTestHarness(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture)
: RecordedCommandTestsBase(output, fixture, liveServerFixture)
{
diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Commands/SubscriptionCommandUnitTestsBase.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Commands/SubscriptionCommandUnitTestsBase.cs
index b19a265b70..56303c8951 100644
--- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Commands/SubscriptionCommandUnitTestsBase.cs
+++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Commands/SubscriptionCommandUnitTestsBase.cs
@@ -1,3 +1,6 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
using Azure.Mcp.Core.Services.Azure.Subscription;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Mcp.Core.Commands;
diff --git a/core/Microsoft.Mcp.Core/src/AccessTokenHandler.cs b/core/Microsoft.Mcp.Core/src/AccessTokenHandler.cs
index 5b6cda28d2..2fe4cc695a 100644
--- a/core/Microsoft.Mcp.Core/src/AccessTokenHandler.cs
+++ b/core/Microsoft.Mcp.Core/src/AccessTokenHandler.cs
@@ -5,7 +5,7 @@
using Azure.Core;
using Microsoft.Mcp.Core.Services.Azure.Authentication;
-namespace Azure.Mcp.Core;
+namespace Microsoft.Mcp.Core;
///
/// that adds a Bearer access token to each outgoing request.
diff --git a/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/Discovery/ConsolidatedToolDiscoveryStrategy.cs b/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/Discovery/ConsolidatedToolDiscoveryStrategy.cs
index 55ca753732..edc0e80b5e 100644
--- a/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/Discovery/ConsolidatedToolDiscoveryStrategy.cs
+++ b/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/Discovery/ConsolidatedToolDiscoveryStrategy.cs
@@ -17,6 +17,8 @@ namespace Microsoft.Mcp.Core.Areas.Server.Commands.Discovery;
/// This strategy converts Azure CLI command groups into MCP servers, allowing them to be accessed via the MCP protocol.
///
/// The command factory used to access available command groups.
+/// The service provider for dependency injection.
+/// The provider for consolidated tool definitions.
/// Options for configuring the service behavior.
/// Configuration options for the Azure MCP server.
/// Logger instance for this discovery strategy.
diff --git a/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/Discovery/ConsolidatedToolServerProvider.cs b/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/Discovery/ConsolidatedToolServerProvider.cs
index dc5cca2d56..4b96e6ef34 100644
--- a/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/Discovery/ConsolidatedToolServerProvider.cs
+++ b/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/Discovery/ConsolidatedToolServerProvider.cs
@@ -62,7 +62,7 @@ public async Task CreateClientAsync(McpClientOptions clientOptions, C
///
/// Builds the command-line arguments for the MCP server process.
- /// Pattern: server start --mode all (--tool )+ [--read-only]
+ /// Pattern: server start --mode all (--tool <qualifiedCommand>)+ [--read-only]
///
internal string[] BuildArguments()
{
diff --git a/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/Discovery/RegistryDiscoveryStrategy.cs b/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/Discovery/RegistryDiscoveryStrategy.cs
index 41eb4cb45a..0a613c951e 100644
--- a/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/Discovery/RegistryDiscoveryStrategy.cs
+++ b/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/Discovery/RegistryDiscoveryStrategy.cs
@@ -22,19 +22,19 @@ public sealed class RegistryDiscoveryStrategy(IOptions opti
private readonly IHttpClientFactory _httpClientFactory = httpClientFactory;
///
- public override async Task> DiscoverServersAsync(CancellationToken cancellationToken)
+ public override Task> DiscoverServersAsync(CancellationToken cancellationToken)
{
if (registryRoot?.Servers == null)
{
- return [];
+ return Task.FromResult>([]);
}
- return registryRoot
+ return Task.FromResult(registryRoot
.Servers
.Where(s => _options.Value.Namespace == null ||
_options.Value.Namespace.Length == 0 ||
_options.Value.Namespace.Contains(s.Key, StringComparer.OrdinalIgnoreCase))
.Select(s => new RegistryServerProvider(s.Key, s.Value, _httpClientFactory))
- .Cast();
+ .Cast());
}
}
diff --git a/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/Discovery/RegistryServerProvider.cs b/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/Discovery/RegistryServerProvider.cs
index bc91ae418d..aa54a059b8 100644
--- a/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/Discovery/RegistryServerProvider.cs
+++ b/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/Discovery/RegistryServerProvider.cs
@@ -32,7 +32,6 @@ namespace Microsoft.Mcp.Core.Areas.Server.Commands.Discovery;
/// The unique identifier for the server.
/// Configuration information for the server.
/// Factory for creating HTTP clients.
-/// The token credential provider for OAuth authentication.
public sealed class RegistryServerProvider(string id, RegistryServerInfo serverInfo, IHttpClientFactory httpClientFactory) : IMcpServerProvider
{
private readonly string _id = id;
diff --git a/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/OptionSchemaGenerator.cs b/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/OptionSchemaGenerator.cs
index 76a7e5d075..c4198e92fd 100644
--- a/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/OptionSchemaGenerator.cs
+++ b/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/OptionSchemaGenerator.cs
@@ -21,13 +21,7 @@ namespace Microsoft.Mcp.Core.Areas.Server.Commands;
/// into build errors. Option value types come from System.CommandLine as
/// runtime values, so this helper has to use
/// and
-/// , both annotated. The
-/// attributes below are used
-/// because this class uses the exporter only to read schema metadata (no
-/// (de)serialization, no enum materialization), and because the actual option
-/// types in use are primitives, enums, , nullables of those,
-/// and arrays of those, which the default resolver handles without trimming or
-/// dynamic-codegen concerns.
+/// , both annotated.
///
internal static class OptionSchemaGenerator
{
diff --git a/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/Runtime/McpRuntime.cs b/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/Runtime/McpRuntime.cs
index 05c9dbb480..c19d831ec8 100644
--- a/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/Runtime/McpRuntime.cs
+++ b/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/Runtime/McpRuntime.cs
@@ -34,6 +34,7 @@ public sealed class McpRuntime : IMcpRuntime
///
/// The tool loader responsible for discovering and loading tools.
/// Configuration options for the MCP server.
+ /// Telemetry service for logging and monitoring.
/// Logger for runtime operations.
/// Thrown if any required dependencies are null.
public McpRuntime(
diff --git a/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ServiceCollectionExtensions.cs b/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ServiceCollectionExtensions.cs
index 1b95d471bf..a56501305d 100644
--- a/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ServiceCollectionExtensions.cs
+++ b/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ServiceCollectionExtensions.cs
@@ -20,10 +20,6 @@
namespace Microsoft.Mcp.Core.Areas.Server.Commands;
-// This is intentionally placed after the namespace declaration to avoid
-// conflicts with Microsoft.Mcp.Core.Areas.Server.Options
-using Options = Microsoft.Extensions.Options.Options;
-
///
/// Extension methods for configuring Azure MCP server services.
///
@@ -45,7 +41,7 @@ public static IServiceCollection AddAzureMcpServer(this IServiceCollection servi
// Register options for service start
services.AddSingleton(serviceStartOptions);
- services.AddSingleton(Options.Create(serviceStartOptions));
+ services.AddSingleton(Microsoft.Extensions.Options.Options.Create(serviceStartOptions));
// Register default tool loader options from service start options
var defaultToolLoaderOptions = new ToolLoaderOptions
@@ -66,7 +62,7 @@ public static IServiceCollection AddAzureMcpServer(this IServiceCollection servi
}
services.AddSingleton(defaultToolLoaderOptions);
- services.AddSingleton(Options.Create(defaultToolLoaderOptions));
+ services.AddSingleton(Microsoft.Extensions.Options.Options.Create(defaultToolLoaderOptions));
// Register tool loader strategies
services.AddSingleton();
@@ -155,7 +151,7 @@ public static IServiceCollection AddAzureMcpServer(this IServiceCollection servi
toolLoaders.Add(new CommandFactoryToolLoader(
sp,
sp.GetRequiredService(),
- Options.Create(utilityToolLoaderOptions),
+ Microsoft.Extensions.Options.Options.Create(utilityToolLoaderOptions),
loggerFactory.CreateLogger()
));
diff --git a/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ServiceStartCommand.cs b/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ServiceStartCommand.cs
index 2877ea5f5f..7f6e69568e 100644
--- a/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ServiceStartCommand.cs
+++ b/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ServiceStartCommand.cs
@@ -174,6 +174,7 @@ protected override ServiceStartOptions BindOptions(ParseResult parseResult)
///
/// The command execution context.
/// The parsed command options.
+ /// A token to monitor for cancellation requests.
/// A command response indicating the result of the operation.
public override async Task ExecuteAsync(CommandContext context, ParseResult parseResult, CancellationToken cancellationToken)
{
diff --git a/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ToolLoading/IToolLoader.cs b/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ToolLoading/IToolLoader.cs
index 475ce8a80e..19e8e5fd15 100644
--- a/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ToolLoading/IToolLoader.cs
+++ b/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ToolLoading/IToolLoader.cs
@@ -22,7 +22,7 @@ public interface IToolLoader : IAsyncDisposable
///
/// Handles requests to call a specific tool with the provided parameters. If an error occurs while calling the
/// tool, loaders should return a where the contents are details of the exception.
- ///
+ ///
/// The request context containing the tool name and parameters.
/// A token to monitor for cancellation requests.
/// A result containing the output of the tool invocation.
diff --git a/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ToolLoading/ServerToolLoader.cs b/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ToolLoading/ServerToolLoader.cs
index c263cc6f96..57f2f286b2 100644
--- a/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ToolLoading/ServerToolLoader.cs
+++ b/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ToolLoading/ServerToolLoader.cs
@@ -413,6 +413,7 @@ private async Task InvokeToolLearn(RequestContext
///
///
+ ///
///
internal async Task> GetAllChildToolsAsync(RequestContext request, string tool, CancellationToken cancellationToken)
{
diff --git a/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ToolLoading/SingleProxyToolLoader.cs b/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ToolLoading/SingleProxyToolLoader.cs
index 09713d7380..27bbd94329 100644
--- a/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ToolLoading/SingleProxyToolLoader.cs
+++ b/core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ToolLoading/SingleProxyToolLoader.cs
@@ -203,10 +203,11 @@ private async Task GetRootToolsJsonAsync(CancellationToken cancellationT
}
///
- /// Gets the set of within an .
+ /// Gets the set of within an .
///
/// Calling request
/// Name of the to get commands for.
+ /// Cancellation token
/// JSON serialized string representing the list of commands available in the tool's area.
private async Task GetToolListJsonAsync(RequestContext request, string tool, CancellationToken cancellationToken)
{
diff --git a/core/Microsoft.Mcp.Core/src/Areas/Server/RegistryServerServiceCollectionExtensions.cs b/core/Microsoft.Mcp.Core/src/Areas/Server/RegistryServerServiceCollectionExtensions.cs
index 7a14be16f0..14f0b1944e 100644
--- a/core/Microsoft.Mcp.Core/src/Areas/Server/RegistryServerServiceCollectionExtensions.cs
+++ b/core/Microsoft.Mcp.Core/src/Areas/Server/RegistryServerServiceCollectionExtensions.cs
@@ -2,7 +2,6 @@
// Licensed under the MIT License.
using System.Reflection;
-using Azure.Mcp.Core;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Mcp.Core.Areas.Server.Models;
using Microsoft.Mcp.Core.Helpers;
diff --git a/core/Microsoft.Mcp.Core/src/Areas/Server/ServerJsonContext.cs b/core/Microsoft.Mcp.Core/src/Areas/Server/ServerJsonContext.cs
index 59b07548f7..5be71d49eb 100644
--- a/core/Microsoft.Mcp.Core/src/Areas/Server/ServerJsonContext.cs
+++ b/core/Microsoft.Mcp.Core/src/Areas/Server/ServerJsonContext.cs
@@ -6,7 +6,6 @@
using Microsoft.Mcp.Core.Areas.Server.Models;
using Microsoft.Mcp.Core.Commands;
using Microsoft.Mcp.Core.Models.Metadata;
-using ModelContextProtocol.Client;
using ModelContextProtocol.Protocol;
namespace Microsoft.Mcp.Core.Areas.Server;
@@ -25,8 +24,6 @@ namespace Microsoft.Mcp.Core.Areas.Server;
[JsonSerializable(typeof(List))]
[JsonSourceGenerationOptions(
PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase,
- DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull
+ DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
)]
-internal sealed partial class ServerJsonContext : JsonSerializerContext
-{
-}
+internal sealed partial class ServerJsonContext : JsonSerializerContext;
diff --git a/core/Microsoft.Mcp.Core/src/Areas/Server/ServerSetup.cs b/core/Microsoft.Mcp.Core/src/Areas/Server/ServerSetup.cs
index 865b7991e0..de9f67d2c7 100644
--- a/core/Microsoft.Mcp.Core/src/Areas/Server/ServerSetup.cs
+++ b/core/Microsoft.Mcp.Core/src/Areas/Server/ServerSetup.cs
@@ -32,8 +32,8 @@ public void ConfigureServices(IServiceCollection services)
///
/// Registers command groups and commands related to MCP Server operations.
///
- /// The root command group to add server commands to.
- /// The logger factory for creating loggers.
+ /// The service provider used to resolve command instances.
+ /// A CommandGroup containing all registered commands for the Server area.
public CommandGroup RegisterCommands(IServiceProvider serviceProvider)
{
// Create MCP Server command group
diff --git a/core/Microsoft.Mcp.Core/src/Commands/CommandFactory.cs b/core/Microsoft.Mcp.Core/src/Commands/CommandFactory.cs
index af052ef3fa..3ba14ebce3 100644
--- a/core/Microsoft.Mcp.Core/src/Commands/CommandFactory.cs
+++ b/core/Microsoft.Mcp.Core/src/Commands/CommandFactory.cs
@@ -42,7 +42,7 @@ public class CommandFactory : ICommandFactory
/// Creates a fresh for --learn each time it is called.
/// A new instance is required per command because System.CommandLine v2 tracks option
/// ownership by object identity; sharing a single static instance causes
- /// to return the default value on every command
+ /// to return the default value on every command
/// except the last one the option was added to.
///
private static Option CreateLearnOption()
diff --git a/core/Microsoft.Mcp.Core/src/Commands/ICommandFactory.cs b/core/Microsoft.Mcp.Core/src/Commands/ICommandFactory.cs
index 4d2d40903a..cdbfa449a5 100644
--- a/core/Microsoft.Mcp.Core/src/Commands/ICommandFactory.cs
+++ b/core/Microsoft.Mcp.Core/src/Commands/ICommandFactory.cs
@@ -1,6 +1,8 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
+using Microsoft.Mcp.Core.Models.Command;
+
namespace Microsoft.Mcp.Core.Commands;
public interface ICommandFactory
diff --git a/core/Microsoft.Mcp.Core/src/Extensions/ActivityExtensions.cs b/core/Microsoft.Mcp.Core/src/Extensions/ActivityExtensions.cs
index c28a314df7..431ea3022c 100644
--- a/core/Microsoft.Mcp.Core/src/Extensions/ActivityExtensions.cs
+++ b/core/Microsoft.Mcp.Core/src/Extensions/ActivityExtensions.cs
@@ -10,6 +10,7 @@ public static class ActivityExtensions
///
/// Sets a tag in the activity if, and only if, the tag does not already exist.
///
+ /// The activity to set the tag on.
/// The name of the tag.
/// The value of the tag.
public static Activity SetTagIfNotExists(this Activity? activity, string name, object? value)
diff --git a/core/Microsoft.Mcp.Core/src/Extensions/McpServerElicitationExtensions.cs b/core/Microsoft.Mcp.Core/src/Extensions/McpServerElicitationExtensions.cs
index 34e7b10a55..d9862adb30 100644
--- a/core/Microsoft.Mcp.Core/src/Extensions/McpServerElicitationExtensions.cs
+++ b/core/Microsoft.Mcp.Core/src/Extensions/McpServerElicitationExtensions.cs
@@ -203,10 +203,9 @@ public static bool SupportsElicitation(this McpServer server)
/// Checks if elicitation should be triggered for a tool based on its metadata.
///
/// The MCP server instance.
- /// The name of the tool.
/// The tool metadata to check.
/// True if elicitation should be triggered, false otherwise.
- public static bool ShouldTriggerElicitation(this McpServer server, string toolName, object? toolMetadata)
+ public static bool ShouldTriggerElicitation(this McpServer server, object? toolMetadata)
{
if (!server.SupportsElicitation())
{
diff --git a/core/Microsoft.Mcp.Core/src/Extensions/OpenTelemetryExtensions.cs b/core/Microsoft.Mcp.Core/src/Extensions/OpenTelemetryExtensions.cs
index a3a9dd06a7..94bbc918bd 100644
--- a/core/Microsoft.Mcp.Core/src/Extensions/OpenTelemetryExtensions.cs
+++ b/core/Microsoft.Mcp.Core/src/Extensions/OpenTelemetryExtensions.cs
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
+using System.Diagnostics;
using System.Reflection;
using System.Runtime.InteropServices;
using Azure.Monitor.OpenTelemetry.Exporter;
@@ -93,19 +94,8 @@ private static void EnableAzureMonitor(this IServiceCollection services)
ConfigureUserProvidedAzureMonitorExporter(otelBuilder, userProvidedAppInsightsConnectionString);
}
- // Configure Microsoft-owned telemetry only in RELEASE builds to avoid polluting telemetry during development.
-#if RELEASE
- // This environment variable can be used to disable Microsoft telemetry collection.
- // By default, Microsoft telemetry is enabled.
- var microsoftTelemetry = Environment.GetEnvironmentVariable("AZURE_MCP_COLLECT_TELEMETRY_MICROSOFT");
-
- bool shouldCollectMicrosoftTelemetry = string.IsNullOrWhiteSpace(microsoftTelemetry) || (bool.TryParse(microsoftTelemetry, out var shouldCollect) && shouldCollect);
-
- if (shouldCollectMicrosoftTelemetry)
- {
- ConfigureMicrosoftAzureMonitorExporter(otelBuilder, MicrosoftOwnedAppInsightsConnectionString);
- }
-#endif
+ // Configure Microsoft-owned telemetry.
+ ConfigureMicrosoftAzureMonitorExporter(otelBuilder, MicrosoftOwnedAppInsightsConnectionString);
var enableOtlp = Environment.GetEnvironmentVariable("AZURE_MCP_ENABLE_OTLP_EXPORTER");
if (!string.IsNullOrEmpty(enableOtlp) && bool.TryParse(enableOtlp, out var shouldEnable) && shouldEnable)
@@ -130,8 +120,19 @@ private static void EnableAzureMonitor(this IServiceCollection services)
///
/// The OpenTelemetry builder to configure.
/// The Application Insights connection string for Microsoft's telemetry instance.
+ [Conditional("RELEASE")]
private static void ConfigureMicrosoftAzureMonitorExporter(OpenTelemetry.OpenTelemetryBuilder otelBuilder, string appInsightsConnectionString)
{
+ // This environment variable can be used to disable Microsoft telemetry collection.
+ // By default, Microsoft telemetry is enabled.
+ var microsoftTelemetry = Environment.GetEnvironmentVariable("AZURE_MCP_COLLECT_TELEMETRY_MICROSOFT");
+
+ bool shouldCollectMicrosoftTelemetry = string.IsNullOrWhiteSpace(microsoftTelemetry) || (bool.TryParse(microsoftTelemetry, out var shouldCollect) && shouldCollect);
+ if (!shouldCollectMicrosoftTelemetry)
+ {
+ return;
+ }
+
// We don't configure logging for Microsoft telemetry to avoid sending potentially sensitive log data to Microsoft.
otelBuilder.WithMetrics(metrics =>
{
diff --git a/core/Microsoft.Mcp.Core/src/Helpers/McpHelper.cs b/core/Microsoft.Mcp.Core/src/Helpers/McpHelper.cs
index 850fab46a9..89a8f69d73 100644
--- a/core/Microsoft.Mcp.Core/src/Helpers/McpHelper.cs
+++ b/core/Microsoft.Mcp.Core/src/Helpers/McpHelper.cs
@@ -27,6 +27,7 @@ public static class McpHelper
/// Determines whether the tool has the hint in its metadata and is true.
///
/// The tool to check its metadata for the hint.
+ /// The key of the hint to check in the tool's metadata.
/// True if the hint was found, successfully extracted, and is true; otherwise, false.
public static bool HasHint(Tool tool, string hintKey)
=> tool.Meta != null && tool.Meta.TryGetPropertyValue(hintKey, out var hintNode)
diff --git a/core/Microsoft.Mcp.Core/src/Helpers/OptionParsingHelpers.cs b/core/Microsoft.Mcp.Core/src/Helpers/OptionParsingHelpers.cs
index 0cf4b7e3e0..32bee83639 100644
--- a/core/Microsoft.Mcp.Core/src/Helpers/OptionParsingHelpers.cs
+++ b/core/Microsoft.Mcp.Core/src/Helpers/OptionParsingHelpers.cs
@@ -10,6 +10,8 @@ public static class OptionParsingHelpers
/// If duplicate keys are found, the last value wins.
///
/// Value string containing key-value pairs
+ /// The character that separates keys from values in the input string.
+ /// The character that separates key-value pairs in the input string.
/// Key Value pairs as dictionary
public static Dictionary ParseKeyValuePairStringToDictionary(string value, char keyValueSeparator = '=', char pairSeparator = ',')
{
@@ -20,7 +22,12 @@ public static Dictionary ParseKeyValuePairStringToDictionary(str
/// Parses key value pair string options to a dictionary, assuming a format of "Key=Value,Key=Value" (default separators '=' and ',')
/// If duplicate keys are found, the last value wins.
///
- /// Value string containing key-value pairs
+ /// Value string containing key-value pairs
+ /// The string comparer to use for comparing keys in the resulting dictionary.
+ /// The character that separates keys from values in the input string.
+ /// The character that separates key-value pairs in the input string.
+ /// Thrown when the input value string is null, empty, or consists only of whitespace.
+ /// Thrown when the keyComparer is null.
/// Key Value pairs as dictionary
public static Dictionary ParseKeyValuePairStringToDictionary(string value, StringComparer keyComparer, char keyValueSeparator = '=', char pairSeparator = ',')
{
diff --git a/core/Microsoft.Mcp.Core/src/Models/Command/CommandContext.cs b/core/Microsoft.Mcp.Core/src/Models/Command/CommandContext.cs
index 210d66949e..1d0ba1b08b 100644
--- a/core/Microsoft.Mcp.Core/src/Models/Command/CommandContext.cs
+++ b/core/Microsoft.Mcp.Core/src/Models/Command/CommandContext.cs
@@ -5,7 +5,6 @@
using System.Net;
using Microsoft.Extensions.DependencyInjection;
using ModelContextProtocol.Protocol;
-using ModelContextProtocol.Server;
namespace Microsoft.Mcp.Core.Models.Command;
@@ -37,7 +36,7 @@ public class CommandContext
/// so will be on every request.
/// Per-request client identity is instead available via
/// _meta["io.modelcontextprotocol/clientInfo"] — see
- /// . The McpServer
+ /// . The McpServer
/// reference itself is still populated by the tool loaders on every request.
///
///
@@ -54,6 +53,7 @@ public class CommandContext
/// Creates a new command context
///
/// The service provider for dependency injection
+ /// Optional telemetry activity for the command execution
public CommandContext(IServiceProvider serviceProvider, Activity? activity = default)
{
_serviceProvider = serviceProvider;
diff --git a/core/Microsoft.Mcp.Core/src/Services/Azure/Authentication/IAzureTokenCredentialProvider.cs b/core/Microsoft.Mcp.Core/src/Services/Azure/Authentication/IAzureTokenCredentialProvider.cs
index 4b3ec80964..4696dd0bb2 100644
--- a/core/Microsoft.Mcp.Core/src/Services/Azure/Authentication/IAzureTokenCredentialProvider.cs
+++ b/core/Microsoft.Mcp.Core/src/Services/Azure/Authentication/IAzureTokenCredentialProvider.cs
@@ -14,8 +14,7 @@ namespace Microsoft.Mcp.Core.Services.Azure.Authentication;
///
///
///
-/// Callers can either directly depend on this interface or indirectly depend on it through
-/// .
+/// Callers can either directly depend on this interface or indirectly depend on it through ITenantService.
///
///
/// Implementors of this interface are responsible for generating, caching, and retrieving tokens
diff --git a/core/Microsoft.Mcp.Core/src/Services/Caching/HttpServiceCacheService.cs b/core/Microsoft.Mcp.Core/src/Services/Caching/HttpServiceCacheService.cs
index 59816d5091..6b95c6a6c7 100644
--- a/core/Microsoft.Mcp.Core/src/Services/Caching/HttpServiceCacheService.cs
+++ b/core/Microsoft.Mcp.Core/src/Services/Caching/HttpServiceCacheService.cs
@@ -6,7 +6,6 @@ namespace Microsoft.Mcp.Core.Services.Caching;
///
/// An implementation of for multi-user web API scenarios.
///
-/// A memory cache.
///
///
/// Do not instantiate directly. Use .
diff --git a/core/Microsoft.Mcp.Core/src/Services/ProcessExecution/ExternalProcessService.cs b/core/Microsoft.Mcp.Core/src/Services/ProcessExecution/ExternalProcessService.cs
index dc808ecd01..cbaa6fb45a 100644
--- a/core/Microsoft.Mcp.Core/src/Services/ProcessExecution/ExternalProcessService.cs
+++ b/core/Microsoft.Mcp.Core/src/Services/ProcessExecution/ExternalProcessService.cs
@@ -360,7 +360,7 @@ private void HandleCancellation(Process process, string executablePath, string a
///
/// Reads either stdout or stderr from a asynchronously.
/// Handlers are attached in the constructor, and reading begins when
- /// is called after the process has started.
+ /// is called after the process has started.
///
///
///
@@ -370,7 +370,7 @@ private void HandleCancellation(Process process, string executablePath, string a
/// - Create and configure the with redirected streams.
/// - Construct (handlers attach immediately).
/// - Start the process.
- /// - Call to begin event-driven reading.
+ /// - Call to begin event-driven reading.
/// - Await the returned task to obtain the full stream content.
///
///
@@ -401,8 +401,8 @@ private sealed class ProcessStreamReader : IDisposable
public ProcessStreamReader(Process process, bool isErrorStream, ILogger logger)
{
- this._process = process ?? throw new ArgumentNullException(nameof(process));
- this._isErrorStream = isErrorStream;
+ _process = process ?? throw new ArgumentNullException(nameof(process));
+ _isErrorStream = isErrorStream;
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
_handler = (_, e) =>
@@ -430,7 +430,7 @@ public ProcessStreamReader(Process process, bool isErrorStream, ILogger
/// Begins asynchronous reading of the associated stream.
- /// Must be called only after has successfully completed.
+ /// Must be called only after has successfully completed.
///
///
/// This method does not accept a because the underlying
@@ -581,7 +581,7 @@ public static string SafeName(this Process process)
/// The process to check.
/// Logger for diagnostic messages.
///
- /// An indicating:
+ /// An indicating:
///
/// - with null exception if the process has exited.
/// - with null exception if the process has not exited.
@@ -603,9 +603,9 @@ public static ExitCheckResult CheckExitState(this Process process, ILogger logge
{
// Official docs: "No process is associated with this object." - treat as "already gone".
logger.LogDebug(
- checkException,
- "Process.HasExited reported no associated process. Treating as already exited. " +
- "Process: {ProcessName}, PID: {Pid}", process.SafeName(), process.SafeId());
+ checkException,
+ "Process.HasExited reported no associated process. Treating as already exited. " +
+ "Process: {ProcessName}, PID: {Pid}", process.SafeName(), process.SafeId());
return new ExitCheckResult(ExitStatus.Exited, CheckException: null);
}
catch (System.ComponentModel.Win32Exception checkException)
diff --git a/core/Microsoft.Mcp.Core/src/Services/Telemetry/UnixMachineInformationProvider.cs b/core/Microsoft.Mcp.Core/src/Services/Telemetry/UnixMachineInformationProvider.cs
index 819145eabb..868a266b8e 100644
--- a/core/Microsoft.Mcp.Core/src/Services/Telemetry/UnixMachineInformationProvider.cs
+++ b/core/Microsoft.Mcp.Core/src/Services/Telemetry/UnixMachineInformationProvider.cs
@@ -56,7 +56,7 @@ internal abstract class UnixMachineInformationProvider(ILoggerThe value to write in the file.
/// True, if the value was successfully written.
///
- public async virtual Task WriteValueToDisk(string directoryPath, string fileName, string? value)
+ public virtual async Task WriteValueToDisk(string directoryPath, string fileName, string? value)
{
// If the value is not set, return immediately.
if (string.IsNullOrWhiteSpace(value))
@@ -91,10 +91,10 @@ public async virtual Task WriteValueToDisk(string directoryPath, string fi
}
///
- /// Try and read the value from disk. If is null or empty, this method will return false.
+ /// Try and read the value from disk.
///
/// Returns a value if the value could be written on disk. Otherwise, false.
- public async virtual Task ReadValueFromDisk(string directoryPath, string fileName)
+ public virtual async Task ReadValueFromDisk(string directoryPath, string fileName)
{
var path = Path.Combine(directoryPath, fileName);
diff --git a/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/CommandTestsBase.cs b/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/CommandTestsBase.cs
index 9ad8c49e0e..7682a047de 100644
--- a/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/CommandTestsBase.cs
+++ b/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/CommandTestsBase.cs
@@ -5,6 +5,7 @@
using System.Text;
using System.Text.Json;
using System.Text.Json.Nodes;
+using Microsoft.Mcp.Core.Models.Command;
using Microsoft.Mcp.Tests.Attributes;
using Microsoft.Mcp.Tests.Client.Helpers;
using Microsoft.Mcp.Tests.Helpers;
diff --git a/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/Helpers/BinaryContentHelper.cs b/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/Helpers/BinaryContentHelper.cs
index 7c9c27568d..32954b341d 100644
--- a/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/Helpers/BinaryContentHelper.cs
+++ b/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/Helpers/BinaryContentHelper.cs
@@ -18,7 +18,7 @@ internal static class BinaryContentHelper
///
/// Serialize object to JSON UTF8 bytes and wrap into BinaryContent via BinaryData factory.
- /// Avoid generic Create which expects IPersistableModel.
+ /// Avoid generic Create<T> which expects IPersistableModel.
///
public static BinaryContent FromObject(T value, JsonSerializerOptions? jsonOptions = null)
{
diff --git a/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/Helpers/CustomTestTransport.cs b/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/Helpers/CustomTestTransport.cs
index 3b6cddc90c..2682dee81b 100644
--- a/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/Helpers/CustomTestTransport.cs
+++ b/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/Helpers/CustomTestTransport.cs
@@ -1,4 +1,4 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System.Threading.Channels;
diff --git a/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/Helpers/McpTestUtilities.cs b/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/Helpers/McpTestUtilities.cs
index 426774393b..6ee2197d69 100644
--- a/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/Helpers/McpTestUtilities.cs
+++ b/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/Helpers/McpTestUtilities.cs
@@ -51,6 +51,7 @@ public static string GetAzMcpExecutablePath()
/// Optional test output helper for logging.
/// Optional NPM test package name for STDIO mode.
/// Optional settings directory for NPM test package.
+ /// Whether to disable authentication for the MCP client.
/// A tuple containing the initialized MCP client and optional server URL (for HTTP transport).
public static async Task<(McpClient? Client, string? ServerUrl)> CreateMcpClientAsync(
string executablePath,
@@ -119,6 +120,7 @@ public static string GetAzMcpExecutablePath()
/// Environment variables to set for the server process.
/// Callback to store the started process instance.
/// Optional test output helper for logging.
+ /// Whether to disable authentication for the HTTP server.
/// The server URL.
private static async Task StartHttpServerAsync(
string executablePath,
@@ -310,12 +312,14 @@ public static async Task WaitForServerReadinessAsync(
/// Command-line arguments for the server process.
/// Environment variables to set for the server process.
/// Optional test output helper for logging.
+ /// Whether to disable authentication for the HTTP server.
/// The started Process instance.
public static Process StartHttpServerProcess(
string executablePath,
List processArguments,
Dictionary environmentVariables,
- ITestOutputHelper? output = null, bool disableAuthentication = true)
+ ITestOutputHelper? output = null,
+ bool disableAuthentication = true)
{
processArguments.AddRange(["--transport", "http", "--outgoing-auth-strategy", "UseHostingEnvironmentIdentity"]);
if (disableAuthentication)
diff --git a/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/Helpers/RecordingPathResolver.cs b/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/Helpers/RecordingPathResolver.cs
index f922c1798f..23ef2e9748 100644
--- a/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/Helpers/RecordingPathResolver.cs
+++ b/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/Helpers/RecordingPathResolver.cs
@@ -50,7 +50,7 @@ public static string Sanitize(string name)
}
///
- /// Builds the session directory path: /SessionRecords/
+ /// Builds the session directory path: <relative path to test project>/SessionRecords/<TestClassName or variant>
/// Example: tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/SessionRecords/RecordedKeyVaultCommandTests
///
public string GetSessionDirectory(Type testType, string? variantSuffix = null)
diff --git a/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/LiveServerFixture.cs b/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/LiveServerFixture.cs
index 4d29f6f445..550dc48d6c 100644
--- a/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/LiveServerFixture.cs
+++ b/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/LiveServerFixture.cs
@@ -13,7 +13,6 @@ public sealed class LiveServerFixture() : IAsyncLifetime
private readonly SemaphoreSlim _startLock = new(1, 1);
private Process? _httpServerProcess;
private McpClient? _mcpClient;
- private string? _serverUrl;
private bool _started;
public Dictionary EnvironmentVariables { get; set; } = new();
@@ -49,7 +48,6 @@ public async Task EnsureStartedAsync()
Settings?.SettingsDirectory);
_mcpClient = client;
- _serverUrl = serverUrl;
_started = true;
}
finally
diff --git a/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/TestProxy.cs b/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/TestProxy.cs
index 48859f3f71..21611957fd 100644
--- a/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/TestProxy.cs
+++ b/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Client/TestProxy.cs
@@ -16,9 +16,8 @@ namespace Microsoft.Mcp.Tests.Client;
/// This version intentionally avoids dependencies on prior internal abstractions that were missing
/// (e.g. TestEnvironment / ProcessTracker) while still providing stderr/stdout capture for failed tests.
///
-public sealed class TestProxy(bool debug = false) : IDisposable
+public sealed class TestProxy() : IDisposable
{
- private readonly bool _debug = debug;
public StringBuilder stderr = new();
public readonly StringBuilder stdout = new();
private Process? _process;
@@ -46,7 +45,7 @@ public sealed class TestProxy(bool debug = false) : IDisposable
///
private static readonly SemaphoreSlim s_downloadLock = new(1, 1);
- private async Task EnsureProxyExecutableAsync(string repositoryRoot, string assetsJsonPath)
+ private async Task EnsureProxyExecutableAsync()
{
if (_cachedExecutable != null)
{
@@ -330,7 +329,7 @@ public async Task Start(string repositoryRoot, string assetsJsonPath)
return;
}
- var proxyExe = await EnsureProxyExecutableAsync(repositoryRoot, assetsJsonPath).ConfigureAwait(false);
+ var proxyExe = await EnsureProxyExecutableAsync().ConfigureAwait(false);
await EnsureProxyRecordings(proxyExe, repositoryRoot, assetsJsonPath).ConfigureAwait(false);
if (string.IsNullOrWhiteSpace(proxyExe) || !File.Exists(proxyExe))
diff --git a/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Generated/MicrosoftClientModelTestFrameworkModelFactory.cs b/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Generated/MicrosoftClientModelTestFrameworkModelFactory.cs
index e7d375a75b..28d484aaf0 100644
--- a/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Generated/MicrosoftClientModelTestFrameworkModelFactory.cs
+++ b/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Generated/MicrosoftClientModelTestFrameworkModelFactory.cs
@@ -1,6 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
+#pragma warning disable CS1574
+
//
#nullable disable
diff --git a/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Helpers/ClearEnvironmentVariablesBeforeTestAttribute.cs b/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Helpers/ClearEnvironmentVariablesBeforeTestAttribute.cs
index 879c058dd0..750dd03c13 100644
--- a/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Helpers/ClearEnvironmentVariablesBeforeTestAttribute.cs
+++ b/core/Microsoft.Mcp.Core/tests/Microsoft.Mcp.Tests/Helpers/ClearEnvironmentVariablesBeforeTestAttribute.cs
@@ -4,18 +4,18 @@
using System.Reflection;
using Xunit.v3;
-namespace Microsoft.Mcp.Tests.Helpers
+namespace Microsoft.Mcp.Tests.Helpers;
+
+///
+/// Xunit attribute to clear known environment variables before each test is run.
+/// Live tests should not use this attribute, as they may need environment variables to configure authentication and proxy.
+///
+public class ClearEnvironmentVariablesBeforeTestAttribute : BeforeAfterTestAttribute
{
- ///
- /// Xunit attribute to clear known environment variables before each test is run.
- /// Live tests should not use this attribute, as they may need environment variables to configure authentication and proxy.
- ///
- public class ClearEnvironmentVariablesBeforeTestAttribute : BeforeAfterTestAttribute
- {
- // These are all the known environment variables that our server may use.
- // Proper test initialization should clear all of these, then set only the ones needed for the test.
- private static readonly List _variablesToClear = [
- "ALL_PROXY",
+ // These are all the known environment variables that our server may use.
+ // Proper test initialization should clear all of these, then set only the ones needed for the test.
+ private static readonly List _variablesToClear = [
+ "ALL_PROXY",
"ALLOW_INSECURE_EXTERNAL_BINDING",
"APPLICATIONINSIGHTS_CONNECTION_STRING",
"ASPNETCORE_URLS",
@@ -34,12 +34,11 @@ public class ClearEnvironmentVariablesBeforeTestAttribute : BeforeAfterTestAttri
"NO_PROXY",
];
- public override void Before(MethodInfo methodUnderTest, IXunitTest test)
+ public override void Before(MethodInfo methodUnderTest, IXunitTest test)
+ {
+ foreach (var envVar in _variablesToClear)
{
- foreach (var envVar in _variablesToClear)
- {
- Environment.SetEnvironmentVariable(envVar, null);
- }
+ Environment.SetEnvironmentVariable(envVar, null);
}
}
}
diff --git a/eng/tools/CopilotCliTester/src/AgentRunner.cs b/eng/tools/CopilotCliTester/src/AgentRunner.cs
index 9ba7d46b7a..b6d2429cb0 100644
--- a/eng/tools/CopilotCliTester/src/AgentRunner.cs
+++ b/eng/tools/CopilotCliTester/src/AgentRunner.cs
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
-using System.Diagnostics;
using System.Text;
using System.Text.RegularExpressions;
using CopilotCliTester.Models;
@@ -15,8 +14,8 @@ namespace CopilotCliTester;
///
internal sealed partial class AgentRunner(CopilotClient client, string serverExecutablePath, string? outputDir = null, string? workspacePath = null) : IAsyncDisposable
{
- private static readonly string TimeStamp = DateTimeOffset.UtcNow.ToString("yyyyMMdd-HHmmss");
- private readonly Lock eventLock = new();
+ private static readonly string s_timeStamp = DateTimeOffset.UtcNow.ToString("yyyyMMdd-HHmmss");
+ private readonly Lock _eventLock = new();
private readonly string _outputDirectory = outputDir ?? Path.Combine(AppContext.BaseDirectory, "reports");
[GeneratedRegex(@"eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}")]
@@ -108,7 +107,7 @@ public async Task RunAsync(AgentRunConfig config, CancellationTok
session.On(ev =>
{
- lock (eventLock)
+ lock (_eventLock)
{
if (isComplete)
return;
@@ -160,7 +159,7 @@ public async Task RunAsync(AgentRunConfig config, CancellationTok
}
catch (OperationCanceledException) when (cancellationToken.IsCancellationRequested)
{
- lock (eventLock)
+ lock (_eventLock)
{
isComplete = true;
}
@@ -335,7 +334,7 @@ internal static string RedactSecrets(string text)
private string BuildReportFilePath(AgentRunConfig config)
{
- var runDir = $"test-run-{TimeStamp}";
+ var runDir = $"test-run-{s_timeStamp}";
var ns = config.Namespace ?? "unknown";
var tool = config.ToolName ?? $"test-{DateTime.UtcNow:yyyyMMdd-HHmmss}";
var file = $"{tool}-{DateTimeOffset.UtcNow:HHmmssfff}.md";
diff --git a/eng/tools/CopilotCliTester/src/AgentRunnerUtils.cs b/eng/tools/CopilotCliTester/src/AgentRunnerUtils.cs
index 99f898831b..161cc4c8d5 100644
--- a/eng/tools/CopilotCliTester/src/AgentRunnerUtils.cs
+++ b/eng/tools/CopilotCliTester/src/AgentRunnerUtils.cs
@@ -3,7 +3,6 @@
using System.Text.Json;
using CopilotCliTester.Models;
-using GitHub.Copilot.SDK;
namespace CopilotCliTester;
@@ -13,12 +12,12 @@ namespace CopilotCliTester;
internal static class AgentRunnerUtils
{
// Internal/meta tools we do NOT want to count as "the expected MCP tool"
- private static readonly HashSet IgnoredTools = new(StringComparer.OrdinalIgnoreCase)
+ private static readonly HashSet s_ignoredTools = new(StringComparer.OrdinalIgnoreCase)
{
"report_intent"
};
- private static readonly string[] prefixes = new[] { "azure-", "azure_" };
+ private static readonly string[] s_prefixes = ["azure-", "azure_"];
///
/// Returns tool.execution_start events
@@ -30,7 +29,7 @@ public static IReadOnlyList GetToolCalls(AgentMetadata metada
.Where(e =>
{
var name = e.Data.TryGetValue("toolName", out var tn) ? tn?.ToString() : null;
- return !string.IsNullOrWhiteSpace(name) && !IgnoredTools.Contains(name!);
+ return !string.IsNullOrWhiteSpace(name) && !s_ignoredTools.Contains(name!);
}).ToList();
}
@@ -47,7 +46,7 @@ public static bool WasToolInvoked(AgentMetadata metadata, string expectedTool)
return true;
// Strip known single-segment namespace-proxy prefix instead of open-ended suffix match to avoid false positives (e.g., "subscription_list" matching "eventgrid_subscription_list")
- foreach (var prefix in prefixes)
+ foreach (var prefix in s_prefixes)
{
if (resolved.StartsWith(prefix, StringComparison.OrdinalIgnoreCase) &&
string.Equals(resolved[prefix.Length..], expectedTool, StringComparison.OrdinalIgnoreCase))
diff --git a/eng/tools/CopilotCliTester/src/CopilotCliTester.csproj b/eng/tools/CopilotCliTester/src/CopilotCliTester.csproj
index 92c334f87d..43564c54e5 100644
--- a/eng/tools/CopilotCliTester/src/CopilotCliTester.csproj
+++ b/eng/tools/CopilotCliTester/src/CopilotCliTester.csproj
@@ -6,6 +6,7 @@
CopilotCliTester
enable
enable
+ true
diff --git a/eng/tools/ToolDescriptionEvaluator/src/Models/EmbeddingModels.cs b/eng/tools/ToolDescriptionEvaluator/src/Models/EmbeddingModels.cs
index d8b49a93ba..bbf10d61c8 100644
--- a/eng/tools/ToolDescriptionEvaluator/src/Models/EmbeddingModels.cs
+++ b/eng/tools/ToolDescriptionEvaluator/src/Models/EmbeddingModels.cs
@@ -3,7 +3,7 @@
using System.Text.Json.Serialization;
-namespace ToolSelection.Models;
+namespace ToolDescriptionEvaluator.Models;
// Azure OpenAI Embedding API models
public class EmbeddingRequest
diff --git a/eng/tools/ToolDescriptionEvaluator/src/Models/McpModels.cs b/eng/tools/ToolDescriptionEvaluator/src/Models/McpModels.cs
index ed57214a5e..d72ddfff52 100644
--- a/eng/tools/ToolDescriptionEvaluator/src/Models/McpModels.cs
+++ b/eng/tools/ToolDescriptionEvaluator/src/Models/McpModels.cs
@@ -3,7 +3,7 @@
using System.Text.Json.Serialization;
-namespace ToolSelection.Models;
+namespace ToolDescriptionEvaluator.Models;
// Constants
public static class McpConstants
diff --git a/eng/tools/ToolDescriptionEvaluator/src/Models/SourceGenerationContext.cs b/eng/tools/ToolDescriptionEvaluator/src/Models/SourceGenerationContext.cs
index 1324db6567..8d871df882 100644
--- a/eng/tools/ToolDescriptionEvaluator/src/Models/SourceGenerationContext.cs
+++ b/eng/tools/ToolDescriptionEvaluator/src/Models/SourceGenerationContext.cs
@@ -3,7 +3,7 @@
using System.Text.Json.Serialization;
-namespace ToolSelection.Models;
+namespace ToolDescriptionEvaluator.Models;
[JsonSourceGenerationOptions(WriteIndented = true, PropertyNameCaseInsensitive = true)]
[JsonSerializable(typeof(ListToolsResult))]
diff --git a/eng/tools/ToolDescriptionEvaluator/src/Models/SuccessRateMetrics.cs b/eng/tools/ToolDescriptionEvaluator/src/Models/SuccessRateMetrics.cs
index ce519a1c4c..0bfb085bb0 100644
--- a/eng/tools/ToolDescriptionEvaluator/src/Models/SuccessRateMetrics.cs
+++ b/eng/tools/ToolDescriptionEvaluator/src/Models/SuccessRateMetrics.cs
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
-namespace ToolSelection.Models;
+namespace ToolDescriptionEvaluator.Models;
public class SuccessRateMetrics
{
diff --git a/eng/tools/ToolDescriptionEvaluator/src/Program.cs b/eng/tools/ToolDescriptionEvaluator/src/Program.cs
index 29a704ab1f..3f1f005e82 100644
--- a/eng/tools/ToolDescriptionEvaluator/src/Program.cs
+++ b/eng/tools/ToolDescriptionEvaluator/src/Program.cs
@@ -3,13 +3,13 @@
using System.Diagnostics;
using System.Text.Json;
-using ToolSelection.Models;
-using ToolSelection.Services;
-using ToolSelection.VectorDb;
+using ToolDescriptionEvaluator.Models;
+using ToolDescriptionEvaluator.Services;
+using ToolDescriptionEvaluator.VectorDb;
-namespace ToolSelection;
+namespace ToolDescriptionEvaluator;
-class Program
+internal class Program
{
private static readonly HttpClient HttpClient = new();
@@ -825,7 +825,9 @@ await Task.WhenAll(
}
}
+#pragma warning disable IDE0060 // Should use isCiMode parameter, but it's not used in this method.
private static async Task PerformAnalysis(Dictionary> toolNameWithPrompts, EmbeddingService embeddingService, VectorDB db, TimeSpan databaseSetupTime, StreamWriter writer, int maxResultsPerTest = 5, bool isCiMode = false)
+#pragma warning restore IDE0060
{
var stopwatch = Stopwatch.StartNew();
int promptCount = 0;
diff --git a/eng/tools/ToolDescriptionEvaluator/src/Services/EmbeddingService.cs b/eng/tools/ToolDescriptionEvaluator/src/Services/EmbeddingService.cs
index 9dd18f8852..8384b471f5 100644
--- a/eng/tools/ToolDescriptionEvaluator/src/Services/EmbeddingService.cs
+++ b/eng/tools/ToolDescriptionEvaluator/src/Services/EmbeddingService.cs
@@ -3,9 +3,9 @@
using System.Text;
using System.Text.Json;
-using ToolSelection.Models;
+using ToolDescriptionEvaluator.Models;
-namespace ToolSelection.Services;
+namespace ToolDescriptionEvaluator.Services;
public class EmbeddingService(HttpClient httpClient, string endpoint, string apiKey)
{
diff --git a/eng/tools/ToolDescriptionEvaluator/src/ToolDescriptionEvaluator.csproj b/eng/tools/ToolDescriptionEvaluator/src/ToolDescriptionEvaluator.csproj
index a7ab571ffa..035cf32e47 100644
--- a/eng/tools/ToolDescriptionEvaluator/src/ToolDescriptionEvaluator.csproj
+++ b/eng/tools/ToolDescriptionEvaluator/src/ToolDescriptionEvaluator.csproj
@@ -3,6 +3,7 @@
Exe
true
+ true
diff --git a/eng/tools/ToolDescriptionEvaluator/src/VectorDb/VectorDB.cs b/eng/tools/ToolDescriptionEvaluator/src/VectorDb/VectorDB.cs
index b1bbfd923d..2569730b7c 100644
--- a/eng/tools/ToolDescriptionEvaluator/src/VectorDb/VectorDB.cs
+++ b/eng/tools/ToolDescriptionEvaluator/src/VectorDb/VectorDB.cs
@@ -3,7 +3,7 @@
using System.Numerics.Tensors;
-namespace ToolSelection.VectorDb;
+namespace ToolDescriptionEvaluator.VectorDb;
public record Entry(string Id, object? Metadata, float[] Vector);
diff --git a/eng/tools/ToolMetadataExporter/src/AppConfiguration.cs b/eng/tools/ToolMetadataExporter/src/AppConfiguration.cs
index 5061432393..feec232c03 100644
--- a/eng/tools/ToolMetadataExporter/src/AppConfiguration.cs
+++ b/eng/tools/ToolMetadataExporter/src/AppConfiguration.cs
@@ -27,7 +27,7 @@ public class AppConfiguration
///
/// Folder path where Kusto query files are stored. By default, it is "Resources/queries".
- /// Used to load file named
+ /// Used to load file named
/// which fetches current MCP tools.
///
public string? QueriesFolder { get; set; } = "Resources/queries";
@@ -39,7 +39,7 @@ public class AppConfiguration
///
/// true if the application should run in dry-run mode. In dry-run mode, no events are published to Kusto
- /// Changes are written locally to .
+ /// Changes are written locally to .
/// false to publish events to Kusto.
///
public bool IsDryRun { get; set; }
diff --git a/eng/tools/ToolMetadataExporter/src/Models/CommandLineOptions.cs b/eng/tools/ToolMetadataExporter/src/Models/CommandLineOptions.cs
index 4397348da9..c015219066 100644
--- a/eng/tools/ToolMetadataExporter/src/Models/CommandLineOptions.cs
+++ b/eng/tools/ToolMetadataExporter/src/Models/CommandLineOptions.cs
@@ -1,6 +1,8 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
+using ToolMetadataExporter.Services;
+
namespace ToolMetadataExporter.Models;
///
diff --git a/eng/tools/ToolMetadataExporter/src/Program.cs b/eng/tools/ToolMetadataExporter/src/Program.cs
index 83272812f2..e5b819e8ff 100644
--- a/eng/tools/ToolMetadataExporter/src/Program.cs
+++ b/eng/tools/ToolMetadataExporter/src/Program.cs
@@ -4,7 +4,6 @@
using Azure.Core;
using Azure.Identity;
using Kusto.Data;
-using Kusto.Data.Common;
using Kusto.Data.Net.Client;
using Kusto.Ingest;
using Microsoft.Extensions.Configuration;
@@ -84,13 +83,12 @@ private static void ConfigureAzureServices(IServiceCollection services)
services.AddScoped(sp =>
{
var credential = new ChainedTokenCredential(
- new ManagedIdentityCredential(),
- new DefaultAzureCredential()
- );
+ new ManagedIdentityCredential(new ManagedIdentityCredentialOptions()),
+ new DefaultAzureCredential());
return credential;
});
- services.AddSingleton(sp =>
+ services.AddSingleton(sp =>
{
var config = sp.GetRequiredService>();
@@ -100,7 +98,7 @@ private static void ConfigureAzureServices(IServiceCollection services)
return KustoClientFactory.CreateCslQueryProvider(connectionStringBuilder);
});
- services.AddSingleton(sp =>
+ services.AddSingleton(sp =>
{
var config = sp.GetRequiredService>();
diff --git a/eng/tools/ToolMetadataExporter/src/Services/AzmcpProgram.cs b/eng/tools/ToolMetadataExporter/src/Services/AzmcpProgram.cs
index 8f9bec22de..c70bae17a3 100644
--- a/eng/tools/ToolMetadataExporter/src/Services/AzmcpProgram.cs
+++ b/eng/tools/ToolMetadataExporter/src/Services/AzmcpProgram.cs
@@ -4,8 +4,8 @@
using System.Text.RegularExpressions;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
+using ToolDescriptionEvaluator.Models;
using ToolMetadataExporter.Models;
-using ToolSelection.Models;
namespace ToolMetadataExporter.Services;
diff --git a/eng/tools/ToolMetadataExporter/src/ToolAnalyzer.cs b/eng/tools/ToolMetadataExporter/src/ToolAnalyzer.cs
index a640938f53..0413e11cd9 100644
--- a/eng/tools/ToolMetadataExporter/src/ToolAnalyzer.cs
+++ b/eng/tools/ToolMetadataExporter/src/ToolAnalyzer.cs
@@ -3,10 +3,10 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
+using ToolDescriptionEvaluator.Models;
using ToolMetadataExporter.Models;
using ToolMetadataExporter.Models.Kusto;
using ToolMetadataExporter.Services;
-using ToolSelection.Models;
namespace ToolMetadataExporter;
diff --git a/eng/tools/ToolMetadataExporter/src/ToolMetadataExporter.csproj b/eng/tools/ToolMetadataExporter/src/ToolMetadataExporter.csproj
index c8e92375d8..f94096d0c8 100644
--- a/eng/tools/ToolMetadataExporter/src/ToolMetadataExporter.csproj
+++ b/eng/tools/ToolMetadataExporter/src/ToolMetadataExporter.csproj
@@ -7,6 +7,7 @@
true
true
+ true
diff --git a/eng/tools/ToolMetadataExporter/src/Utility.cs b/eng/tools/ToolMetadataExporter/src/Utility.cs
index 5ae6969a7d..49955d1b7d 100644
--- a/eng/tools/ToolMetadataExporter/src/Utility.cs
+++ b/eng/tools/ToolMetadataExporter/src/Utility.cs
@@ -4,7 +4,7 @@
using System.Diagnostics;
using System.Text.RegularExpressions;
using Microsoft.Extensions.Logging;
-using ToolSelection.Models;
+using ToolDescriptionEvaluator.Models;
namespace ToolMetadataExporter;
@@ -213,10 +213,10 @@ private static string EscapeCharacters(string text)
///
/// Traverse up from a starting directory to find the repo root.
- /// Directory containing or .git).
+ /// Directory containing or .git).
///
/// Directory to start upwards traversal
- /// Directory containing or .git
+ /// Directory containing or .git
/// If the solution cannot be found.
internal static string FindRepoRoot(string startDir)
{
diff --git a/eng/tools/ToolMetadataExporter/tests/ToolMetadataExporter.UnitTests/Services/AzmcpProgramTests.cs b/eng/tools/ToolMetadataExporter/tests/ToolMetadataExporter.UnitTests/Services/AzmcpProgramTests.cs
index e1e968ac7e..03233af220 100644
--- a/eng/tools/ToolMetadataExporter/tests/ToolMetadataExporter.UnitTests/Services/AzmcpProgramTests.cs
+++ b/eng/tools/ToolMetadataExporter/tests/ToolMetadataExporter.UnitTests/Services/AzmcpProgramTests.cs
@@ -1,4 +1,7 @@
-using System.Text.Json;
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+using System.Text.Json;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using NSubstitute;
diff --git a/eng/tools/ToolMetadataExporter/tests/ToolMetadataExporter.UnitTests/ToolAnalyzerTests.cs b/eng/tools/ToolMetadataExporter/tests/ToolMetadataExporter.UnitTests/ToolAnalyzerTests.cs
index 6362e03eda..ffaf7fe2c7 100644
--- a/eng/tools/ToolMetadataExporter/tests/ToolMetadataExporter.UnitTests/ToolAnalyzerTests.cs
+++ b/eng/tools/ToolMetadataExporter/tests/ToolMetadataExporter.UnitTests/ToolAnalyzerTests.cs
@@ -1,14 +1,13 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
-using System;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using NSubstitute;
+using ToolDescriptionEvaluator.Models;
using ToolMetadataExporter.Models;
using ToolMetadataExporter.Models.Kusto;
using ToolMetadataExporter.Services;
-using ToolSelection.Models;
using Xunit;
namespace ToolMetadataExporter.UnitTests;
diff --git a/servers/Azure.Mcp.Server/src/Program.cs b/servers/Azure.Mcp.Server/src/Program.cs
index 4d7f870305..800842890b 100644
--- a/servers/Azure.Mcp.Server/src/Program.cs
+++ b/servers/Azure.Mcp.Server/src/Program.cs
@@ -7,7 +7,6 @@
using Azure.Mcp.Core.Services.Azure.Subscription;
using Azure.Mcp.Core.Services.Azure.Tenant;
using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
diff --git a/servers/Azure.Mcp.Server/src/Properties/AssemblyInfo.cs b/servers/Azure.Mcp.Server/src/Properties/AssemblyInfo.cs
index ac3708f3da..4af0c4e177 100644
--- a/servers/Azure.Mcp.Server/src/Properties/AssemblyInfo.cs
+++ b/servers/Azure.Mcp.Server/src/Properties/AssemblyInfo.cs
@@ -1,2 +1,5 @@
-[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Azure.Mcp.Core.Tests")]
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Azure.Mcp.Core.Tests")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Azure.Mcp.Server.Tests")]
diff --git a/servers/Azure.Mcp.Server/tests/Azure.Mcp.Server.Tests/Infrastructure/CommandTypeInventoryTests.cs b/servers/Azure.Mcp.Server/tests/Azure.Mcp.Server.Tests/Infrastructure/CommandTypeInventoryTests.cs
index c5d3a82fac..4b242d9ab8 100644
--- a/servers/Azure.Mcp.Server/tests/Azure.Mcp.Server.Tests/Infrastructure/CommandTypeInventoryTests.cs
+++ b/servers/Azure.Mcp.Server/tests/Azure.Mcp.Server.Tests/Infrastructure/CommandTypeInventoryTests.cs
@@ -2,7 +2,6 @@
// Licensed under the MIT License.
using System.Text.Json;
-using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Mcp.Core.Commands;
using Xunit;
diff --git a/servers/Fabric.Mcp.Server/src/Program.cs b/servers/Fabric.Mcp.Server/src/Program.cs
index dd763bed65..5b5bdda953 100644
--- a/servers/Fabric.Mcp.Server/src/Program.cs
+++ b/servers/Fabric.Mcp.Server/src/Program.cs
@@ -157,7 +157,7 @@ private static void WriteResponse(CommandResponse response)
///
///
/// For example, most instances take an indirect dependency
- /// on or , both of which have
+ /// on ITenantService or , both of which have
/// transport-specific implementations. This method can add the stdio-specific
/// implementation to allow the first container (used for command picking) to work,
/// but such transport-specific registrations must be overridden within
diff --git a/servers/Template.Mcp.Server/src/Program.cs b/servers/Template.Mcp.Server/src/Program.cs
index 29d9924359..6dfce4a48b 100644
--- a/servers/Template.Mcp.Server/src/Program.cs
+++ b/servers/Template.Mcp.Server/src/Program.cs
@@ -153,7 +153,7 @@ private static void WriteResponse(CommandResponse response)
///
///
/// For example, most instances take an indirect dependency
- /// on or , both of which have
+ /// on ITenantService or , both of which have
/// transport-specific implementations. This method can add the stdio-specific
/// implementation to allow the first container (used for command picking) to work,
/// but such transport-specific registrations must be overridden within
diff --git a/tools/Azure.Mcp.Tools.Acr/src/Services/AcrService.cs b/tools/Azure.Mcp.Tools.Acr/src/Services/AcrService.cs
index d767233df3..ea82b2bfdc 100644
--- a/tools/Azure.Mcp.Tools.Acr/src/Services/AcrService.cs
+++ b/tools/Azure.Mcp.Tools.Acr/src/Services/AcrService.cs
@@ -8,18 +8,15 @@
using Azure.Mcp.Core.Services.Azure.Subscription;
using Azure.Mcp.Core.Services.Azure.Tenant;
using Azure.Mcp.Tools.Acr.Models;
-using Microsoft.Extensions.Logging;
using Microsoft.Mcp.Core.Helpers;
using Microsoft.Mcp.Core.Options;
using Microsoft.Mcp.Core.Services.Azure.Authentication;
namespace Azure.Mcp.Tools.Acr.Services;
-public sealed class AcrService(ISubscriptionService subscriptionService, ITenantService tenantService, ILogger logger)
+public sealed class AcrService(ISubscriptionService subscriptionService, ITenantService tenantService)
: BaseAzureResourceService(subscriptionService, tenantService), IAcrService
{
- private readonly ILogger _logger = logger ?? throw new ArgumentNullException(nameof(logger));
-
public async Task> ListRegistries(
string subscription,
string? resourceGroup = null,
diff --git a/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.Tests/AssemblyAttributes.cs b/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.Tests/AssemblyAttributes.cs
index 69da1d7967..9068d23bfb 100644
--- a/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.Tests/AssemblyAttributes.cs
+++ b/tools/Azure.Mcp.Tools.Acr/tests/Azure.Mcp.Tools.Acr.Tests/AssemblyAttributes.cs
@@ -1,2 +1,5 @@
-[assembly: Microsoft.Mcp.Tests.Helpers.ClearEnvironmentVariablesBeforeTest]
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+[assembly: Microsoft.Mcp.Tests.Helpers.ClearEnvironmentVariablesBeforeTest]
[assembly: Xunit.CollectionBehavior(Xunit.CollectionBehavior.CollectionPerAssembly)]
diff --git a/tools/Azure.Mcp.Tools.Advisor/src/Commands/AdvisorJsonContext.cs b/tools/Azure.Mcp.Tools.Advisor/src/Commands/AdvisorJsonContext.cs
index 957af115cb..a0d99bc22d 100644
--- a/tools/Azure.Mcp.Tools.Advisor/src/Commands/AdvisorJsonContext.cs
+++ b/tools/Azure.Mcp.Tools.Advisor/src/Commands/AdvisorJsonContext.cs
@@ -1,3 +1,6 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
using System.Text.Json.Serialization;
using Azure.Mcp.Tools.Advisor.Commands.Recommendation;
using Azure.Mcp.Tools.Advisor.Services.Models;
diff --git a/tools/Azure.Mcp.Tools.Advisor/src/Services/Models/RecommendationData.cs b/tools/Azure.Mcp.Tools.Advisor/src/Services/Models/RecommendationData.cs
index 60fb7b6248..03bb7f8cf3 100644
--- a/tools/Azure.Mcp.Tools.Advisor/src/Services/Models/RecommendationData.cs
+++ b/tools/Azure.Mcp.Tools.Advisor/src/Services/Models/RecommendationData.cs
@@ -1,4 +1,4 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System.Text.Json;
diff --git a/tools/Azure.Mcp.Tools.Advisor/src/Services/Models/RecommendationDescription.cs b/tools/Azure.Mcp.Tools.Advisor/src/Services/Models/RecommendationDescription.cs
index 84c5000ecb..5b3a4a4093 100644
--- a/tools/Azure.Mcp.Tools.Advisor/src/Services/Models/RecommendationDescription.cs
+++ b/tools/Azure.Mcp.Tools.Advisor/src/Services/Models/RecommendationDescription.cs
@@ -1,4 +1,4 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Azure.Mcp.Tools.Advisor.Services.Models;
diff --git a/tools/Azure.Mcp.Tools.Advisor/src/Services/Models/RecommendationProperties.cs b/tools/Azure.Mcp.Tools.Advisor/src/Services/Models/RecommendationProperties.cs
index 8442fea2c1..63899fb86e 100644
--- a/tools/Azure.Mcp.Tools.Advisor/src/Services/Models/RecommendationProperties.cs
+++ b/tools/Azure.Mcp.Tools.Advisor/src/Services/Models/RecommendationProperties.cs
@@ -1,4 +1,4 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System.Text.Json.Serialization;
diff --git a/tools/Azure.Mcp.Tools.Advisor/src/Services/Models/RecommendationResourceMetadata.cs b/tools/Azure.Mcp.Tools.Advisor/src/Services/Models/RecommendationResourceMetadata.cs
index 3fcc88842d..233d8471b5 100644
--- a/tools/Azure.Mcp.Tools.Advisor/src/Services/Models/RecommendationResourceMetadata.cs
+++ b/tools/Azure.Mcp.Tools.Advisor/src/Services/Models/RecommendationResourceMetadata.cs
@@ -1,4 +1,4 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Azure.Mcp.Tools.Advisor.Services.Models;
diff --git a/tools/Azure.Mcp.Tools.Aks/src/Services/AksService.cs b/tools/Azure.Mcp.Tools.Aks/src/Services/AksService.cs
index a9d86fda61..db80a12add 100644
--- a/tools/Azure.Mcp.Tools.Aks/src/Services/AksService.cs
+++ b/tools/Azure.Mcp.Tools.Aks/src/Services/AksService.cs
@@ -8,8 +8,6 @@
using Azure.Mcp.Tools.Aks.Commands;
using Azure.Mcp.Tools.Aks.Models;
using Azure.ResourceManager.ContainerService;
-using Azure.ResourceManager.ContainerService.Models;
-using Microsoft.Extensions.Logging;
using Microsoft.Mcp.Core.Options;
using Microsoft.Mcp.Core.Services.Caching;
@@ -18,12 +16,10 @@ namespace Azure.Mcp.Tools.Aks.Services;
public sealed class AksService(
ISubscriptionService subscriptionService,
ITenantService tenantService,
- ICacheService cacheService,
- ILogger logger) : BaseAzureResourceService(subscriptionService, tenantService), IAksService
+ ICacheService cacheService) : BaseAzureResourceService(subscriptionService, tenantService), IAksService
{
private readonly ISubscriptionService _subscriptionService = subscriptionService ?? throw new ArgumentNullException(nameof(subscriptionService));
private readonly ICacheService _cacheService = cacheService ?? throw new ArgumentNullException(nameof(cacheService));
- private readonly ILogger _logger = logger;
private const string CacheGroup = "aks";
private const string AksClustersCacheKey = "clusters";
@@ -391,51 +387,4 @@ private static NodePool ConvertToNodePoolModel(ContainerServiceAgentPoolResource
VnetSubnetId = data.VnetSubnetId
};
}
-
- private static NodePool ConvertToNodePoolModel(ManagedClusterAgentPoolProfile profile)
- {
- return new()
- {
- Name = profile.Name,
- Count = profile.Count,
- VmSize = profile.VmSize?.ToString(),
- OsDiskSizeGB = profile.OSDiskSizeInGB,
- OsDiskType = profile.OSDiskType?.ToString(),
- KubeletDiskType = profile.KubeletDiskType?.ToString(),
- MaxPods = profile.MaxPods,
- Type = profile.AgentPoolType?.ToString(),
- MaxCount = profile.MaxCount,
- MinCount = profile.MinCount,
- EnableAutoScaling = profile.EnableAutoScaling,
- ScaleDownMode = profile.ScaleDownMode?.ToString(),
- ProvisioningState = profile.ProvisioningState?.ToString(),
- PowerState = profile.PowerStateCode.HasValue ? new() { Code = profile.PowerStateCode.Value.ToString() } : null,
- Mode = profile.Mode?.ToString(),
- OrchestratorVersion = profile.OrchestratorVersion,
- CurrentOrchestratorVersion = profile.CurrentOrchestratorVersion,
- EnableNodePublicIP = profile.EnableNodePublicIP,
- ScaleSetPriority = profile.ScaleSetPriority?.ToString(),
- ScaleSetEvictionPolicy = profile.ScaleSetEvictionPolicy?.ToString(),
- NodeLabels = profile.NodeLabels?.ToDictionary(kvp => kvp.Key, kvp => kvp.Value),
- NodeTaints = profile.NodeTaints?.ToList(),
- OsType = profile.OSType?.ToString(),
- OsSKU = profile.OSSku?.ToString(),
- NodeImageVersion = profile.NodeImageVersion,
- Tags = profile.Tags?.ToDictionary(kvp => kvp.Key, kvp => kvp.Value),
- SpotMaxPrice = profile.SpotMaxPrice,
- WorkloadRuntime = profile.WorkloadRuntime?.ToString(),
- EnableEncryptionAtHost = profile.EnableEncryptionAtHost,
- EnableUltraSSD = profile.EnableUltraSsd,
- EnableFIPS = profile.EnableFips,
- // Profiles don't expose GPU/Security sub-objects in this API shape
- NetworkProfile = profile.NetworkProfile is null ? null : new()
- {
- AllowedHostPorts = profile.NetworkProfile.AllowedHostPorts?.Select(p => new PortRange { StartPort = p.PortStart, EndPort = p.PortEnd }).ToList(),
- ApplicationSecurityGroups = profile.NetworkProfile.ApplicationSecurityGroups?.Select(rid => rid.ToString()).ToList(),
- NodePublicIPTags = profile.NetworkProfile.NodePublicIPTags?.Select(t => new IPTag { IpTagType = t.IPTagType, Tag = t.Tag }).ToList()
- },
- PodSubnetId = profile.PodSubnetId?.ToString(),
- VnetSubnetId = profile.VnetSubnetId?.ToString()
- };
- }
}
diff --git a/tools/Azure.Mcp.Tools.AppConfig/src/Models/KeyValueSetting.cs b/tools/Azure.Mcp.Tools.AppConfig/src/Models/KeyValueSetting.cs
index 0820e9ed43..49fe44e870 100644
--- a/tools/Azure.Mcp.Tools.AppConfig/src/Models/KeyValueSetting.cs
+++ b/tools/Azure.Mcp.Tools.AppConfig/src/Models/KeyValueSetting.cs
@@ -3,15 +3,13 @@
namespace Azure.Mcp.Tools.AppConfig.Models;
-using ETag = Microsoft.Mcp.Core.Models.ETag;
-
public class KeyValueSetting
{
public string Key { get; set; } = string.Empty;
public string Value { get; set; } = string.Empty;
public string Label { get; set; } = string.Empty;
public string ContentType { get; set; } = string.Empty;
- public ETag ETag { get; set; } = new();
+ public Microsoft.Mcp.Core.Models.ETag ETag { get; set; } = new();
public DateTimeOffset? LastModified { get; set; }
public bool? Locked { get; set; }
}
diff --git a/tools/Azure.Mcp.Tools.AppConfig/src/Services/AppConfigService.cs b/tools/Azure.Mcp.Tools.AppConfig/src/Services/AppConfigService.cs
index 0d8f0356ac..d118262d2d 100644
--- a/tools/Azure.Mcp.Tools.AppConfig/src/Services/AppConfigService.cs
+++ b/tools/Azure.Mcp.Tools.AppConfig/src/Services/AppConfigService.cs
@@ -8,7 +8,6 @@
using Azure.Mcp.Core.Services.Azure.Subscription;
using Azure.Mcp.Core.Services.Azure.Tenant;
using Azure.Mcp.Tools.AppConfig.Models;
-using Microsoft.Extensions.Logging;
using Microsoft.Mcp.Core.Helpers;
using Microsoft.Mcp.Core.Models.Identity;
using Microsoft.Mcp.Core.Options;
@@ -16,12 +15,9 @@
namespace Azure.Mcp.Tools.AppConfig.Services;
-using ETag = Microsoft.Mcp.Core.Models.ETag;
-
-public sealed class AppConfigService(ISubscriptionService subscriptionService, ITenantService tenantService, ILogger logger, IHttpClientFactory httpClientFactory)
+public sealed class AppConfigService(ISubscriptionService subscriptionService, ITenantService tenantService, IHttpClientFactory httpClientFactory)
: BaseAzureResourceService(subscriptionService, tenantService), IAppConfigService
{
- private readonly ILogger _logger = logger ?? throw new ArgumentNullException(nameof(logger));
private readonly IHttpClientFactory _httpClientFactory = httpClientFactory ?? throw new ArgumentNullException(nameof(httpClientFactory));
public async Task> GetAppConfigAccounts(
diff --git a/tools/Azure.Mcp.Tools.AppLens/src/Services/AppLensService.cs b/tools/Azure.Mcp.Tools.AppLens/src/Services/AppLensService.cs
index 82d5cf79be..3deee2cbe8 100644
--- a/tools/Azure.Mcp.Tools.AppLens/src/Services/AppLensService.cs
+++ b/tools/Azure.Mcp.Tools.AppLens/src/Services/AppLensService.cs
@@ -16,7 +16,6 @@
using Azure.ResourceManager.ResourceGraph.Models;
using Microsoft.AspNetCore.SignalR.Client;
using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging;
using Microsoft.Mcp.Core.Helpers;
using Microsoft.Mcp.Core.Services.Azure.Authentication;
@@ -30,13 +29,11 @@ namespace Azure.Mcp.Tools.AppLens.Services;
public class AppLensService(
IHttpClientFactory httpClientFactory,
ISubscriptionService subscriptionService,
- ITenantService tenantService,
- ILogger logger) : BaseAzureResourceService(subscriptionService, tenantService), IAppLensService
+ ITenantService tenantService) : BaseAzureResourceService(subscriptionService, tenantService), IAppLensService
{
private readonly ISubscriptionService _subscriptionService = subscriptionService ?? throw new ArgumentNullException(nameof(subscriptionService));
private readonly ITenantService _tenantService = tenantService ?? throw new ArgumentNullException(nameof(tenantService));
private readonly IHttpClientFactory _httpClientFactory = httpClientFactory ?? throw new ArgumentNullException(nameof(httpClientFactory));
- private readonly ILogger _logger = logger ?? throw new ArgumentNullException(nameof(logger));
private readonly AppLensOptions _options = new();
///
@@ -442,6 +439,7 @@ public async IAsyncEnumerable AskAppLensAsync(
///
/// The AppLens session.
/// The diagnostic question.
+ /// A cancellation token to observe while waiting for the task to complete.
/// A task containing diagnostic insights and solutions.
private async Task CollectInsightsAsync(AppLensSession session, string question, CancellationToken cancellationToken)
{
diff --git a/tools/Azure.Mcp.Tools.AppService/src/Models/DetectorDetails.cs b/tools/Azure.Mcp.Tools.AppService/src/Models/DetectorDetails.cs
index 0faca97358..a3f719d7ba 100644
--- a/tools/Azure.Mcp.Tools.AppService/src/Models/DetectorDetails.cs
+++ b/tools/Azure.Mcp.Tools.AppService/src/Models/DetectorDetails.cs
@@ -1,4 +1,4 @@
-// Copyright (c) Microsoft Corporation.Expand commentComment on line R1Resolved
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System.Text.Json.Serialization;
diff --git a/tools/Azure.Mcp.Tools.AppService/src/Models/DiagnosisResult.cs b/tools/Azure.Mcp.Tools.AppService/src/Models/DiagnosisResult.cs
index 97eec1c566..32f2930a68 100644
--- a/tools/Azure.Mcp.Tools.AppService/src/Models/DiagnosisResult.cs
+++ b/tools/Azure.Mcp.Tools.AppService/src/Models/DiagnosisResult.cs
@@ -1,4 +1,4 @@
-// Copyright (c) Microsoft Corporation.Expand commentComment on line R1Resolved
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System.Text.Json.Serialization;
diff --git a/tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/ApplicationInsightsService.cs b/tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/ApplicationInsightsService.cs
index 519c1d4296..7c25744ecf 100644
--- a/tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/ApplicationInsightsService.cs
+++ b/tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/ApplicationInsightsService.cs
@@ -7,7 +7,6 @@
using Azure.Mcp.Core.Services.Azure.Subscription;
using Azure.Mcp.Core.Services.Azure.Tenant;
using Azure.ResourceManager.ApplicationInsights;
-using Microsoft.Extensions.Logging;
using Microsoft.Mcp.Core.Options;
namespace Azure.Mcp.Tools.ApplicationInsights.Services;
@@ -16,14 +15,12 @@ public class ApplicationInsightsService(
ISubscriptionService subscriptionService,
ITenantService tenantService,
IResourceGroupService resourceGroupService,
- IProfilerDataService profilerDataClient,
- ILogger logger) : BaseAzureService(tenantService), IApplicationInsightsService
+ IProfilerDataService profilerDataClient) : BaseAzureService(tenantService), IApplicationInsightsService
{
private const int MaxRecommendations = 20;
private readonly ISubscriptionService _subscriptionService = subscriptionService;
private readonly IResourceGroupService _resourceGroupService = resourceGroupService;
private readonly IProfilerDataService _profilerDataClient = profilerDataClient ?? throw new ArgumentNullException(nameof(profilerDataClient));
- private readonly ILogger _logger = logger ?? throw new ArgumentNullException(nameof(logger));
public async Task> GetProfilerInsightsAsync(
string subscription,
diff --git a/tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/IProfilerDataService.cs b/tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/IProfilerDataService.cs
index 02e4d451bc..bfd879b2b0 100644
--- a/tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/IProfilerDataService.cs
+++ b/tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/IProfilerDataService.cs
@@ -1,3 +1,6 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
using System.Text.Json.Nodes;
using Azure.Core;
diff --git a/tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/ProfilerDataService.cs b/tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/ProfilerDataService.cs
index 66e3a27943..08d2e0f305 100644
--- a/tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/ProfilerDataService.cs
+++ b/tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/ProfilerDataService.cs
@@ -1,3 +1,6 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
using System.Collections.Specialized;
using System.Net.Http.Headers;
using System.Net.Http.Json;
@@ -170,6 +173,7 @@ private async Task CreateRequestAsync(HttpMethod method, str
///
/// The path
/// Optional queries to append to the path.
+ /// The API version to use.
/// Optional client request ID.
/// The content of the incoming request.
/// Additional headers to be added to the request
diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Services/Policy/PolicyCreateValidator.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Services/Policy/PolicyCreateValidator.cs
index 83d7bd9408..e7ea13b7a9 100644
--- a/tools/Azure.Mcp.Tools.AzureBackup/src/Services/Policy/PolicyCreateValidator.cs
+++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Services/Policy/PolicyCreateValidator.cs
@@ -649,12 +649,4 @@ private static void EnsureFamily(bool value, string flag, WorkloadFamily actual,
issues.Add(new PolicyValidationIssue(flag, $"{flag} is supported only for {requiredLabel} workloads."));
}
}
-
- private static void EnsureDpp(string? value, string flag, WorkloadFamily actual, List issues)
- {
- if (!string.IsNullOrWhiteSpace(value) && IsRsvFamily(actual))
- {
- issues.Add(new PolicyValidationIssue(flag, $"{flag} is supported only for DPP (Backup vault) workloads."));
- }
- }
}
diff --git a/tools/Azure.Mcp.Tools.AzureBackup/src/Services/Policy/RsvPolicyBuilder.cs b/tools/Azure.Mcp.Tools.AzureBackup/src/Services/Policy/RsvPolicyBuilder.cs
index e2199961db..c20c0fa42d 100644
--- a/tools/Azure.Mcp.Tools.AzureBackup/src/Services/Policy/RsvPolicyBuilder.cs
+++ b/tools/Azure.Mcp.Tools.AzureBackup/src/Services/Policy/RsvPolicyBuilder.cs
@@ -2,7 +2,6 @@
// Licensed under the MIT License.
using System.Globalization;
-using System.Linq;
using Azure.ResourceManager.RecoveryServicesBackup.Models;
namespace Azure.Mcp.Tools.AzureBackup.Services.Policy;
@@ -188,41 +187,6 @@ private static SubProtectionPolicy BuildVmWorkloadFullSubPolicy(PolicyCreateRequ
return sub;
}
- private static SubProtectionPolicy BuildVmWorkloadSnapshotSubPolicy(PolicyCreateRequest req, IList scheduleTimes)
- {
- // Retained for backward-compatibility with existing unit tests; not currently invoked by Build().
- var schedule = new SimpleSchedulePolicy { ScheduleRunFrequency = ScheduleRunType.Daily };
- foreach (var t in scheduleTimes)
- {
- schedule.ScheduleRunTimes.Add(t);
- }
-
- var snapshotDays = TryParsePositiveInt(req.SnapshotInstantRpRetentionDays, out var rpDays) ? rpDays : 2;
- var retention = new SimpleRetentionPolicy
- {
- RetentionDuration = new RetentionDuration { Count = snapshotDays, DurationType = RetentionDurationType.Days },
- };
-
- var sub = new SubProtectionPolicy
- {
- PolicyType = new SubProtectionPolicyType("SnapshotCopyOnlyFull"),
- SchedulePolicy = schedule,
- RetentionPolicy = retention,
- };
-
- var details = new SnapshotBackupAdditionalDetails
- {
- InstantRpRetentionRangeInDays = snapshotDays,
- };
- if (!string.IsNullOrWhiteSpace(req.SnapshotInstantRpResourceGroup))
- {
- details.InstantRPDetails = req.SnapshotInstantRpResourceGroup;
- }
- sub.SnapshotBackupAdditionalDetails = details;
-
- return sub;
- }
-
private static void AttachSnapshotDetailsToFullSubPolicy(VmWorkloadProtectionPolicy policy, PolicyCreateRequest req)
{
// Per Az CLI: snapshot backup for SAPHANA is enabled by adding SnapshotBackupAdditionalDetails
@@ -814,18 +778,6 @@ private static bool TryParsePositiveInt(string? text, out int value)
private static bool IsWeeklyFrequency(ScheduleRunType? frequency)
=> frequency == ScheduleRunType.Weekly;
- private static bool HasAnyText(params string?[] values)
- {
- foreach (var v in values)
- {
- if (!string.IsNullOrWhiteSpace(v))
- {
- return true;
- }
- }
- return false;
- }
-
private static string Capitalize(string text)
{
if (string.IsNullOrEmpty(text))
diff --git a/tools/Azure.Mcp.Tools.AzureIsv/src/Services/IDatadogService.cs b/tools/Azure.Mcp.Tools.AzureIsv/src/Services/IDatadogService.cs
index 2fd7a6eb61..908a68565e 100644
--- a/tools/Azure.Mcp.Tools.AzureIsv/src/Services/IDatadogService.cs
+++ b/tools/Azure.Mcp.Tools.AzureIsv/src/Services/IDatadogService.cs
@@ -1,6 +1,8 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
+using Azure.Identity;
+
namespace Azure.Mcp.Tools.AzureIsv.Services;
public interface IDatadogService
@@ -11,6 +13,7 @@ public interface IDatadogService
/// The name of the resource group containing the Datadog resource.
/// The subscription ID or name where the resource group resides.
/// The name of the Datadog resource to query.
+ /// A cancellation token to observe while waiting for the task to complete.
/// A list of monitored resources.
/// Thrown when authentication fails.
/// Thrown when the service request fails.
diff --git a/tools/Azure.Mcp.Tools.CloudArchitect/tests/Azure.Mcp.Tools.CloudArchitect.Tests/Design/DesignCommandTests.cs b/tools/Azure.Mcp.Tools.CloudArchitect/tests/Azure.Mcp.Tools.CloudArchitect.Tests/Design/DesignCommandTests.cs
index c734c7f029..1ce819a610 100644
--- a/tools/Azure.Mcp.Tools.CloudArchitect/tests/Azure.Mcp.Tools.CloudArchitect.Tests/Design/DesignCommandTests.cs
+++ b/tools/Azure.Mcp.Tools.CloudArchitect/tests/Azure.Mcp.Tools.CloudArchitect.Tests/Design/DesignCommandTests.cs
@@ -2,7 +2,6 @@
// Licensed under the MIT License.
using System.Net;
-using System.Reflection;
using Azure.Mcp.Tools.CloudArchitect.Commands.Design;
using Microsoft.Mcp.Core.Commands;
using Microsoft.Mcp.Tests.Client;
diff --git a/tools/Azure.Mcp.Tools.Communication/src/Services/ICommunicationService.cs b/tools/Azure.Mcp.Tools.Communication/src/Services/ICommunicationService.cs
index 8b1fac1553..62c37d1c2f 100644
--- a/tools/Azure.Mcp.Tools.Communication/src/Services/ICommunicationService.cs
+++ b/tools/Azure.Mcp.Tools.Communication/src/Services/ICommunicationService.cs
@@ -32,7 +32,9 @@ Task> SendSmsAsync(
/// Optional CC recipient email addresses.
/// Optional BCC recipient email addresses.
/// Optional reply-to addresses.
+ /// Optional tenant ID.
/// Optional retry policy options.
+ /// Cancellation token for the operation.
/// The result of the email send operation.
Task SendEmailAsync(
string endpoint,
diff --git a/tools/Azure.Mcp.Tools.Deploy/src/Services/Util/DeploymentPlanTemplateUtil.cs b/tools/Azure.Mcp.Tools.Deploy/src/Services/Util/DeploymentPlanTemplateUtil.cs
index d3124a837a..89330eb366 100644
--- a/tools/Azure.Mcp.Tools.Deploy/src/Services/Util/DeploymentPlanTemplateUtil.cs
+++ b/tools/Azure.Mcp.Tools.Deploy/src/Services/Util/DeploymentPlanTemplateUtil.cs
@@ -18,7 +18,11 @@ public static class DeploymentPlanTemplateUtil
/// The name of the project. Can be null or empty.
/// The target Azure service.
/// The provisioning tool.
+ /// The source type.
+ /// The deployment option.
/// The Infrastructure as Code options for AZD.
+ /// The subscription ID for the deployment.
+ /// The resource group name for the deployment.
/// A formatted deployment plan template string.
public static string GetPlanTemplate(string projectName, string targetAppService, string provisioningTool, string sourceType, string deployOption, string? iacOptions, string? subscriptionId, string? resourceGroupName)
{
diff --git a/tools/Azure.Mcp.Tools.EventGrid/src/AssemblyInfo.cs b/tools/Azure.Mcp.Tools.EventGrid/src/AssemblyInfo.cs
index 7349d96eaa..734be064df 100644
--- a/tools/Azure.Mcp.Tools.EventGrid/src/AssemblyInfo.cs
+++ b/tools/Azure.Mcp.Tools.EventGrid/src/AssemblyInfo.cs
@@ -1,3 +1,6 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("Azure.Mcp.Tools.EventGrid.Tests")]
diff --git a/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/EventHubsCommandTests.cs b/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/EventHubsCommandTests.cs
index 8e57ca002a..68e76a81da 100644
--- a/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/EventHubsCommandTests.cs
+++ b/tools/Azure.Mcp.Tools.EventHubs/tests/Azure.Mcp.Tools.EventHubs.Tests/EventHubsCommandTests.cs
@@ -858,30 +858,4 @@ await CallToolAsync(
}
}
}
-
- ///
- /// Sanitizes and records a value based on the test mode.
- /// - In Live mode: returns the original unsanitized value
- /// - In Record mode: registers the sanitized value for recording, but returns the original value for API calls
- /// - In Playback mode: returns the sanitized value from TestVariables
- ///
- private string SanitizeAndRecord(string unsanitizedValue, string name)
- {
- if (TestMode == TestMode.Live)
- {
- // Live tests don't record anything, so just use the actual value.
- return unsanitizedValue;
- }
- else if (TestMode == TestMode.Record)
- {
- // Record tests need to sanitize and register the value, but use the actual value in the test.
- RegisterVariable(name, "Sanitized");
- return unsanitizedValue;
- }
- else
- {
- // Playback tests need to use the sanitized value.
- return TestVariables[name];
- }
- }
}
diff --git a/tools/Azure.Mcp.Tools.Extension/src/ExtensionSetup.cs b/tools/Azure.Mcp.Tools.Extension/src/ExtensionSetup.cs
index 7aca179789..0638bed057 100644
--- a/tools/Azure.Mcp.Tools.Extension/src/ExtensionSetup.cs
+++ b/tools/Azure.Mcp.Tools.Extension/src/ExtensionSetup.cs
@@ -8,6 +8,7 @@
using Microsoft.Mcp.Core.Areas.Server.Options;
using Microsoft.Mcp.Core.Commands;
using Microsoft.Mcp.Core.Extensions;
+using Microsoft.Mcp.Core.Services.ProcessExecution;
namespace Azure.Mcp.Tools.Extension;
diff --git a/tools/Azure.Mcp.Tools.Extension/src/Services/CliInstallService.cs b/tools/Azure.Mcp.Tools.Extension/src/Services/CliInstallService.cs
index 9d48a1e468..782c0719e8 100644
--- a/tools/Azure.Mcp.Tools.Extension/src/Services/CliInstallService.cs
+++ b/tools/Azure.Mcp.Tools.Extension/src/Services/CliInstallService.cs
@@ -1,5 +1,5 @@
// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License
+// Licensed under the MIT License.
using System.Runtime.InteropServices;
diff --git a/tools/Azure.Mcp.Tools.FileShares/src/Services/IFileSharesService.cs b/tools/Azure.Mcp.Tools.FileShares/src/Services/IFileSharesService.cs
index 6fb16ed87c..c9d17a60bd 100644
--- a/tools/Azure.Mcp.Tools.FileShares/src/Services/IFileSharesService.cs
+++ b/tools/Azure.Mcp.Tools.FileShares/src/Services/IFileSharesService.cs
@@ -159,6 +159,7 @@ Task DeleteSnapshotAsync(
RetryPolicyOptions? retryPolicy = null,
CancellationToken cancellationToken = default);
+ ///
/// Get file share limits for a subscription and location.
///
Task GetLimitsAsync(
diff --git a/tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/FileSharesCommandTests.cs b/tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/FileSharesCommandTests.cs
index 370251b038..996e5bae4b 100644
--- a/tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/FileSharesCommandTests.cs
+++ b/tools/Azure.Mcp.Tools.FileShares/tests/Azure.Mcp.Tools.FileShares.Tests/FileSharesCommandTests.cs
@@ -615,6 +615,4 @@ public async Task Should_update_private_endpoint_connection_status()
Assert.Equal("Approved", connectionState.GetString());
}
}
-
- private new const string TenantNameReason = "Tenant name resolution is not supported for service principals";
}
diff --git a/tools/Azure.Mcp.Tools.Functions/src/Services/Helpers/GitHubUrlValidator.cs b/tools/Azure.Mcp.Tools.Functions/src/Services/Helpers/GitHubUrlValidator.cs
index 14e4c0f2dd..ccb6b760c6 100644
--- a/tools/Azure.Mcp.Tools.Functions/src/Services/Helpers/GitHubUrlValidator.cs
+++ b/tools/Azure.Mcp.Tools.Functions/src/Services/Helpers/GitHubUrlValidator.cs
@@ -163,7 +163,7 @@ public static bool IsValidRepositoryUrl(string? url)
/// Enforces the limit in bytes and then decodes to UTF-8 string.
///
/// The HTTP content to read.
- /// Maximum allowed size in bytes (must be <= int.MaxValue).
+ /// Maximum allowed size in bytes (must be <= int.MaxValue).
/// Cancellation token.
/// The content as a string.
/// Thrown when content exceeds the size limit.
diff --git a/tools/Azure.Mcp.Tools.Grafana/src/Services/GrafanaService.cs b/tools/Azure.Mcp.Tools.Grafana/src/Services/GrafanaService.cs
index cb28aea129..8c66dda1e7 100644
--- a/tools/Azure.Mcp.Tools.Grafana/src/Services/GrafanaService.cs
+++ b/tools/Azure.Mcp.Tools.Grafana/src/Services/GrafanaService.cs
@@ -1,6 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
-// cSpell:ignore Grafanas
using System.Text.Json;
using Azure.Core;
@@ -9,20 +8,14 @@
using Azure.Mcp.Core.Services.Azure.Tenant;
using Azure.Mcp.Tools.Grafana.Models;
using Azure.Mcp.Tools.Grafana.Services.Models;
-using Microsoft.Extensions.Logging;
using Microsoft.Mcp.Core.Models.Identity;
using Microsoft.Mcp.Core.Options;
namespace Azure.Mcp.Tools.Grafana.Services;
-public class GrafanaService(
- ISubscriptionService subscriptionService,
- ITenantService tenantService,
- ILogger logger)
+public class GrafanaService(ISubscriptionService subscriptionService, ITenantService tenantService)
: BaseAzureResourceService(subscriptionService, tenantService), IGrafanaService
{
- private readonly ILogger _logger = logger ?? throw new ArgumentNullException(nameof(logger));
-
public async Task> ListWorkspacesAsync(
string subscription,
string? resourceGroup = null,
diff --git a/tools/Azure.Mcp.Tools.Grafana/src/Services/IGrafanaService.cs b/tools/Azure.Mcp.Tools.Grafana/src/Services/IGrafanaService.cs
index f5a985d33e..a90aedbd0d 100644
--- a/tools/Azure.Mcp.Tools.Grafana/src/Services/IGrafanaService.cs
+++ b/tools/Azure.Mcp.Tools.Grafana/src/Services/IGrafanaService.cs
@@ -13,8 +13,10 @@ public interface IGrafanaService
/// Lists Azure Managed Grafana workspaces in the specified subscription.
///
/// The subscription ID or name
+ /// Optional resource group name to filter the workspaces
/// Optional tenant ID for cross-tenant operations
/// Optional retry policy configuration
+ /// Cancellation token
/// List of Grafana workspace details
/// When the service request fails
Task> ListWorkspacesAsync(
diff --git a/tools/Azure.Mcp.Tools.Insights/src/Services/IInsightsService.cs b/tools/Azure.Mcp.Tools.Insights/src/Services/IInsightsService.cs
index ef4464f63d..3eab7d9d41 100644
--- a/tools/Azure.Mcp.Tools.Insights/src/Services/IInsightsService.cs
+++ b/tools/Azure.Mcp.Tools.Insights/src/Services/IInsightsService.cs
@@ -15,8 +15,13 @@ public interface IInsightsService
/// Aggregates resources in a single subscription, returning the top-3 most-common observed
/// values for each whitelisted property leaf.
///
+ /// The subscription ID to aggregate.
+ /// The tenant ID to use for authentication; if null, the default tenant is used.
+ /// Optional retry policy for transient failures.
+ /// Cancellation token.
/// Progress reporter; receives a message per ARG page fetched.
/// Fetch new ARG data if true, else use cached data.
+ /// A SubscriptionAggregation object containing the aggregated results.
Task AggregateSubscriptionAsync(
string subscription,
string? tenant,
@@ -29,8 +34,12 @@ Task AggregateSubscriptionAsync(
/// Aggregates resources across every accessible subscription in the tenant, returning
/// the top-3 most-common observed values for each whitelisted property leaf.
///
+ /// The tenant ID to use for authentication; if null, the default tenant is used.
+ /// Optional retry policy for transient failures.
+ /// Cancellation token.
/// Progress reporter; receives a message per ARG page fetched.
/// Fetch new ARG data if true, else use cached data.
+ /// A SubscriptionAggregation object containing the aggregated results.
Task AggregateTenantAsync(
string? tenant,
RetryPolicyOptions? retryPolicy,
diff --git a/tools/Azure.Mcp.Tools.IoTHub/src/Commands/IoTHub/IoTHubGetCommand.cs b/tools/Azure.Mcp.Tools.IoTHub/src/Commands/IoTHub/IoTHubGetCommand.cs
index d413c719dd..576e6ae445 100644
--- a/tools/Azure.Mcp.Tools.IoTHub/src/Commands/IoTHub/IoTHubGetCommand.cs
+++ b/tools/Azure.Mcp.Tools.IoTHub/src/Commands/IoTHub/IoTHubGetCommand.cs
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
-using System.CommandLine;
using Azure.Mcp.Core.Commands.Subscription;
using Azure.Mcp.Core.Services.Azure.Subscription;
using Azure.Mcp.Tools.IoTHub.Models;
diff --git a/tools/Azure.Mcp.Tools.IoTHub/src/GlobalUsings.cs b/tools/Azure.Mcp.Tools.IoTHub/src/GlobalUsings.cs
index 2ad8af129c..aaa0c89e73 100644
--- a/tools/Azure.Mcp.Tools.IoTHub/src/GlobalUsings.cs
+++ b/tools/Azure.Mcp.Tools.IoTHub/src/GlobalUsings.cs
@@ -2,6 +2,5 @@
// Licensed under the MIT License.
global using System;
-global using System.Collections.Generic;
global using System.Threading;
global using System.Threading.Tasks;
diff --git a/tools/Azure.Mcp.Tools.IoTHub/src/Services/IIoTHubService.cs b/tools/Azure.Mcp.Tools.IoTHub/src/Services/IIoTHubService.cs
index 1b859cede2..311e67da59 100644
--- a/tools/Azure.Mcp.Tools.IoTHub/src/Services/IIoTHubService.cs
+++ b/tools/Azure.Mcp.Tools.IoTHub/src/Services/IIoTHubService.cs
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
-using Azure.Mcp.Core.Services.Azure;
using Azure.Mcp.Tools.IoTHub.Models;
using Microsoft.Mcp.Core.Options;
diff --git a/tools/Azure.Mcp.Tools.IoTHub/src/Services/IoTHubService.cs b/tools/Azure.Mcp.Tools.IoTHub/src/Services/IoTHubService.cs
index f4d80c606b..4edcb1f648 100644
--- a/tools/Azure.Mcp.Tools.IoTHub/src/Services/IoTHubService.cs
+++ b/tools/Azure.Mcp.Tools.IoTHub/src/Services/IoTHubService.cs
@@ -7,7 +7,6 @@
using Azure.Mcp.Core.Services.Azure.Tenant;
using Azure.Mcp.Tools.IoTHub.Commands;
using Azure.Mcp.Tools.IoTHub.Models;
-using Azure.ResourceManager;
using Azure.ResourceManager.Resources;
using Microsoft.Extensions.Logging;
using Microsoft.Mcp.Core.Options;
diff --git a/tools/Azure.Mcp.Tools.IoTHub/tests/Azure.Mcp.Tools.IoTHub.UnitTests/IoTHub/IoTHubGetCommandTests.cs b/tools/Azure.Mcp.Tools.IoTHub/tests/Azure.Mcp.Tools.IoTHub.UnitTests/IoTHub/IoTHubGetCommandTests.cs
index 09b91f3990..fea349a2e1 100644
--- a/tools/Azure.Mcp.Tools.IoTHub/tests/Azure.Mcp.Tools.IoTHub.UnitTests/IoTHub/IoTHubGetCommandTests.cs
+++ b/tools/Azure.Mcp.Tools.IoTHub/tests/Azure.Mcp.Tools.IoTHub.UnitTests/IoTHub/IoTHubGetCommandTests.cs
@@ -2,8 +2,6 @@
// Licensed under the MIT License.
using System.Net;
-using Azure;
-using Azure.Mcp.Core.Services.Azure;
using Azure.Mcp.Tests.Commands;
using Azure.Mcp.Tools.IoTHub.Commands;
using Azure.Mcp.Tools.IoTHub.Commands.IoTHub;
diff --git a/tools/Azure.Mcp.Tools.KeyVault/src/Services/IKeyVaultService.cs b/tools/Azure.Mcp.Tools.KeyVault/src/Services/IKeyVaultService.cs
index aeed6882e3..80aa41ab1c 100644
--- a/tools/Azure.Mcp.Tools.KeyVault/src/Services/IKeyVaultService.cs
+++ b/tools/Azure.Mcp.Tools.KeyVault/src/Services/IKeyVaultService.cs
@@ -38,6 +38,7 @@ Task CreateCertificate(
/// The subscription ID or name
/// Optional tenant ID for cross-tenant operations
/// Optional retry policy for the operation
+ /// A cancellation token
/// The created key
Task CreateKey(
string vaultName,
@@ -57,6 +58,7 @@ Task CreateKey(
/// The subscription ID or name
/// Optional tenant ID for cross-tenant operations
/// Optional retry policy for the operation
+ /// A cancellation token
/// The created secret
Task CreateSecret(
string vaultName,
@@ -75,6 +77,7 @@ Task CreateSecret(
/// The subscription ID or name
/// Optional tenant ID for cross-tenant operations
/// Optional retry policy for the operation
+ /// A cancellation token
/// The certificate
Task GetCertificate(
string vaultName,
@@ -92,6 +95,7 @@ Task GetCertificate(
/// The subscription ID or name
/// Optional tenant ID for cross-tenant operations
/// Optional retry policy for the operation
+ /// A cancellation token
/// The key
Task GetKey(
string vaultName,
@@ -109,6 +113,7 @@ Task GetKey(
/// The subscription ID or name
/// Optional tenant ID for cross-tenant operations
/// Optional retry policy for the operation
+ /// A cancellation token
/// The secret value
Task GetSecret(
string vaultName,
@@ -125,6 +130,7 @@ Task GetSecret(
/// Subscription ID containing the Key Vault.
/// Optional tenant ID for cross-tenant operations.
/// Optional retry policy for the operation.
+ /// A cancellation token
/// List of certificate names in the vault.
Task> ListCertificates(
string vaultName,
@@ -137,9 +143,11 @@ Task> ListCertificates(
/// List all keys in a Key Vault.
///
/// Name of the Key Vault.
+ /// Whether to include managed keys in the results.
/// Subscription ID containing the Key Vault.
/// Optional tenant ID for cross-tenant operations.
/// Optional retry policy for the operation.
+ /// A cancellation token
/// List of key names in the vault.
Task> ListKeys(
string vaultName,
@@ -156,6 +164,7 @@ Task> ListKeys(
/// Subscription ID containing the Key Vault.
/// Optional tenant ID for cross-tenant operations.
/// Optional retry policy for the operation.
+ /// A cancellation token
/// List of secret names in the vault.
Task> ListSecrets(
string vaultName,
@@ -174,6 +183,7 @@ Task> ListSecrets(
/// The subscription ID or name.
/// Optional tenant ID for cross-tenant operations.
/// Optional retry policy for the operation.
+ /// A cancellation token
/// The imported certificate.
Task ImportCertificate(
string vaultName,
@@ -192,6 +202,7 @@ Task ImportCertificate(
/// The subscription ID or name.
/// Optional tenant ID for cross-tenant operations.
/// Optional retry policy for the operation.
+ /// A cancellation token
/// Structured vault settings.
Task GetVaultSettings(
string vaultName,
diff --git a/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/AssemblyAttributes.cs b/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/AssemblyAttributes.cs
index 69da1d7967..9068d23bfb 100644
--- a/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/AssemblyAttributes.cs
+++ b/tools/Azure.Mcp.Tools.KeyVault/tests/Azure.Mcp.Tools.KeyVault.Tests/AssemblyAttributes.cs
@@ -1,2 +1,5 @@
-[assembly: Microsoft.Mcp.Tests.Helpers.ClearEnvironmentVariablesBeforeTest]
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+[assembly: Microsoft.Mcp.Tests.Helpers.ClearEnvironmentVariablesBeforeTest]
[assembly: Xunit.CollectionBehavior(Xunit.CollectionBehavior.CollectionPerAssembly)]
diff --git a/tools/Azure.Mcp.Tools.Kusto/src/Services/IKustoService.cs b/tools/Azure.Mcp.Tools.Kusto/src/Services/IKustoService.cs
index bdda69c34a..d7d2538153 100644
--- a/tools/Azure.Mcp.Tools.Kusto/src/Services/IKustoService.cs
+++ b/tools/Azure.Mcp.Tools.Kusto/src/Services/IKustoService.cs
@@ -4,7 +4,6 @@
using System.Text.Json;
using Azure.Mcp.Core.Services.Azure;
using Azure.Mcp.Tools.Kusto.Models;
-using Microsoft.Mcp.Core.Models;
using Microsoft.Mcp.Core.Options;
namespace Azure.Mcp.Tools.Kusto.Services;
diff --git a/tools/Azure.Mcp.Tools.Kusto/src/Services/KustoService.cs b/tools/Azure.Mcp.Tools.Kusto/src/Services/KustoService.cs
index 9b82690647..ce416365e3 100644
--- a/tools/Azure.Mcp.Tools.Kusto/src/Services/KustoService.cs
+++ b/tools/Azure.Mcp.Tools.Kusto/src/Services/KustoService.cs
@@ -8,7 +8,6 @@
using Azure.Mcp.Core.Services.Azure.Tenant;
using Azure.Mcp.Tools.Kusto.Models;
using Azure.Mcp.Tools.Kusto.Validation;
-using Microsoft.Extensions.Logging;
using Microsoft.Mcp.Core.Helpers;
using Microsoft.Mcp.Core.Options;
using Microsoft.Mcp.Core.Services.Caching;
@@ -21,16 +20,12 @@ public sealed class KustoService(
ISubscriptionService subscriptionService,
ITenantService tenantService,
ICacheService cacheService,
- IHttpClientFactory httpClientFactory,
- ILogger logger) : BaseAzureResourceService(subscriptionService, tenantService), IKustoService
+ IHttpClientFactory httpClientFactory) : BaseAzureResourceService(subscriptionService, tenantService), IKustoService
{
private readonly ICacheService _cacheService = cacheService ?? throw new ArgumentNullException(nameof(cacheService));
private readonly IHttpClientFactory _httpClientFactory = httpClientFactory ?? throw new ArgumentNullException(nameof(httpClientFactory));
- private readonly ILogger _logger = logger ?? throw new ArgumentNullException(nameof(logger));
private const string CacheGroup = "kusto";
- private const string KustoClustersCacheKey = "clusters";
- private static readonly TimeSpan s_cacheDuration = CacheDurations.ServiceData;
private static readonly TimeSpan s_providerCacheDuration = CacheDurations.AuthenticatedClient;
///
diff --git a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/Sku/SkuGetCommand.cs b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/Sku/SkuGetCommand.cs
index 4e5980c500..fefbdb7658 100644
--- a/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/Sku/SkuGetCommand.cs
+++ b/tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/FileSystem/Sku/SkuGetCommand.cs
@@ -3,14 +3,11 @@
using Azure.Mcp.Core.Commands.Subscription;
using Azure.Mcp.Core.Services.Azure.Subscription;
-using Azure.Mcp.Tools.ManagedLustre.Options;
using Azure.Mcp.Tools.ManagedLustre.Options.FileSystem.Sku;
using Azure.Mcp.Tools.ManagedLustre.Services;
using Microsoft.Extensions.Logging;
using Microsoft.Mcp.Core.Commands;
-using Microsoft.Mcp.Core.Extensions;
using Microsoft.Mcp.Core.Models.Command;
-using Microsoft.Mcp.Core.Models.Option;
namespace Azure.Mcp.Tools.ManagedLustre.Commands.FileSystem.Sku;
diff --git a/tools/Azure.Mcp.Tools.Marketplace/src/Services/MarketplaceService.cs b/tools/Azure.Mcp.Tools.Marketplace/src/Services/MarketplaceService.cs
index e15ea03b90..58a2a9d47b 100644
--- a/tools/Azure.Mcp.Tools.Marketplace/src/Services/MarketplaceService.cs
+++ b/tools/Azure.Mcp.Tools.Marketplace/src/Services/MarketplaceService.cs
@@ -33,6 +33,7 @@ public class MarketplaceService(ITenantService tenantService)
/// Include service instruction templates.
/// Optional. The Azure tenant ID for authentication.
/// Optional. Policy parameters for retrying failed requests.
+ /// Cancellation token for the operation.
/// A JSON node containing the product information.
/// Thrown when required parameters are missing or invalid.
/// Thrown when parsing the product response fails.
@@ -73,6 +74,7 @@ public async Task GetProduct(
/// OData expand expression to include related data.
/// Optional. The Azure tenant ID for authentication.
/// Optional. Policy parameters for retrying failed requests.
+ /// Cancellation token for the operation.
/// A list of ProductSummary objects containing the marketplace products.
/// Thrown when required parameters are missing or invalid.
/// Thrown when parsing the products response fails.
diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Detectors/DotNetAppTypeDetector.cs b/tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Detectors/DotNetAppTypeDetector.cs
index 00d956eb88..3b76d7babf 100644
--- a/tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Detectors/DotNetAppTypeDetector.cs
+++ b/tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Detectors/DotNetAppTypeDetector.cs
@@ -172,7 +172,7 @@ private ProjectInfo DetectLegacyProjectType(string csprojPath, XDocument doc)
else if (IsClassicAspNet(projectDir, doc))
{
// Differentiate between MVC and WebForms
- if (HasMvcIndicators(projectDir, doc))
+ if (HasMvcIndicators(projectDir))
{
appType = AppType.AspNetMvc;
entryPoint = FindGlobalAsax(projectDir);
@@ -376,7 +376,7 @@ private bool IsClassicAspNet(string projectDir, XDocument doc)
return false;
}
- private static bool HasMvcIndicators(string projectDir, XDocument doc)
+ private static bool HasMvcIndicators(string projectDir)
{
// Check for MVC packages
var packagesConfig = Path.Combine(projectDir, "packages.config");
diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Pipeline/WorkspaceAnalyzer.cs b/tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Pipeline/WorkspaceAnalyzer.cs
index 354d1b36e1..7111023c37 100644
--- a/tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Pipeline/WorkspaceAnalyzer.cs
+++ b/tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Pipeline/WorkspaceAnalyzer.cs
@@ -3,7 +3,6 @@
using Azure.Mcp.Tools.Monitor.Instrumentation.Detectors;
using Azure.Mcp.Tools.Monitor.Instrumentation.Generators;
-using Azure.Mcp.Tools.Monitor.Models;
using Azure.Mcp.Tools.Monitor.Models.Instrumentation;
using static Azure.Mcp.Tools.Monitor.Models.Instrumentation.OnboardingConstants;
diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Models/MetricTimeSeries.cs b/tools/Azure.Mcp.Tools.Monitor/src/Models/MetricTimeSeries.cs
index 8e1e2a2374..2bb09726d4 100644
--- a/tools/Azure.Mcp.Tools.Monitor/src/Models/MetricTimeSeries.cs
+++ b/tools/Azure.Mcp.Tools.Monitor/src/Models/MetricTimeSeries.cs
@@ -3,76 +3,75 @@
using System.Text.Json.Serialization;
-namespace Azure.Mcp.Tools.Monitor.Models
+namespace Azure.Mcp.Tools.Monitor.Models;
+
+///
+/// Represents a compact time series optimized for minimal JSON payload
+///
+public class MetricTimeSeries
{
///
- /// Represents a compact time series optimized for minimal JSON payload
+ /// The dimension metadata for this time series (omitted if empty)
///
- public class MetricTimeSeries
- {
- ///
- /// The dimension metadata for this time series (omitted if empty)
- ///
- [JsonPropertyName("metadata")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
- public Dictionary Metadata { get; set; } = new();
+ [JsonPropertyName("metadata")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
+ public Dictionary Metadata { get; set; } = new();
- ///
- /// Start time of the time series
- ///
- [JsonPropertyName("start")]
- public DateTime Start { get; set; }
+ ///
+ /// Start time of the time series
+ ///
+ [JsonPropertyName("start")]
+ public DateTime Start { get; set; }
- ///
- /// End time of the time series
- ///
- [JsonPropertyName("end")]
- public DateTime End { get; set; }
+ ///
+ /// End time of the time series
+ ///
+ [JsonPropertyName("end")]
+ public DateTime End { get; set; }
- ///
- /// Time grain (interval) between data points (e.g., "PT1M" for 1 minute)
- ///
- [JsonPropertyName("interval")]
- public string Interval { get; set; } = string.Empty;
+ ///
+ /// Time grain (interval) between data points (e.g., "PT1M" for 1 minute)
+ ///
+ [JsonPropertyName("interval")]
+ public string Interval { get; set; } = string.Empty;
- ///
- /// Array of average values (omitted if no average values)
- ///
- [JsonPropertyName("avgBuckets")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonConverter(typeof(RoundedDoubleArrayConverter))]
- public double[]? AvgBuckets { get; set; }
+ ///
+ /// Array of average values (omitted if no average values)
+ ///
+ [JsonPropertyName("avgBuckets")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonConverter(typeof(RoundedDoubleArrayConverter))]
+ public double[]? AvgBuckets { get; set; }
- ///
- /// Array of minimum values (omitted if no minimum values)
- ///
- [JsonPropertyName("minBuckets")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonConverter(typeof(RoundedDoubleArrayConverter))]
- public double[]? MinBuckets { get; set; }
+ ///
+ /// Array of minimum values (omitted if no minimum values)
+ ///
+ [JsonPropertyName("minBuckets")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonConverter(typeof(RoundedDoubleArrayConverter))]
+ public double[]? MinBuckets { get; set; }
- ///
- /// Array of maximum values (omitted if no maximum values)
- ///
- [JsonPropertyName("maxBuckets")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonConverter(typeof(RoundedDoubleArrayConverter))]
- public double[]? MaxBuckets { get; set; }
+ ///
+ /// Array of maximum values (omitted if no maximum values)
+ ///
+ [JsonPropertyName("maxBuckets")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonConverter(typeof(RoundedDoubleArrayConverter))]
+ public double[]? MaxBuckets { get; set; }
- ///
- /// Array of total values (omitted if no total values)
- ///
- [JsonPropertyName("totalBuckets")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonConverter(typeof(RoundedDoubleArrayConverter))]
- public double[]? TotalBuckets { get; set; }
+ ///
+ /// Array of total values (omitted if no total values)
+ ///
+ [JsonPropertyName("totalBuckets")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonConverter(typeof(RoundedDoubleArrayConverter))]
+ public double[]? TotalBuckets { get; set; }
- ///
- /// Array of count values (omitted if no count values)
- ///
- [JsonPropertyName("countBuckets")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonConverter(typeof(RoundedDoubleArrayConverter))]
- public double[]? CountBuckets { get; set; }
- }
+ ///
+ /// Array of count values (omitted if no count values)
+ ///
+ [JsonPropertyName("countBuckets")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonConverter(typeof(RoundedDoubleArrayConverter))]
+ public double[]? CountBuckets { get; set; }
}
diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Models/RoundedDoubleArrayConverter.cs b/tools/Azure.Mcp.Tools.Monitor/src/Models/RoundedDoubleArrayConverter.cs
index 03d8ec9b3e..5d3271fd7e 100644
--- a/tools/Azure.Mcp.Tools.Monitor/src/Models/RoundedDoubleArrayConverter.cs
+++ b/tools/Azure.Mcp.Tools.Monitor/src/Models/RoundedDoubleArrayConverter.cs
@@ -4,43 +4,42 @@
using System.Text.Json;
using System.Text.Json.Serialization;
-namespace Azure.Mcp.Tools.Monitor.Models
+namespace Azure.Mcp.Tools.Monitor.Models;
+
+///
+/// Custom JSON converter that rounds double arrays to 2 decimal places
+///
+public class RoundedDoubleArrayConverter : JsonConverter
{
- ///
- /// Custom JSON converter that rounds double arrays to 2 decimal places
- ///
- public class RoundedDoubleArrayConverter : JsonConverter
+ public override double[]? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
- public override double[]? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
- {
- if (reader.TokenType == JsonTokenType.Null)
- return null;
+ if (reader.TokenType == JsonTokenType.Null)
+ return null;
- var list = new List();
- if (reader.TokenType == JsonTokenType.StartArray)
+ var list = new List();
+ if (reader.TokenType == JsonTokenType.StartArray)
+ {
+ while (reader.Read() && reader.TokenType != JsonTokenType.EndArray)
{
- while (reader.Read() && reader.TokenType != JsonTokenType.EndArray)
- {
- list.Add(reader.GetDouble());
- }
+ list.Add(reader.GetDouble());
}
- return [.. list];
}
+ return [.. list];
+ }
- public override void Write(Utf8JsonWriter writer, double[]? value, JsonSerializerOptions options)
+ public override void Write(Utf8JsonWriter writer, double[]? value, JsonSerializerOptions options)
+ {
+ if (value == null)
{
- if (value == null)
- {
- writer.WriteNullValue();
- return;
- }
+ writer.WriteNullValue();
+ return;
+ }
- writer.WriteStartArray();
- foreach (var item in value)
- {
- writer.WriteNumberValue(Math.Round(item, 2));
- }
- writer.WriteEndArray();
+ writer.WriteStartArray();
+ foreach (var item in value)
+ {
+ writer.WriteNumberValue(Math.Round(item, 2));
}
+ writer.WriteEndArray();
}
}
diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Services/IResourceResolverService.cs b/tools/Azure.Mcp.Tools.Monitor/src/Services/IResourceResolverService.cs
index e53a5bbef7..f482bf2308 100644
--- a/tools/Azure.Mcp.Tools.Monitor/src/Services/IResourceResolverService.cs
+++ b/tools/Azure.Mcp.Tools.Monitor/src/Services/IResourceResolverService.cs
@@ -20,6 +20,7 @@ public interface IResourceResolverService
/// The resource name or full resource ID
/// Optional tenant ID for multi-tenant scenarios
/// Optional retry policy parameters
+ /// Cancellation token for the operation
/// The full Azure resource ID
Task ResolveResourceIdAsync(
string subscription,
diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorHealthModelService.cs b/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorHealthModelService.cs
index 57f2c1984a..4435f98e57 100644
--- a/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorHealthModelService.cs
+++ b/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorHealthModelService.cs
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
-using System.Linq;
-using Azure;
using Azure.Mcp.Core.Services.Azure;
using Azure.Mcp.Core.Services.Azure.Subscription;
using Azure.Mcp.Core.Services.Azure.Tenant;
diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorService.cs b/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorService.cs
index a74ebae1fe..662abe1ffc 100644
--- a/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorService.cs
+++ b/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorService.cs
@@ -385,7 +385,7 @@ public async Task> ListActivityLogs(
?? throw new ArgumentException($"Unable to extract subscription ID from resource ID: {resourceId}");
// Get the activity logs from the Azure Management API
- var activityLogs = await CallActivityLogApiAsync(subscriptionId, resourceId, hours, eventLevel, tenant, retryPolicy, cancellationToken);
+ var activityLogs = await CallActivityLogApiAsync(subscriptionId, resourceId, hours, eventLevel, tenant, cancellationToken);
// Take only the requested number of logs
return activityLogs.Take(top).ToList();
@@ -397,7 +397,6 @@ private async Task> CallActivityLogApiAsync(
double hours,
ActivityLogEventLevel? eventLevel,
string? tenant,
- RetryPolicyOptions? retryPolicy,
CancellationToken cancellationToken)
{
var returnValue = new List();
diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorWebTestService.cs b/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorWebTestService.cs
index aa6c99187b..890aa63bdb 100644
--- a/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorWebTestService.cs
+++ b/tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorWebTestService.cs
@@ -10,7 +10,6 @@
using Azure.Mcp.Tools.Monitor.Models.WebTests;
using Azure.ResourceManager.ApplicationInsights;
using Azure.ResourceManager.ApplicationInsights.Models;
-using Microsoft.Extensions.Logging;
using Microsoft.Mcp.Core.Helpers;
using Microsoft.Mcp.Core.Options;
@@ -19,13 +18,11 @@ namespace Azure.Mcp.Tools.Monitor.Services;
public class MonitorWebTestService(
ISubscriptionService subscriptionService,
ITenantService tenantService,
- IResourceGroupService resourceGroupService,
- ILogger logger)
+ IResourceGroupService resourceGroupService)
: BaseAzureService(tenantService), IMonitorWebTestService
{
private readonly ISubscriptionService _subscriptionService = subscriptionService ?? throw new ArgumentNullException(nameof(subscriptionService));
private readonly IResourceGroupService _resourceGroupService = resourceGroupService ?? throw new ArgumentNullException(nameof(resourceGroupService));
- private readonly ILogger _logger = logger ?? throw new ArgumentNullException(nameof(logger));
public async Task> ListWebTests(
string subscription,
diff --git a/tools/Azure.Mcp.Tools.Monitor/src/Tools/Instrumentation/OrchestratorTool.cs b/tools/Azure.Mcp.Tools.Monitor/src/Tools/Instrumentation/OrchestratorTool.cs
index 4fe36893b4..82f7624c3d 100644
--- a/tools/Azure.Mcp.Tools.Monitor/src/Tools/Instrumentation/OrchestratorTool.cs
+++ b/tools/Azure.Mcp.Tools.Monitor/src/Tools/Instrumentation/OrchestratorTool.cs
@@ -130,7 +130,9 @@ public string Start(string workspacePath)
});
}
+#pragma warning disable IDE0060 // Remove unused parameter
public string Next(string sessionId, string completionNote)
+#pragma warning restore IDE0060 // Remove unused parameter
{
CleanupExpiredSessions();
diff --git a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Log/WorkspaceLogQueryCommandTests.cs b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Log/WorkspaceLogQueryCommandTests.cs
index 052062be1f..c617db1a5d 100644
--- a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Log/WorkspaceLogQueryCommandTests.cs
+++ b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Log/WorkspaceLogQueryCommandTests.cs
@@ -17,7 +17,6 @@ public sealed class WorkspaceLogQueryCommandTests : SubscriptionCommandUnitTests
{
private const string _knownSubscription = "knownSubscription";
private const string _knownWorkspace = "knownWorkspace";
- private const string _knownResourceGroup = "knownResourceGroup";
private const string _knownTable = "knownTable";
private const string _knownTenant = "knownTenant";
private const string _knownHours = "24";
diff --git a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Metrics/MonitorMetricsServiceTests.cs b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Metrics/MonitorMetricsServiceTests.cs
index b0bd28a834..508853af04 100644
--- a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Metrics/MonitorMetricsServiceTests.cs
+++ b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/Metrics/MonitorMetricsServiceTests.cs
@@ -22,7 +22,6 @@ public class MonitorMetricsServiceTests
private const string TestResourceType = "Microsoft.Storage/storageAccounts";
private const string TestResourceName = "test";
private const string TestResourceId = "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/test";
- private const string TestTenant = "tenant-123";
public MonitorMetricsServiceTests()
{
diff --git a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/MonitorCommandTests.cs b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/MonitorCommandTests.cs
index 9206fbddb3..b2c62ae026 100644
--- a/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/MonitorCommandTests.cs
+++ b/tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.Tests/MonitorCommandTests.cs
@@ -10,7 +10,6 @@
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Mcp.Core.Services.Azure.Authentication;
using Microsoft.Mcp.Core.Services.Caching;
@@ -25,15 +24,10 @@ namespace Azure.Mcp.Tools.Monitor.Tests;
public sealed class MonitorCommandTests : RecordedCommandTestsBase
{
- private LogAnalyticsHelper? _logHelper;
- private const string TestLogType = "TestLogs_CL";
private readonly ServiceProvider _httpClientProvider;
private readonly MemoryCache _memoryCache;
private readonly ITenantService _tenantService;
- private readonly IMonitorService _monitorService;
private readonly IHttpClientFactory _httpClientFactory;
- private readonly ILogger _logger;
- private string? _storageAccountName;
private string? _appInsightsName;
private string? _bingWebTestName;
private string? _healthModelParentName;
@@ -70,8 +64,6 @@ public MonitorCommandTests(ITestOutputHelper output, TestProxyFixture fixture, L
var subscriptionService = new SubscriptionService(cacheService, _tenantService, NullLogger.Instance);
var resourceGroupService = new ResourceGroupService(cacheService, subscriptionService, _tenantService);
var resourceResolverService = new ResourceResolverService(subscriptionService, _tenantService);
- _logger = NullLogger.Instance;
- _monitorService = new MonitorService(subscriptionService, _tenantService, resourceGroupService, resourceResolverService, _httpClientFactory, _logger);
}
public override List UriRegexSanitizers { get; } =
@@ -117,7 +109,6 @@ public MonitorCommandTests(ITestOutputHelper output, TestProxyFixture fixture, L
public override async ValueTask InitializeAsync()
{
await base.InitializeAsync();
- _storageAccountName = $"{Settings.ResourceBaseName}mon";
_appInsightsName = $"{Settings.ResourceBaseName}-ai";
_bingWebTestName = $"{Settings.ResourceBaseName}-bing-test";
_healthModelParentName = $"{Settings.ResourceBaseName}-hm-a";
@@ -127,16 +118,6 @@ public override async ValueTask InitializeAsync()
{
return;
}
-
- _logHelper = new LogAnalyticsHelper(
- Settings.ResourceBaseName,
- Settings.SubscriptionId,
- _monitorService,
- _tenantService,
- _httpClientFactory,
- Settings.TenantId,
- TestLogType,
- NullLogger.Instance);
}
public override async ValueTask DisposeAsync()
diff --git a/tools/Azure.Mcp.Tools.Postgres/src/Options/AuthTypes.cs b/tools/Azure.Mcp.Tools.Postgres/src/Options/AuthTypes.cs
index a5b6bd7669..3b8fc8cf16 100644
--- a/tools/Azure.Mcp.Tools.Postgres/src/Options/AuthTypes.cs
+++ b/tools/Azure.Mcp.Tools.Postgres/src/Options/AuthTypes.cs
@@ -1,12 +1,11 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
-namespace Azure.Mcp.Tools.Postgres.Options
+namespace Azure.Mcp.Tools.Postgres.Options;
+
+public static class AuthTypes
{
- public class AuthTypes
- {
- public const string MicrosoftEntra = "MicrosoftEntra";
+ public const string MicrosoftEntra = "MicrosoftEntra";
- public const string PostgreSQL = "PostgreSQL";
- }
+ public const string PostgreSQL = "PostgreSQL";
}
diff --git a/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.Tests/Services/PostgresServiceRowLimitTests.cs b/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.Tests/Services/PostgresServiceRowLimitTests.cs
index ee602f5427..28b150c9cf 100644
--- a/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.Tests/Services/PostgresServiceRowLimitTests.cs
+++ b/tools/Azure.Mcp.Tools.Postgres/tests/Azure.Mcp.Tools.Postgres.Tests/Services/PostgresServiceRowLimitTests.cs
@@ -24,8 +24,6 @@ public class PostgresServiceRowLimitTests
private readonly IDbProvider _dbProvider = Substitute.For();
private readonly PostgresService _postgresService;
- private const string SubscriptionId = "test-sub";
- private const string ResourceGroup = "test-rg";
private const string User = "test-user";
private const string Server = "test-server";
private const string Database = "test-db";
diff --git a/tools/Azure.Mcp.Tools.ResourceHealth/src/Services/IResourceHealthService.cs b/tools/Azure.Mcp.Tools.ResourceHealth/src/Services/IResourceHealthService.cs
index 53dda36d46..d1216c25dd 100644
--- a/tools/Azure.Mcp.Tools.ResourceHealth/src/Services/IResourceHealthService.cs
+++ b/tools/Azure.Mcp.Tools.ResourceHealth/src/Services/IResourceHealthService.cs
@@ -13,6 +13,7 @@ public interface IResourceHealthService
///
/// The Azure resource ID
/// Optional retry policy configuration
+ /// Cancellation token
/// The availability status of the resource
/// When the service request fails
Task GetAvailabilityStatusAsync(
@@ -27,6 +28,7 @@ Task GetAvailabilityStatusAsync(
/// Optional resource group name to filter results
/// Optional tenant ID
/// Optional retry policy configuration
+ /// Cancellation token
/// List of availability statuses for resources
/// When the service request fails
Task> ListAvailabilityStatusesAsync(
@@ -48,6 +50,7 @@ Task> ListAvailabilityStatusesAsync(
/// Optional end time for the query
/// Optional tenant ID
/// Optional retry policy configuration
+ /// Cancellation token
/// List of service health events
/// When the service request fails
Task> ListServiceHealthEventsAsync(
diff --git a/tools/Azure.Mcp.Tools.ServiceBus/src/Services/IServiceBusService.cs b/tools/Azure.Mcp.Tools.ServiceBus/src/Services/IServiceBusService.cs
index 122df0e301..1470a3d659 100644
--- a/tools/Azure.Mcp.Tools.ServiceBus/src/Services/IServiceBusService.cs
+++ b/tools/Azure.Mcp.Tools.ServiceBus/src/Services/IServiceBusService.cs
@@ -17,6 +17,7 @@ public interface IServiceBusService
/// The subscription name to get details for
/// Optional tenant ID
/// Optional retry policy
+ /// Cancellation token
/// Subscription details
/// When the service request fails
Task GetSubscriptionDetails(
@@ -32,9 +33,9 @@ Task GetSubscriptionDetails(
///
/// The Service Bus namespace name
/// The queue name to get details for
- /// Subscription ID or name
/// Optional tenant ID
/// Optional retry policy
+ /// Cancellation token
/// Queue details
/// When the service request fails
Task GetQueueDetails(
@@ -51,6 +52,7 @@ Task GetQueueDetails(
/// The topic name to get details for
/// Optional tenant ID
/// Optional retry policy
+ /// Cancellation token
/// Topic details
/// When the service request fails
Task GetTopicDetails(
@@ -66,9 +68,9 @@ Task GetTopicDetails(
/// The Service Bus namespace name
/// The queue name to peek messages from
/// Maximum number of messages to peek (default: 1)
- /// Subscription ID or name
/// Optional tenant ID
/// Optional retry policy
+ /// Cancellation token
/// List of peeked messages
/// When the service request fails
Task> PeekQueueMessages(
@@ -86,9 +88,9 @@ Task> PeekQueueMessages(
/// The topic name containing the subscription
/// The subscription name to peek messages from
/// Maximum number of messages to peek (default: 1)
- /// Subscription ID or name
/// Optional tenant ID
/// Optional retry policy
+ /// Cancellation token
/// List of peeked messages
/// When the service request fails
Task> PeekSubscriptionMessages(
diff --git a/tools/Azure.Mcp.Tools.Speech/src/Services/Recognizers/IFastTranscriptionRecognizer.cs b/tools/Azure.Mcp.Tools.Speech/src/Services/Recognizers/IFastTranscriptionRecognizer.cs
index efa938e98c..5ae03617b6 100644
--- a/tools/Azure.Mcp.Tools.Speech/src/Services/Recognizers/IFastTranscriptionRecognizer.cs
+++ b/tools/Azure.Mcp.Tools.Speech/src/Services/Recognizers/IFastTranscriptionRecognizer.cs
@@ -20,6 +20,7 @@ public interface IFastTranscriptionRecognizer
/// Optional phrases to improve recognition accuracy
/// Profanity filtering option
/// Optional retry policy for resilience
+ /// Cancellation token for the operation
/// Continuous recognition result converted from Fast Transcription response
Task RecognizeAsync(
string endpoint,
diff --git a/tools/Azure.Mcp.Tools.Speech/tests/Azure.Mcp.Tools.Speech.Tests/Services/SpeechServiceTests.cs b/tools/Azure.Mcp.Tools.Speech/tests/Azure.Mcp.Tools.Speech.Tests/Services/SpeechServiceTests.cs
index b79fc473c3..91686c00cf 100644
--- a/tools/Azure.Mcp.Tools.Speech/tests/Azure.Mcp.Tools.Speech.Tests/Services/SpeechServiceTests.cs
+++ b/tools/Azure.Mcp.Tools.Speech/tests/Azure.Mcp.Tools.Speech.Tests/Services/SpeechServiceTests.cs
@@ -18,7 +18,6 @@ public class SpeechServiceTests
private readonly IFastTranscriptionRecognizer _fastTranscriptionRecognizer;
private readonly IRealtimeTranscriptionRecognizer _realtimeTranscriptionRecognizer;
private readonly IRealtimeTtsSynthesizer _realtimeTtsSynthesizer;
- private readonly SpeechService _speechService;
public SpeechServiceTests()
{
@@ -27,8 +26,6 @@ public SpeechServiceTests()
_fastTranscriptionRecognizer = Substitute.For();
_realtimeTranscriptionRecognizer = Substitute.For();
_realtimeTtsSynthesizer = Substitute.For();
-
- _speechService = new SpeechService(_tenantService, _logger, _fastTranscriptionRecognizer, _realtimeTranscriptionRecognizer, _realtimeTtsSynthesizer);
}
[Fact]
diff --git a/tools/Azure.Mcp.Tools.Sql/src/Commands/Server/ServerCreateCommand.cs b/tools/Azure.Mcp.Tools.Sql/src/Commands/Server/ServerCreateCommand.cs
index bddde472d9..43a272d921 100644
--- a/tools/Azure.Mcp.Tools.Sql/src/Commands/Server/ServerCreateCommand.cs
+++ b/tools/Azure.Mcp.Tools.Sql/src/Commands/Server/ServerCreateCommand.cs
@@ -5,12 +5,10 @@
using Azure.Mcp.Core.Commands.Subscription;
using Azure.Mcp.Core.Services.Azure.Subscription;
using Azure.Mcp.Tools.Sql.Models;
-using Azure.Mcp.Tools.Sql.Options;
using Azure.Mcp.Tools.Sql.Options.Server;
using Azure.Mcp.Tools.Sql.Services;
using Microsoft.Extensions.Logging;
using Microsoft.Mcp.Core.Commands;
-using Microsoft.Mcp.Core.Extensions;
using Microsoft.Mcp.Core.Models.Command;
namespace Azure.Mcp.Tools.Sql.Commands.Server;
diff --git a/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlDatabaseData.cs b/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlDatabaseData.cs
index 31005c67c2..c4f9c2cb93 100644
--- a/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlDatabaseData.cs
+++ b/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlDatabaseData.cs
@@ -1,4 +1,4 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System.Text.Json;
diff --git a/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlDatabaseProperties.cs b/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlDatabaseProperties.cs
index e745add33b..a689c1dd6f 100644
--- a/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlDatabaseProperties.cs
+++ b/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlDatabaseProperties.cs
@@ -1,4 +1,4 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System.Text.Json.Serialization;
diff --git a/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlFirewallRuleData.cs b/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlFirewallRuleData.cs
index 307ca5f930..37532a64e8 100644
--- a/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlFirewallRuleData.cs
+++ b/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlFirewallRuleData.cs
@@ -1,4 +1,4 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System.Text.Json;
diff --git a/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlFirewallRuleProperties.cs b/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlFirewallRuleProperties.cs
index 29830d25c7..6aa3efe608 100644
--- a/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlFirewallRuleProperties.cs
+++ b/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlFirewallRuleProperties.cs
@@ -1,4 +1,4 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System.Text.Json.Serialization;
diff --git a/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlServerAadAdministratorData.cs b/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlServerAadAdministratorData.cs
index c388378903..28084cc4ff 100644
--- a/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlServerAadAdministratorData.cs
+++ b/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlServerAadAdministratorData.cs
@@ -1,4 +1,4 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System.Text.Json;
diff --git a/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlServerAadAdministratorProperties.cs b/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlServerAadAdministratorProperties.cs
index 7b8845b5ef..05d24dd23d 100644
--- a/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlServerAadAdministratorProperties.cs
+++ b/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlServerAadAdministratorProperties.cs
@@ -1,4 +1,4 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System.Text.Json.Serialization;
diff --git a/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlSku.cs b/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlSku.cs
index 48736f3460..a98c2ccefe 100644
--- a/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlSku.cs
+++ b/tools/Azure.Mcp.Tools.Sql/src/Services/Models/SqlSku.cs
@@ -1,4 +1,4 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Azure.Mcp.Tools.Sql.Services.Models;
diff --git a/tools/Azure.Mcp.Tools.Sql/src/Services/SqlService.cs b/tools/Azure.Mcp.Tools.Sql/src/Services/SqlService.cs
index e1b92a6a49..8eee8be34a 100644
--- a/tools/Azure.Mcp.Tools.Sql/src/Services/SqlService.cs
+++ b/tools/Azure.Mcp.Tools.Sql/src/Services/SqlService.cs
@@ -2,7 +2,6 @@
// Licensed under the MIT License.
using System.Net;
-using System.Text.Json;
using Azure.Core;
using Azure.Mcp.Core.Services.Azure;
using Azure.Mcp.Core.Services.Azure.Subscription;
@@ -918,36 +917,6 @@ private static SqlDatabase ConvertToSqlDatabaseModel(SqlDatabaseResource databas
);
}
- private static SqlDatabase ConvertToSqlDatabaseModel(JsonElement item)
- {
- Models.SqlDatabaseData? sqlDatabase = Models.SqlDatabaseData.FromJson(item)
- ?? throw new InvalidOperationException("Failed to parse SQL database data");
-
- return new(
- Name: sqlDatabase.ResourceName ?? "Unknown",
- Id: sqlDatabase.ResourceId ?? "Unknown",
- Type: sqlDatabase.ResourceType ?? "Unknown",
- Location: sqlDatabase.Location,
- Sku: sqlDatabase.Sku != null ? new(
- Name: sqlDatabase.Sku.Name,
- Tier: sqlDatabase.Sku.Tier,
- Capacity: sqlDatabase.Sku.Capacity,
- Family: sqlDatabase.Sku.Family,
- Size: sqlDatabase.Sku.Size
- ) : null,
- Status: sqlDatabase.Properties?.Status,
- Collation: sqlDatabase.Properties?.Collation,
- CreationDate: sqlDatabase.Properties?.CreatedOn,
- MaxSizeBytes: sqlDatabase.Properties?.MaxSizeBytes,
- ServiceLevelObjective: sqlDatabase.Properties?.CurrentServiceObjectiveName,
- Edition: sqlDatabase.Properties?.CurrentSku?.Name,
- ElasticPoolName: sqlDatabase.Properties?.ElasticPoolId?.ToString().Split('/').LastOrDefault(),
- EarliestRestoreDate: sqlDatabase.Properties?.EarliestRestoreOn,
- ReadScale: sqlDatabase.Properties?.ReadScale,
- ZoneRedundant: sqlDatabase.Properties?.IsZoneRedundant
- );
- }
-
private static SqlServer ConvertToSqlServerModel(SqlServerResource serverResource)
{
ArgumentNullException.ThrowIfNull(serverResource);
diff --git a/tools/Azure.Mcp.Tools.SreAgent/src/Models/SreAgentThreadModels.cs b/tools/Azure.Mcp.Tools.SreAgent/src/Models/SreAgentThreadModels.cs
index 183f7f1e52..e940463862 100644
--- a/tools/Azure.Mcp.Tools.SreAgent/src/Models/SreAgentThreadModels.cs
+++ b/tools/Azure.Mcp.Tools.SreAgent/src/Models/SreAgentThreadModels.cs
@@ -2,7 +2,6 @@
// Licensed under the MIT License.
using System.Text.Json;
-using System.Text.Json.Serialization;
namespace Azure.Mcp.Tools.SreAgent.Models;
diff --git a/tools/Azure.Mcp.Tools.SreAgent/src/Options/ScheduledTasks/ScheduledTasksDeleteOptions.cs b/tools/Azure.Mcp.Tools.SreAgent/src/Options/ScheduledTasks/ScheduledTasksDeleteOptions.cs
index 5cc55f83c8..c94c4facd9 100644
--- a/tools/Azure.Mcp.Tools.SreAgent/src/Options/ScheduledTasks/ScheduledTasksDeleteOptions.cs
+++ b/tools/Azure.Mcp.Tools.SreAgent/src/Options/ScheduledTasks/ScheduledTasksDeleteOptions.cs
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
-using Azure.Mcp.Core.Options;
using Microsoft.Mcp.Core.Options;
namespace Azure.Mcp.Tools.SreAgent.Options.ScheduledTasks;
diff --git a/tools/Azure.Mcp.Tools.SreAgent/src/Services/ISreAgentService.cs b/tools/Azure.Mcp.Tools.SreAgent/src/Services/ISreAgentService.cs
index bcbef0cc3a..fa65fb380c 100644
--- a/tools/Azure.Mcp.Tools.SreAgent/src/Services/ISreAgentService.cs
+++ b/tools/Azure.Mcp.Tools.SreAgent/src/Services/ISreAgentService.cs
@@ -2,7 +2,6 @@
// Licensed under the MIT License.
using Azure.Mcp.Tools.SreAgent.Models;
-using Azure.Mcp.Tools.SreAgent.Options.Threads;
using Microsoft.Mcp.Core.Options;
namespace Azure.Mcp.Tools.SreAgent.Services;
diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/AssemblyAttributes.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/AssemblyAttributes.cs
index 9596e9a4eb..92cc1acc9f 100644
--- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/AssemblyAttributes.cs
+++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/AssemblyAttributes.cs
@@ -1,2 +1,5 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
[assembly: Microsoft.Mcp.Tests.Helpers.ClearEnvironmentVariablesBeforeTest]
[assembly: Xunit.CollectionBehavior(Xunit.CollectionBehavior.CollectionPerAssembly)]
diff --git a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/SreAgentCommandTests.cs b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/SreAgentCommandTests.cs
index 06906ce609..5a8524a3f0 100644
--- a/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/SreAgentCommandTests.cs
+++ b/tools/Azure.Mcp.Tools.SreAgent/tests/Azure.Mcp.Tools.SreAgent.Tests/SreAgentCommandTests.cs
@@ -6,25 +6,25 @@
using Microsoft.Mcp.Tests.Generated.Models;
using Xunit;
-namespace Azure.Mcp.Tools.SreAgent.Tests
+namespace Azure.Mcp.Tools.SreAgent.Tests;
+
+public class SreAgentCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture)
+ : RecordedCommandTestsBase(output, fixture, liveServerFixture)
{
- public class SreAgentCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture)
- : RecordedCommandTestsBase(output, fixture, liveServerFixture)
+ // Disable body comparison: SRE Agent data-plane responses contain dynamic fields
+ // (timestamps, generated IDs, system state) that would cause spurious playback mismatches.
+ public override CustomDefaultMatcher? TestMatcher => new()
{
- // Disable body comparison: SRE Agent data-plane responses contain dynamic fields
- // (timestamps, generated IDs, system state) that would cause spurious playback mismatches.
- public override CustomDefaultMatcher? TestMatcher => new()
- {
- ExcludedHeaders = "Authorization,Content-Type",
- CompareBodies = false
- };
-
- // Sanitize SRE Agent data-plane hostname in response bodies so recordings don't
- // contain the real resource name (e.g. "mcpfb80ce3a--e5d0b29a.00632926.eastus2.azuresre.ai").
- // Also sanitize tenant IDs and Owners fields (resource creator alias) from response bodies.
- public override List BodyRegexSanitizers =>
- [
- new BodyRegexSanitizer(new BodyRegexSanitizerBody
+ ExcludedHeaders = "Authorization,Content-Type",
+ CompareBodies = false
+ };
+
+ // Sanitize SRE Agent data-plane hostname in response bodies so recordings don't
+ // contain the real resource name (e.g. "mcpfb80ce3a--e5d0b29a.00632926.eastus2.azuresre.ai").
+ // Also sanitize tenant IDs and Owners fields (resource creator alias) from response bodies.
+ public override List BodyRegexSanitizers =>
+ [
+ new BodyRegexSanitizer(new BodyRegexSanitizerBody
{
Regex = @"(?<=https://)(?[^/""\s]+\.azuresre\.ai)",
GroupForReplace = "host",
@@ -42,387 +42,386 @@ public class SreAgentCommandTests(ITestOutputHelper output, TestProxyFixture fix
GroupForReplace = "owner",
Value = "sanitized"
})
- ];
+ ];
- // Sanitize SRE Agent data-plane hostname in request/response URIs.
- public override List UriRegexSanitizers =>
- [
- new UriRegexSanitizer(new UriRegexSanitizerBody
+ // Sanitize SRE Agent data-plane hostname in request/response URIs.
+ public override List UriRegexSanitizers =>
+ [
+ new UriRegexSanitizer(new UriRegexSanitizerBody
{
Regex = @"(?<=https://)(?[^/]+\.azuresre\.ai)",
GroupForReplace = "host",
Value = "sanitized.eastus2.azuresre.ai"
})
- ];
+ ];
- // Sanitize x-ms-operation-identifier response header which contains real tenant ID and object ID.
- public override List HeaderRegexSanitizers =>
- [
- new HeaderRegexSanitizer(new HeaderRegexSanitizerBody("x-ms-operation-identifier")
+ // Sanitize x-ms-operation-identifier response header which contains real tenant ID and object ID.
+ public override List HeaderRegexSanitizers =>
+ [
+ new HeaderRegexSanitizer(new HeaderRegexSanitizerBody("x-ms-operation-identifier")
{
Value = "sanitized"
})
- ];
-
- [Fact]
- public async Task Should_list_sre_agents_by_subscription_id()
- {
- var result = await CallToolAsync(
- "sreagent_agents_list",
- new()
- {
+ ];
+
+ [Fact]
+ public async Task Should_list_sre_agents_by_subscription_id()
+ {
+ var result = await CallToolAsync(
+ "sreagent_agents_list",
+ new()
+ {
{ "subscription", Settings.SubscriptionId }
- });
-
- // Result may be an array directly or wrapped; just assert call succeeded.
- Assert.NotNull(result);
- }
-
- [Fact]
- public async Task Should_get_sre_agent_details()
- {
- var result = await CallToolAsync(
- "sreagent_agents_get",
- new()
- {
+ });
+
+ // Result may be an array directly or wrapped; just assert call succeeded.
+ Assert.NotNull(result);
+ }
+
+ [Fact]
+ public async Task Should_get_sre_agent_details()
+ {
+ var result = await CallToolAsync(
+ "sreagent_agents_get",
+ new()
+ {
{ "subscription", Settings.SubscriptionId },
{ "resource-group", Settings.ResourceGroupName },
{ "agent", Settings.ResourceBaseName }
- });
-
- Assert.NotNull(result);
- }
-
- [Fact]
- public async Task Should_list_threads()
- {
- var result = await CallToolAsync(
- "sreagent_threads_list",
- new()
- {
+ });
+
+ Assert.NotNull(result);
+ }
+
+ [Fact]
+ public async Task Should_list_threads()
+ {
+ var result = await CallToolAsync(
+ "sreagent_threads_list",
+ new()
+ {
{ "subscription", Settings.SubscriptionId },
{ "resource-group", Settings.ResourceGroupName },
{ "agent", Settings.ResourceBaseName }
- });
-
- Assert.NotNull(result);
- }
-
- [Fact]
- public async Task Should_list_connectors()
- {
- var result = await CallToolAsync(
- "sreagent_connectors_list",
- new()
- {
+ });
+
+ Assert.NotNull(result);
+ }
+
+ [Fact]
+ public async Task Should_list_connectors()
+ {
+ var result = await CallToolAsync(
+ "sreagent_connectors_list",
+ new()
+ {
{ "subscription", Settings.SubscriptionId },
{ "resource-group", Settings.ResourceGroupName },
{ "agent", Settings.ResourceBaseName }
- });
-
- Assert.NotNull(result);
- }
-
- [Fact]
- public async Task Should_list_scheduled_tasks()
- {
- var result = await CallToolAsync(
- "sreagent_scheduledtasks_list",
- new()
- {
+ });
+
+ Assert.NotNull(result);
+ }
+
+ [Fact]
+ public async Task Should_list_scheduled_tasks()
+ {
+ var result = await CallToolAsync(
+ "sreagent_scheduledtasks_list",
+ new()
+ {
{ "subscription", Settings.SubscriptionId },
{ "resource-group", Settings.ResourceGroupName },
{ "agent", Settings.ResourceBaseName }
- });
-
- Assert.NotNull(result);
- }
-
- [Fact]
- public async Task Should_list_active_incidents()
- {
- var result = await CallToolAsync(
- "sreagent_incidents_active_list",
- new()
- {
+ });
+
+ Assert.NotNull(result);
+ }
+
+ [Fact]
+ public async Task Should_list_active_incidents()
+ {
+ var result = await CallToolAsync(
+ "sreagent_incidents_active_list",
+ new()
+ {
{ "subscription", Settings.SubscriptionId },
{ "resource-group", Settings.ResourceGroupName },
{ "agent", Settings.ResourceBaseName }
- });
-
- Assert.NotNull(result);
- }
-
- [Fact]
- public async Task Should_list_common_prompts()
- {
- var result = await CallToolAsync(
- "sreagent_commonprompts_list",
- new()
- {
+ });
+
+ Assert.NotNull(result);
+ }
+
+ [Fact]
+ public async Task Should_list_common_prompts()
+ {
+ var result = await CallToolAsync(
+ "sreagent_commonprompts_list",
+ new()
+ {
{ "subscription", Settings.SubscriptionId },
{ "resource-group", Settings.ResourceGroupName },
{ "agent", Settings.ResourceBaseName }
- });
-
- Assert.NotNull(result);
- }
-
- [Fact]
- public async Task Should_list_agent_tools()
- {
- var result = await CallToolAsync(
- "sreagent_agents_tools_list",
- new()
- {
+ });
+
+ Assert.NotNull(result);
+ }
+
+ [Fact]
+ public async Task Should_list_agent_tools()
+ {
+ var result = await CallToolAsync(
+ "sreagent_agents_tools_list",
+ new()
+ {
{ "subscription", Settings.SubscriptionId },
{ "resource-group", Settings.ResourceGroupName },
{ "agent", Settings.ResourceBaseName }
- });
-
- Assert.NotNull(result);
- }
-
- [Fact]
- public async Task Should_list_skills()
- {
- var result = await CallToolAsync(
- "sreagent_skills_list",
- new()
- {
+ });
+
+ Assert.NotNull(result);
+ }
+
+ [Fact]
+ public async Task Should_list_skills()
+ {
+ var result = await CallToolAsync(
+ "sreagent_skills_list",
+ new()
+ {
{ "subscription", Settings.SubscriptionId },
{ "resource-group", Settings.ResourceGroupName },
{ "agent", Settings.ResourceBaseName }
- });
-
- Assert.NotNull(result);
- }
-
- [Fact]
- public async Task Should_list_hooks()
- {
- var result = await CallToolAsync(
- "sreagent_hooks_list",
- new()
- {
+ });
+
+ Assert.NotNull(result);
+ }
+
+ [Fact]
+ public async Task Should_list_hooks()
+ {
+ var result = await CallToolAsync(
+ "sreagent_hooks_list",
+ new()
+ {
{ "subscription", Settings.SubscriptionId },
{ "resource-group", Settings.ResourceGroupName },
{ "agent", Settings.ResourceBaseName }
- });
-
- Assert.NotNull(result);
- }
-
- [Fact]
- public async Task Should_list_incident_plans()
- {
- var result = await CallToolAsync(
- "sreagent_incidents_plans_list",
- new()
- {
+ });
+
+ Assert.NotNull(result);
+ }
+
+ [Fact]
+ public async Task Should_list_incident_plans()
+ {
+ var result = await CallToolAsync(
+ "sreagent_incidents_plans_list",
+ new()
+ {
{ "subscription", Settings.SubscriptionId },
{ "resource-group", Settings.ResourceGroupName },
{ "agent", Settings.ResourceBaseName }
- });
-
- Assert.NotNull(result);
- }
-
- [Fact]
- public async Task Should_list_memories()
- {
- var result = await CallToolAsync(
- "sreagent_docs_memories_list",
- new()
- {
+ });
+
+ Assert.NotNull(result);
+ }
+
+ [Fact]
+ public async Task Should_list_memories()
+ {
+ var result = await CallToolAsync(
+ "sreagent_docs_memories_list",
+ new()
+ {
{ "subscription", Settings.SubscriptionId },
{ "resource-group", Settings.ResourceGroupName },
{ "agent", Settings.ResourceBaseName }
- });
+ });
- Assert.NotNull(result);
- }
+ Assert.NotNull(result);
+ }
- [Fact]
- public async Task Should_create_get_and_delete_common_prompt()
- {
- const string promptName = "live-test-prompt";
+ [Fact]
+ public async Task Should_create_get_and_delete_common_prompt()
+ {
+ const string promptName = "live-test-prompt";
- // Create
- var createResult = await CallToolAsync(
- "sreagent_commonprompts_create",
- new()
- {
+ // Create
+ var createResult = await CallToolAsync(
+ "sreagent_commonprompts_create",
+ new()
+ {
{ "subscription", Settings.SubscriptionId },
{ "resource-group", Settings.ResourceGroupName },
{ "agent", Settings.ResourceBaseName },
{ "name", promptName },
{ "content", "You are a helpful SRE assistant." }
- });
- Assert.NotNull(createResult);
-
- // Get
- var getResult = await CallToolAsync(
- "sreagent_commonprompts_get",
- new()
- {
+ });
+ Assert.NotNull(createResult);
+
+ // Get
+ var getResult = await CallToolAsync(
+ "sreagent_commonprompts_get",
+ new()
+ {
{ "subscription", Settings.SubscriptionId },
{ "resource-group", Settings.ResourceGroupName },
{ "agent", Settings.ResourceBaseName },
{ "name", promptName }
- });
- Assert.NotNull(getResult);
-
- // Delete
- var deleteResult = await CallToolAsync(
- "sreagent_commonprompts_delete",
- new()
- {
+ });
+ Assert.NotNull(getResult);
+
+ // Delete
+ var deleteResult = await CallToolAsync(
+ "sreagent_commonprompts_delete",
+ new()
+ {
{ "subscription", Settings.SubscriptionId },
{ "resource-group", Settings.ResourceGroupName },
{ "agent", Settings.ResourceBaseName },
{ "name", promptName },
{ "confirm", true }
- });
- Assert.NotNull(deleteResult);
- }
-
- [Fact]
- public async Task Should_add_search_and_delete_memory()
- {
- const string memoryName = "live-test-memory.md";
-
- // Add
- var addResult = await CallToolAsync(
- "sreagent_docs_memories_add",
- new()
- {
+ });
+ Assert.NotNull(deleteResult);
+ }
+
+ [Fact]
+ public async Task Should_add_search_and_delete_memory()
+ {
+ const string memoryName = "live-test-memory.md";
+
+ // Add
+ var addResult = await CallToolAsync(
+ "sreagent_docs_memories_add",
+ new()
+ {
{ "subscription", Settings.SubscriptionId },
{ "resource-group", Settings.ResourceGroupName },
{ "agent", Settings.ResourceBaseName },
{ "name", memoryName },
{ "content", "# Live Test Memory\nThis document is used by automated live tests." }
- });
- Assert.NotNull(addResult);
-
- // Search (best-effort; indexing may be asynchronous)
- var searchResult = await CallToolAsync(
- "sreagent_docs_memories_search",
- new()
- {
+ });
+ Assert.NotNull(addResult);
+
+ // Search (best-effort; indexing may be asynchronous)
+ var searchResult = await CallToolAsync(
+ "sreagent_docs_memories_search",
+ new()
+ {
{ "subscription", Settings.SubscriptionId },
{ "resource-group", Settings.ResourceGroupName },
{ "agent", Settings.ResourceBaseName },
{ "query", "live test memory" }
- });
- Assert.NotNull(searchResult);
-
- // Delete
- var deleteResult = await CallToolAsync(
- "sreagent_docs_memories_delete",
- new()
- {
+ });
+ Assert.NotNull(searchResult);
+
+ // Delete
+ var deleteResult = await CallToolAsync(
+ "sreagent_docs_memories_delete",
+ new()
+ {
{ "subscription", Settings.SubscriptionId },
{ "resource-group", Settings.ResourceGroupName },
{ "agent", Settings.ResourceBaseName },
{ "name", memoryName },
{ "confirm", true }
- });
- Assert.NotNull(deleteResult);
- }
-
- [Fact]
- public async Task Should_reindex_memories()
- {
- var result = await CallToolAsync(
- "sreagent_docs_memories_reindex",
- new()
- {
+ });
+ Assert.NotNull(deleteResult);
+ }
+
+ [Fact]
+ public async Task Should_reindex_memories()
+ {
+ var result = await CallToolAsync(
+ "sreagent_docs_memories_reindex",
+ new()
+ {
{ "subscription", Settings.SubscriptionId },
{ "resource-group", Settings.ResourceGroupName },
{ "agent", Settings.ResourceBaseName }
- });
+ });
- Assert.NotNull(result);
- }
+ Assert.NotNull(result);
+ }
- [Fact]
- public async Task Should_create_get_and_delete_mcp_connector()
- {
- const string connectorName = "live-test-mcp-connector";
+ [Fact]
+ public async Task Should_create_get_and_delete_mcp_connector()
+ {
+ const string connectorName = "live-test-mcp-connector";
- // Create (HTTP type with a placeholder endpoint)
- var createResult = await CallToolAsync(
- "sreagent_connectors_create_mcp",
- new()
- {
+ // Create (HTTP type with a placeholder endpoint)
+ var createResult = await CallToolAsync(
+ "sreagent_connectors_create_mcp",
+ new()
+ {
{ "subscription", Settings.SubscriptionId },
{ "resource-group", Settings.ResourceGroupName },
{ "agent", Settings.ResourceBaseName },
{ "name", connectorName },
{ "type", "http" },
{ "endpoint", "https://example.com/mcp" }
- });
- Assert.NotNull(createResult);
-
- // Get
- var getResult = await CallToolAsync(
- "sreagent_connectors_get",
- new()
- {
+ });
+ Assert.NotNull(createResult);
+
+ // Get
+ var getResult = await CallToolAsync(
+ "sreagent_connectors_get",
+ new()
+ {
{ "subscription", Settings.SubscriptionId },
{ "resource-group", Settings.ResourceGroupName },
{ "agent", Settings.ResourceBaseName },
{ "name", connectorName }
- });
- Assert.NotNull(getResult);
-
- // Delete
- var deleteResult = await CallToolAsync(
- "sreagent_connectors_delete",
- new()
- {
+ });
+ Assert.NotNull(getResult);
+
+ // Delete
+ var deleteResult = await CallToolAsync(
+ "sreagent_connectors_delete",
+ new()
+ {
{ "subscription", Settings.SubscriptionId },
{ "resource-group", Settings.ResourceGroupName },
{ "agent", Settings.ResourceBaseName },
{ "name", connectorName },
{ "confirm", true }
- });
- Assert.NotNull(deleteResult);
- }
-
- [Fact]
- public async Task Should_create_and_delete_skill()
- {
- const string skillName = "live-test-skill";
-
- // Create
- var createResult = await CallToolAsync(
- "sreagent_skills_create",
- new()
- {
+ });
+ Assert.NotNull(deleteResult);
+ }
+
+ [Fact]
+ public async Task Should_create_and_delete_skill()
+ {
+ const string skillName = "live-test-skill";
+
+ // Create
+ var createResult = await CallToolAsync(
+ "sreagent_skills_create",
+ new()
+ {
{ "subscription", Settings.SubscriptionId },
{ "resource-group", Settings.ResourceGroupName },
{ "agent", Settings.ResourceBaseName },
{ "name", skillName },
{ "content", "## Restart Service\nRestart the given service using `systemctl restart `." },
{ "description", "Runbook for restarting a service" }
- });
- Assert.NotNull(createResult);
-
- // Delete
- var deleteResult = await CallToolAsync(
- "sreagent_skills_delete",
- new()
- {
+ });
+ Assert.NotNull(createResult);
+
+ // Delete
+ var deleteResult = await CallToolAsync(
+ "sreagent_skills_delete",
+ new()
+ {
{ "subscription", Settings.SubscriptionId },
{ "resource-group", Settings.ResourceGroupName },
{ "agent", Settings.ResourceBaseName },
{ "name", skillName },
{ "confirm", true }
- });
- Assert.NotNull(deleteResult);
- }
-
+ });
+ Assert.NotNull(deleteResult);
}
+
}
diff --git a/tools/Azure.Mcp.Tools.Storage/src/Services/StorageService.cs b/tools/Azure.Mcp.Tools.Storage/src/Services/StorageService.cs
index 20dff22ee3..68ba2d7bfd 100644
--- a/tools/Azure.Mcp.Tools.Storage/src/Services/StorageService.cs
+++ b/tools/Azure.Mcp.Tools.Storage/src/Services/StorageService.cs
@@ -14,21 +14,15 @@
using Azure.ResourceManager;
using Azure.Storage.Blobs;
using Azure.Storage.Blobs.Models;
-using Microsoft.Extensions.Logging;
using Microsoft.Mcp.Core.Options;
using Microsoft.Mcp.Core.Services.Azure.Authentication;
namespace Azure.Mcp.Tools.Storage.Services;
-public sealed class StorageService(
- ISubscriptionService subscriptionService,
- ITenantService tenantService,
- ILogger logger)
+public sealed class StorageService(ISubscriptionService subscriptionService, ITenantService tenantService)
: BaseAzureResourceService(subscriptionService, tenantService), IStorageService
{
private readonly ISubscriptionService _subscriptionService = subscriptionService;
- private readonly ITenantService _tenantService = tenantService ?? throw new ArgumentNullException(nameof(tenantService));
- private readonly ILogger _logger = logger ?? throw new ArgumentNullException(nameof(logger));
private static readonly HashSet s_validSkus = new(StringComparer.OrdinalIgnoreCase)
{
@@ -431,7 +425,6 @@ private static StorageAccountInfo ConvertToAccountInfoModel(JsonElement item)
private async Task CreateTableServiceClient(
string account,
- string subscription,
string? tenant = null,
RetryPolicyOptions? retryPolicy = null,
CancellationToken cancellationToken = default)
@@ -456,7 +449,6 @@ public async Task> ListTables(
// First attempt with requested auth method
var tableServiceClient = await CreateTableServiceClient(
account,
- subscription,
tenant,
retryPolicy,
cancellationToken);
@@ -495,7 +487,7 @@ private string GetBlobEndpoint(string account)
{
account = account.ToLowerInvariant();
ValidateStorageAccountName(account);
- return _tenantService.CloudConfiguration.CloudType switch
+ return TenantService.CloudConfiguration.CloudType switch
{
AzureCloudConfiguration.AzureCloud.AzurePublicCloud => $"https://{account}.blob.core.windows.net",
AzureCloudConfiguration.AzureCloud.AzureChinaCloud => $"https://{account}.blob.core.chinacloudapi.cn",
@@ -508,7 +500,7 @@ private string GetTableEndpoint(string account)
{
account = account.ToLowerInvariant();
ValidateStorageAccountName(account);
- return _tenantService.CloudConfiguration.CloudType switch
+ return TenantService.CloudConfiguration.CloudType switch
{
AzureCloudConfiguration.AzureCloud.AzurePublicCloud => $"https://{account}.table.core.windows.net",
AzureCloudConfiguration.AzureCloud.AzureChinaCloud => $"https://{account}.table.core.chinacloudapi.cn",
diff --git a/tools/Azure.Mcp.Tools.Workbooks/src/Commands/Workbooks/CreateWorkbooksCommand.cs b/tools/Azure.Mcp.Tools.Workbooks/src/Commands/Workbooks/CreateWorkbooksCommand.cs
index b3013f4aae..225a1891d6 100644
--- a/tools/Azure.Mcp.Tools.Workbooks/src/Commands/Workbooks/CreateWorkbooksCommand.cs
+++ b/tools/Azure.Mcp.Tools.Workbooks/src/Commands/Workbooks/CreateWorkbooksCommand.cs
@@ -42,7 +42,7 @@ public override async Task ExecuteAsync(CommandContext context,
options.ResourceGroup,
options.DisplayName,
options.SerializedContent,
- /**
+ /*
* The source ID is optional, defaulting to "azure monitor" if not provided.
* "azure monitor" is the default for workbooks created in the Azure Monitor extension,
* otherwise the workbook will display an error when opening.
diff --git a/tools/Fabric.Mcp.Tools.Docs/src/Services/FabricPublicApiService.cs b/tools/Fabric.Mcp.Tools.Docs/src/Services/FabricPublicApiService.cs
index e2ab5ec767..32d639f6b0 100644
--- a/tools/Fabric.Mcp.Tools.Docs/src/Services/FabricPublicApiService.cs
+++ b/tools/Fabric.Mcp.Tools.Docs/src/Services/FabricPublicApiService.cs
@@ -21,7 +21,6 @@ public class FabricPublicApiService(
private const string APISpecDefinitionsDirName = "definitions/";
private const string APISpecExamplesDirName = "examples/";
- private const string FormattedItemDefinitionPath = "item-definitions/{0}-definition.md";
private const string BaseResourcePath = PublicAPISpecRepo + "/contents/";
private const string FormattedSpecPath = BaseResourcePath + "{0}/" + APISpecFileName;
diff --git a/tools/Fabric.Mcp.Tools.OneLake/src/Models/OneLakeJsonContext.cs b/tools/Fabric.Mcp.Tools.OneLake/src/Models/OneLakeJsonContext.cs
index 9675ea0714..50d3bb2030 100644
--- a/tools/Fabric.Mcp.Tools.OneLake/src/Models/OneLakeJsonContext.cs
+++ b/tools/Fabric.Mcp.Tools.OneLake/src/Models/OneLakeJsonContext.cs
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
-using System.Collections.Generic;
using System.Text.Json.Serialization;
using Fabric.Mcp.Tools.OneLake.Commands.File;
using Fabric.Mcp.Tools.OneLake.Commands.Item;
diff --git a/tools/Fabric.Mcp.Tools.OneLake/src/Services/OneLakeService.cs b/tools/Fabric.Mcp.Tools.OneLake/src/Services/OneLakeService.cs
index a0a9fe765d..3e0ce81dd6 100644
--- a/tools/Fabric.Mcp.Tools.OneLake/src/Services/OneLakeService.cs
+++ b/tools/Fabric.Mcp.Tools.OneLake/src/Services/OneLakeService.cs
@@ -184,7 +184,7 @@ public async Task CreateItemAsync(string workspaceId, CreateItemReq
{
var url = $"{OneLakeEndpoints.GetFabricApiBaseUrl()}/workspaces/{workspaceId}/items";
var jsonContent = JsonSerializer.Serialize(request, OneLakeJsonContext.Default.CreateItemRequest);
- var response = await SendFabricApiRequestAsync(HttpMethod.Post, url, jsonContent, null, cancellationToken);
+ var response = await SendFabricApiRequestAsync(HttpMethod.Post, url, jsonContent, cancellationToken);
return await JsonSerializer.DeserializeAsync(response, OneLakeJsonContext.Default.OneLakeItem, cancellationToken) ?? new OneLakeItem();
}
@@ -702,55 +702,6 @@ public async Task> ListPathAsync(string workspaceId, string
return fileSystemItems.OrderBy(f => f.Type == "directory" ? 0 : 1).ThenBy(f => f.Name).ToList();
}
- private List BuildHierarchicalStructure(List flatItems, string basePath)
- {
- var root = new List();
- var pathPrefix = basePath.TrimEnd('/') + "/";
-
- // Group items by their immediate parent directory
- var grouped = flatItems
- .Where(item => item.Path.StartsWith(pathPrefix, StringComparison.OrdinalIgnoreCase) || item.Path == basePath.TrimEnd('/'))
- .GroupBy(item =>
- {
- var relativePath = item.Path.Substring(pathPrefix.Length);
- var firstSlash = relativePath.IndexOf('/');
- return firstSlash == -1 ? "" : relativePath.Substring(0, firstSlash);
- });
-
- foreach (var group in grouped)
- {
- if (string.IsNullOrEmpty(group.Key))
- {
- // Direct children of the base path
- root.AddRange(group);
- }
- else
- {
- // Create directory entry with children
- var dirPath = $"{pathPrefix}{group.Key}";
- var directoryItem = group.FirstOrDefault(item => item.Path == dirPath && item.Type == "directory");
-
- if (directoryItem == null)
- {
- directoryItem = new FileSystemItem
- {
- Name = group.Key,
- Path = dirPath,
- Type = "directory",
- Size = null,
- LastModified = null,
- ContentType = "application/x-directory"
- };
- }
-
- directoryItem.Children = group.Where(item => item.Path != dirPath).ToList();
- root.Add(directoryItem);
- }
- }
-
- return root.OrderBy(f => f.Type == "directory" ? 0 : 1).ThenBy(f => f.Name).ToList();
- }
-
public async Task> ListOneLakeItemsAsync(string workspaceId, string? continuationToken = null, CancellationToken cancellationToken = default)
{
var xmlContent = await ExecuteWithWorkspaceFallbackAsync(
@@ -1642,9 +1593,9 @@ private static void ValidatePathForTraversal(string path, string paramName)
}
}
- private async Task SendFabricApiRequestAsync(HttpMethod method, string url, string? jsonContent = null, string? tenant = null, CancellationToken cancellationToken = default)
+ private async Task SendFabricApiRequestAsync(HttpMethod method, string url, string? jsonContent = null, CancellationToken cancellationToken = default)
{
- var tokenContext = new TokenRequestContext(new[] { OneLakeEndpoints.GetFabricScope() });
+ var tokenContext = new TokenRequestContext([OneLakeEndpoints.GetFabricScope()]);
var token = await _credential.GetTokenAsync(tokenContext, cancellationToken);
using var request = new HttpRequestMessage(method, url);
@@ -1791,15 +1742,15 @@ private async Task SendOneLakeApiRequestAsync(HttpMethod method, string
return await response.Content.ReadAsStreamAsync(cancellationToken);
}
- private async Task SendDataPlaneRequestAsync(HttpMethod method, string url, string? tenant = null, CancellationToken cancellationToken = default)
+ private async Task SendDataPlaneRequestAsync(HttpMethod method, string url, CancellationToken cancellationToken = default)
{
using var request = new HttpRequestMessage(method, url);
- return await SendDataPlaneRequestAsync(request, tenant, cancellationToken);
+ return await SendDataPlaneRequestAsync(request, cancellationToken);
}
- private async Task SendDataPlaneRequestAsync(HttpRequestMessage request, string? tenant = null, CancellationToken cancellationToken = default)
+ private async Task SendDataPlaneRequestAsync(HttpRequestMessage request, CancellationToken cancellationToken = default)
{
- var tokenContext = new TokenRequestContext(new[] { OneLakeEndpoints.StorageScope });
+ var tokenContext = new TokenRequestContext([OneLakeEndpoints.StorageScope]);
var token = await _credential.GetTokenAsync(tokenContext, cancellationToken);
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token.Token);
@@ -2248,17 +2199,6 @@ private async Task ResolvePrincipalsAsync(List members, Ca
}
}
- private static string ExtractWarehouseQueryValue(string warehousePrefix)
- {
- const string WarehousePrefixRoot = "warehouse/";
- if (warehousePrefix.StartsWith(WarehousePrefixRoot, StringComparison.OrdinalIgnoreCase))
- {
- return warehousePrefix[WarehousePrefixRoot.Length..];
- }
-
- return warehousePrefix;
- }
-
private async Task<(string WorkspaceId, string ItemIdentifier, string WarehousePrefix, string WarehouseQueryValue)> GetWarehousePrefixAsync(string workspaceIdentifier, string itemIdentifier, CancellationToken cancellationToken)
{
var normalizedWorkspaceId = NormalizeWorkspaceIdentifier(workspaceIdentifier);
diff --git a/tools/Fabric.Mcp.Tools.OneLake/tests/Fabric.Mcp.Tools.OneLake.Tests/Services/OneLakeServiceLroTests.cs b/tools/Fabric.Mcp.Tools.OneLake/tests/Fabric.Mcp.Tools.OneLake.Tests/Services/OneLakeServiceLroTests.cs
index 12fd6381d4..88a59efa0f 100644
--- a/tools/Fabric.Mcp.Tools.OneLake/tests/Fabric.Mcp.Tools.OneLake.Tests/Services/OneLakeServiceLroTests.cs
+++ b/tools/Fabric.Mcp.Tools.OneLake/tests/Fabric.Mcp.Tools.OneLake.Tests/Services/OneLakeServiceLroTests.cs
@@ -20,7 +20,6 @@ public class OneLakeServiceLroTests
private const string OperationId = "op-lro-12345";
private const string OperationUrl = $"https://dailyapi.fabric.microsoft.com/v1/operations/{OperationId}";
private const string ResultUrl = $"https://dailyapi.fabric.microsoft.com/v1/operations/{OperationId}/result";
- private const string ShortcutsUrl = $"https://dailyapi.fabric.microsoft.com/v1/workspaces/{WorkspaceId}/items/{ItemId}/shortcuts/bulkCreate";
private static OneLakeService CreateService(Func handler)
{
From 1d2021564549ecb70ccf4a379276e7ceccf67d1c Mon Sep 17 00:00:00 2001
From: alzimmermsft <48699787+alzimmermsft@users.noreply.github.com>
Date: Thu, 23 Jul 2026 17:21:41 -0400
Subject: [PATCH 2/5] Fix release build
---
.../src/Services/Azure/BaseAzureService.cs | 11 +++++++---
.../src/Extensions/OpenTelemetryExtensions.cs | 20 +++++++++++--------
2 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/core/Azure.Mcp.Core/src/Services/Azure/BaseAzureService.cs b/core/Azure.Mcp.Core/src/Services/Azure/BaseAzureService.cs
index 46d02931c3..dc2fec67ec 100644
--- a/core/Azure.Mcp.Core/src/Services/Azure/BaseAzureService.cs
+++ b/core/Azure.Mcp.Core/src/Services/Azure/BaseAzureService.cs
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
+using System.Diagnostics;
using System.Reflection;
using System.Runtime.Versioning;
using Azure.Core;
@@ -31,7 +32,7 @@ public abstract class BaseAzureService
private static readonly string s_framework;
private static readonly string s_platform;
private static readonly string s_defaultUserAgent;
- private static readonly TimeSpan? s_defaultPollInterval = null;
+ private static TimeSpan? s_defaultPollInterval = null;
static BaseAzureService()
{
@@ -44,12 +45,16 @@ static BaseAzureService()
s_defaultUserAgent = $"azmcp/{s_version} ({s_framework}; {s_platform})";
s_sharedUserAgentPolicy = new UserAgentPolicy(s_defaultUserAgent);
-#if DEBUG
+ SetDefaultPollInterval();
+ }
+
+ [Conditional("DEBUG")]
+ private static void SetDefaultPollInterval()
+ {
if (EnvironmentHelpers.IsPlaybackTesting())
{
s_defaultPollInterval = TimeSpan.Zero;
}
-#endif
}
///
diff --git a/core/Microsoft.Mcp.Core/src/Extensions/OpenTelemetryExtensions.cs b/core/Microsoft.Mcp.Core/src/Extensions/OpenTelemetryExtensions.cs
index 94bbc918bd..82aded4a3a 100644
--- a/core/Microsoft.Mcp.Core/src/Extensions/OpenTelemetryExtensions.cs
+++ b/core/Microsoft.Mcp.Core/src/Extensions/OpenTelemetryExtensions.cs
@@ -52,14 +52,7 @@ public static void ConfigureOpenTelemetry(this IServiceCollection services)
private static void EnableAzureMonitor(this IServiceCollection services)
{
-#if DEBUG
- services.AddSingleton(sp =>
- {
- var forwarder = new AzureEventSourceLogForwarder(sp.GetRequiredService());
- forwarder.Start();
- return forwarder;
- });
-#endif
+ ConfigureAzureEventSourceLogForwarder(services);
services.ConfigureOpenTelemetryTracerProvider((sp, builder) =>
{
@@ -115,6 +108,17 @@ private static void EnableAzureMonitor(this IServiceCollection services)
}
}
+ [Conditional("DEBUG")]
+ private static void ConfigureAzureEventSourceLogForwarder(this IServiceCollection services)
+ {
+ services.AddSingleton(sp =>
+ {
+ var forwarder = new AzureEventSourceLogForwarder(sp.GetRequiredService());
+ forwarder.Start();
+ return forwarder;
+ });
+ }
+
///
/// Configures OpenTelemetry to use Azure Monitor exporters with Microsoft's Application Insights instance.
///
From d4e193066db3df9c95ae54f2938e2605c7f6b761 Mon Sep 17 00:00:00 2001
From: alzimmermsft <48699787+alzimmermsft@users.noreply.github.com>
Date: Fri, 24 Jul 2026 13:00:53 -0400
Subject: [PATCH 3/5] Some updates based on PR review
---
.../Azure/BaseAzureResourceService.cs | 12 +--
.../src/Services/Azure/BaseAzureService.cs | 11 +--
.../Services/Azure/Tenant/ITenantService.cs | 10 +-
.../Services/Azure/Tenant/TenantService.cs | 2 +-
.../TenantServiceCollectionExtensions.cs | 2 +-
.../Areas/Server/CommandFactoryHelpers.cs | 3 +-
.../CommandGroupDiscoveryStrategyTests.cs | 40 ++++----
.../ConsolidatedToolDiscoveryStrategyTests.cs | 5 +-
.../Commands/Runtime/McpRuntimeTests.cs | 6 +-
...viceCollectionExtensionsSerializedTests.cs | 22 ++---
.../ServiceCollectionExtensionsTests.cs | 16 ++--
.../Commands/ServiceInfoCommandTests.cs | 3 +-
.../CommandFactoryToolLoaderTests.cs | 95 ++++++++++---------
.../ToolLoading/NamespaceToolLoaderTests.cs | 71 +++++++-------
.../PluginTelemetryCommandTests.cs | 3 +-
.../ToolLoading/RegistryToolLoaderTests.cs | 62 ++++++------
.../ToolLoading/ServerToolLoaderTests.cs | 21 ++--
.../ToolLoading/SingleProxyToolLoaderTests.cs | 44 +++++----
.../Areas/Server/ServiceStartCommandTests.cs | 18 ++--
.../Areas/Tools/ToolsListCommandTests.cs | 3 +-
.../Commands/CommandFactoryTests.cs | 6 +-
.../RegistryDiscoveryStrategyHelper.cs | 3 +-
.../AzureCloudConfigurationTests.cs | 5 +-
.../src/AccessTokenHandler.cs | 4 +-
.../Commands/Discovery/IDiscoveryStrategy.cs | 6 +-
.../Commands/Discovery/IMcpServerProvider.cs | 2 +-
.../Discovery/RegistryServerProvider.cs | 6 +-
.../Server/Commands/OptionSchemaGenerator.cs | 14 ++-
.../Server/Commands/PluginTelemetryCommand.cs | 2 +-
.../Server/Commands/Runtime/IMcpRuntime.cs | 4 +-
.../Server/Commands/Runtime/McpRuntime.cs | 6 +-
.../Server/Commands/ServerStartCommand.cs | 2 +-
.../Commands/ServiceCollectionExtensions.cs | 18 ++--
.../Commands/ToolLoading/BaseToolLoader.cs | 6 +-
.../ToolLoading/CommandFactoryToolLoader.cs | 4 +-
.../ToolLoading/CompositeToolLoader.cs | 6 +-
.../Commands/ToolLoading/IToolLoader.cs | 4 +-
.../ToolLoading/RegistryToolLoader.cs | 6 +-
.../Commands/ToolLoading/ServerToolLoader.cs | 6 +-
.../ToolLoading/SingleProxyToolLoader.cs | 6 +-
.../Areas/Tools/Commands/ToolsListCommand.cs | 7 +-
.../McpServerElicitationExtensions.cs | 2 +-
.../src/Services/Caching/ICacheService.cs | 12 +--
.../ExternalProcessService.cs | 6 +-
.../ToolLoading/ToolLoaderTelemetryTests.cs | 13 +--
.../src/Abstractions/ISessionStore.cs | 4 +-
.../ToolDescriptionEvaluator/src/Program.cs | 6 +-
eng/tools/ToolMetadataExporter/src/Program.cs | 5 +-
servers/Azure.Mcp.Server/src/Program.cs | 12 +--
.../src/Services/AppLensService.cs | 4 +-
.../src/Services/IAppLensService.cs | 2 +-
.../src/Services/ProfilerDataService.cs | 2 +-
.../src/Services/IAuthorizationService.cs | 2 +-
.../src/Services/IDatadogService.cs | 2 +-
.../IPlatformLandingZoneGuidanceService.cs | 6 +-
.../Services/IPlatformLandingZoneService.cs | 8 +-
.../src/Services/ICommunicationService.cs | 2 +-
.../Services/Helpers/GitHubUrlValidator.cs | 4 +-
.../src/Services/IManifestService.cs | 2 +-
.../src/Services/IGrafanaService.cs | 2 +-
.../src/Services/IInsightsService.cs | 4 +-
.../src/Services/IKeyVaultService.cs | 22 ++---
.../src/Services/MarketplaceService.cs | 4 +-
.../Services/IMonitorHealthModelService.cs | 4 +-
.../src/Services/IMonitorMetricsService.cs | 6 +-
.../src/Services/IResourceResolverService.cs | 2 +-
.../src/Services/IPolicyService.cs | 4 +-
.../src/Client/RetailPrices.cs | 4 +-
.../src/Services/IPricingService.cs | 2 +-
.../src/Services/IRedisService.cs | 4 +-
.../src/Services/IResourceHealthService.cs | 6 +-
.../src/Services/IServiceBusService.cs | 10 +-
.../IFastTranscriptionRecognizer.cs | 2 +-
.../IRealtimeTranscriptionRecognizer.cs | 2 +-
.../src/Services/SpeechService.cs | 4 +-
.../Synthesizers/IRealtimeTtsSynthesizer.cs | 2 +-
.../src/Services/ISqlService.cs | 30 +++---
.../src/Services/SqlService.cs | 36 +++----
.../src/Services/SreAgentService.cs | 4 +-
79 files changed, 428 insertions(+), 392 deletions(-)
diff --git a/core/Azure.Mcp.Core/src/Services/Azure/BaseAzureResourceService.cs b/core/Azure.Mcp.Core/src/Services/Azure/BaseAzureResourceService.cs
index 1a07a64f1d..3b874a1769 100644
--- a/core/Azure.Mcp.Core/src/Services/Azure/BaseAzureResourceService.cs
+++ b/core/Azure.Mcp.Core/src/Services/Azure/BaseAzureResourceService.cs
@@ -30,7 +30,7 @@ public abstract class BaseAzureResourceService(
/// Gets the tenant resource for the specified subscription.
///
/// The tenant ID from the subscription
- /// Cancellation token
+ /// The token to monitor for cancellation requests. The default value is .
/// The tenant resource associated with the subscription
private async Task GetTenantResourceAsync(Guid? tenantId, CancellationToken cancellationToken = default)
{
@@ -77,7 +77,7 @@ private async Task ValidateResourceGroupExistsAsync(SubscriptionResource s
/// Optional table name to query (default: "resources")
/// Optional additional KQL filter condition
/// Maximum number of results to return (default: 50)
- /// Cancellation token
+ /// The token to monitor for cancellation requests. The default value is .
/// Optional tenant to use for the query
/// List of resources converted to the specified type
protected async Task> ExecuteResourceQueryAsync(
@@ -160,7 +160,7 @@ protected async Task> ExecuteResourceQueryAsync(
/// Optional table name to query (default: "resources")
/// Optional additional KQL filter condition
/// Optional tenant to use for the query
- /// Cancellation token
+ /// The token to monitor for cancellation requests. The default value is .
/// Single resource converted to the specified type, or null if not found
protected async Task ExecuteSingleResourceQueryAsync(
string resourceType,
@@ -186,7 +186,7 @@ protected async Task> ExecuteResourceQueryAsync(
/// The API version to set for the specified resource type.
/// Optional tenant to use when creating the client.
/// Optional retry policy used by token acquisition.
- /// Cancellation token
+ /// The token to monitor for cancellation requests. The default value is .
/// An initialized configured with the requested API version.
protected async Task CreateArmClientWithApiVersionAsync(string resourceTypeForApiVersion, string apiVersion, string? tenant = null, RetryPolicyOptions? retryPolicy = null, CancellationToken cancellationToken = default)
{
@@ -201,7 +201,7 @@ protected async Task CreateArmClientWithApiVersionAsync(string resour
///
/// The ArmClient to use for the call.
/// The resource identifier of the resource to retrieve.
- /// Cancellation token.
+ /// The token to monitor for cancellation requests. The default value is .
/// The instance for the requested resource.
/// Thrown when a required parameter is null.
protected static async Task GetGenericResourceAsync(ArmClient armClient, ResourceIdentifier resourceIdentifier, CancellationToken cancellationToken = default)
@@ -228,7 +228,7 @@ protected static async Task GetGenericResourceAsync(ArmClient a
/// The Azure location for the resource.
/// The content to create or update the resource with.
/// The JSON type information for serialization.
- /// Cancellation token
+ /// The token to monitor for cancellation requests. The default value is .
/// The instance for the requested resource.
/// Thrown when a required parameter is null.
/// Thrown when the content is invalid.
diff --git a/core/Azure.Mcp.Core/src/Services/Azure/BaseAzureService.cs b/core/Azure.Mcp.Core/src/Services/Azure/BaseAzureService.cs
index dc2fec67ec..9ec279f7fe 100644
--- a/core/Azure.Mcp.Core/src/Services/Azure/BaseAzureService.cs
+++ b/core/Azure.Mcp.Core/src/Services/Azure/BaseAzureService.cs
@@ -170,13 +170,11 @@ protected static string EscapeKqlString(string value)
protected async Task GetCredential(CancellationToken cancellationToken)
{
- // TODO @vukelich: separate PR for cancellationToken to be required, not optional default
return await GetCredential(null, cancellationToken);
}
protected async Task GetCredential(string? tenant, CancellationToken cancellationToken)
{
- // TODO @vukelich: separate PR for cancellationToken to be required, not optional default
var tenantId = string.IsNullOrEmpty(tenant) ? null : await ResolveTenantIdAsync(tenant, cancellationToken);
try
@@ -193,7 +191,8 @@ protected async Task GetCredential(string? tenant, Cancellation
/// Gets an ARM access token for the given tenant using the ARM default scope.
///
/// Optional tenant ID or name to authenticate against.
- /// Cancellation token.
+ /// The token to monitor for cancellation requests. The default value is .
+ /// An for the ARM default scope.
protected async Task GetArmAccessTokenAsync(string? tenant, CancellationToken cancellationToken)
{
var credential = await GetCredential(tenant, cancellationToken);
@@ -258,7 +257,7 @@ protected static T ConfigureRetryPolicy(T clientOptions, RetryPolicyOptions?
/// Optional Azure tenant ID or name.
/// Optional retry policy configuration.
/// Optional ARM client options.
- /// Cancellation token.
+ /// The token to monitor for cancellation requests. The default value is .
/// An initialized instance.
protected async Task CreateArmClientAsync(
string? tenantIdOrName = null,
@@ -309,7 +308,7 @@ protected static void ValidateRequiredParameters(params (string name, string? va
///
/// The return type.
/// The long-running operation.
- /// The cancellation token that can cancel the request.
+ /// The token to monitor for cancellation requests. The default value is .
/// The response once the long-running operation completes.
protected static async Task WaitForLroCompletionAsync(Operation operation, CancellationToken cancellationToken = default) where T : notnull
{
@@ -329,7 +328,7 @@ protected static async Task WaitForLroCompletionAsync(Operation operation,
/// Waits for the completion of a long-running operation, periodically polling the operation status until it completes.
///
/// The long-running operation.
- /// The cancellation token that can cancel the request.
+ /// The token to monitor for cancellation requests. The default value is .
/// The response once the long-running operation completes.
protected static async Task WaitForLroCompletionAsync(Operation operation, CancellationToken cancellationToken = default)
{
diff --git a/core/Azure.Mcp.Core/src/Services/Azure/Tenant/ITenantService.cs b/core/Azure.Mcp.Core/src/Services/Azure/Tenant/ITenantService.cs
index e0fa817618..86fda3479d 100644
--- a/core/Azure.Mcp.Core/src/Services/Azure/Tenant/ITenantService.cs
+++ b/core/Azure.Mcp.Core/src/Services/Azure/Tenant/ITenantService.cs
@@ -20,7 +20,7 @@ public interface ITenantService
///
/// Gets the list of all available Azure tenants.
///
- /// A token to cancel the operation.
+ /// The token to monitor for cancellation requests.
///
/// A task representing the asynchronous operation, with a list of
/// instances.
@@ -31,7 +31,7 @@ public interface ITenantService
/// Gets the tenant ID from either a tenant ID or tenant name.
///
/// The tenant ID or tenant name.
- /// A cancellation token.
+ /// The token to monitor for cancellation requests.
///
/// A task representing the asynchronous operation, with the tenant ID or
/// if not found.
@@ -48,7 +48,7 @@ public interface ITenantService
/// Gets the tenant ID by tenant name.
///
/// The tenant name.
- /// A cancellation token.
+ /// The token to monitor for cancellation requests.
///
/// A task representing the asynchronous operation, with the tenant ID or
/// if not found.
@@ -65,7 +65,7 @@ public interface ITenantService
/// Gets the tenant name by tenant ID.
///
/// The tenant ID.
- /// A cancellation token.
+ /// The token to monitor for cancellation requests.
///
/// A task representing the asynchronous operation, with the tenant name or if not found.
///
@@ -90,7 +90,7 @@ public interface ITenantService
/// Gets an instance of .
///
/// Optional tenant ID. Use in most cases.
- /// A cancellation token.
+ /// The token to monitor for cancellation requests.
///
/// A task representing the asynchronous operation, with a value of .
///
diff --git a/core/Azure.Mcp.Core/src/Services/Azure/Tenant/TenantService.cs b/core/Azure.Mcp.Core/src/Services/Azure/Tenant/TenantService.cs
index a50affa3ed..2ef51d5ccb 100644
--- a/core/Azure.Mcp.Core/src/Services/Azure/Tenant/TenantService.cs
+++ b/core/Azure.Mcp.Core/src/Services/Azure/Tenant/TenantService.cs
@@ -57,7 +57,7 @@ public async Task> GetTenants(CancellationToken cancellatio
var options = AddDefaultPolicies(new ArmClientOptions());
options.Transport = new HttpClientTransport(GetClient());
options.Environment = CloudConfiguration.ArmEnvironment;
- var client = new ArmClient(await GetCredential(cancellationToken), default, options);
+ var client = new ArmClient(await GetTokenCredentialAsync(null, cancellationToken), default, options);
await foreach (var tenant in client.GetTenants().WithCancellation(cancellationToken))
{
diff --git a/core/Azure.Mcp.Core/src/Services/Azure/Tenant/TenantServiceCollectionExtensions.cs b/core/Azure.Mcp.Core/src/Services/Azure/Tenant/TenantServiceCollectionExtensions.cs
index 05fb25c125..a3affa5718 100644
--- a/core/Azure.Mcp.Core/src/Services/Azure/Tenant/TenantServiceCollectionExtensions.cs
+++ b/core/Azure.Mcp.Core/src/Services/Azure/Tenant/TenantServiceCollectionExtensions.cs
@@ -29,7 +29,7 @@ public static class TenantServiceCollectionExtensions
///
/// -
///
- /// via .
+ /// via .
///
///
/// -
diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/CommandFactoryHelpers.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/CommandFactoryHelpers.cs
index 88af56bfa5..d8345449c8 100644
--- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/CommandFactoryHelpers.cs
+++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/CommandFactoryHelpers.cs
@@ -53,6 +53,7 @@
using Microsoft.Mcp.Core.Services.Telemetry;
using Microsoft.Mcp.Core.Services.Time;
using NSubstitute;
+using ExtensionsOptions = Microsoft.Extensions.Options;
namespace Azure.Mcp.Core.Tests.Areas.Server;
@@ -106,7 +107,7 @@ public static ICommandFactory CreateCommandFactory(IServiceProvider? serviceProv
var services = serviceProvider ?? CreateDefaultServiceProvider();
var logger = services.GetRequiredService>();
- var configurationOptions = Microsoft.Extensions.Options.Options.Create(new McpServerConfiguration
+ var configurationOptions = ExtensionsOptions.Options.Create(new McpServerConfiguration
{
Name = "Test Server",
ShortName = "test",
diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/Discovery/CommandGroupDiscoveryStrategyTests.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/Discovery/CommandGroupDiscoveryStrategyTests.cs
index da340c547e..205e393a59 100644
--- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/Discovery/CommandGroupDiscoveryStrategyTests.cs
+++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/Discovery/CommandGroupDiscoveryStrategyTests.cs
@@ -1,11 +1,17 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
+using System.Diagnostics;
+using System.Reflection;
+using System.Runtime.InteropServices;
+using Microsoft.Extensions.Logging;
using Microsoft.Mcp.Core.Areas.Server.Commands.Discovery;
using Microsoft.Mcp.Core.Areas.Server.Options;
using Microsoft.Mcp.Core.Commands;
using Microsoft.Mcp.Tests.Client.Helpers;
+using NSubstitute;
using Xunit;
+using ExtensionsOptions = Microsoft.Extensions.Options;
namespace Azure.Mcp.Core.Tests.Areas.Server.Commands.Discovery;
@@ -17,8 +23,8 @@ private static CommandGroupDiscoveryStrategy CreateStrategy(
string? entryPoint = null)
{
var factory = commandFactory ?? CommandFactoryHelpers.CreateCommandFactory();
- var startOptions = Microsoft.Extensions.Options.Options.Create(options ?? new ServerStartOptions());
- var logger = NSubstitute.Substitute.For>();
+ var startOptions = ExtensionsOptions.Options.Create(options ?? new ServerStartOptions());
+ var logger = Substitute.For>();
var strategy = new CommandGroupDiscoveryStrategy(factory, startOptions, logger);
if (entryPoint != null)
{
@@ -31,8 +37,8 @@ private static CommandGroupDiscoveryStrategy CreateStrategy(
public void Constructor_WithNullCommandFactory_DoesNotThrow()
{
// Arrange
- var options = Microsoft.Extensions.Options.Options.Create(new ServerStartOptions());
- var logger = NSubstitute.Substitute.For>();
+ var options = ExtensionsOptions.Options.Create(new ServerStartOptions());
+ var logger = Substitute.For>();
// Act & Assert
// Primary constructor syntax doesn't automatically validate null parameters
@@ -45,7 +51,7 @@ public void Constructor_WithNullOptions_DoesNotThrow()
{
// Arrange
var commandFactory = CommandFactoryHelpers.CreateCommandFactory();
- var logger = NSubstitute.Substitute.For>();
+ var logger = Substitute.For>();
// Act & Assert
// Primary constructor syntax doesn't automatically validate null parameters
@@ -58,8 +64,8 @@ public void Constructor_WithValidParameters_InitializesCorrectly()
{
// Arrange
var commandFactory = CommandFactoryHelpers.CreateCommandFactory();
- var options = Microsoft.Extensions.Options.Options.Create(new ServerStartOptions());
- var logger = NSubstitute.Substitute.For>();
+ var options = ExtensionsOptions.Options.Create(new ServerStartOptions());
+ var logger = Substitute.For>();
// Act
var strategy = new CommandGroupDiscoveryStrategy(commandFactory, options, logger);
@@ -211,7 +217,7 @@ public async Task DiscoverServersAsync_WithNullEntryPoint_UsesCurrentProcessExec
// Assert
Assert.NotEmpty(result);
// When EntryPoint is set to null, CommandGroupServerProvider defaults to current process executable
- var currentProcessPath = System.Diagnostics.Process.GetCurrentProcess().MainModule?.FileName;
+ var currentProcessPath = Process.GetCurrentProcess().MainModule?.FileName;
Assert.All(result, provider =>
{
var actualEntryPoint = ((CommandGroupServerProvider)provider).EntryPoint;
@@ -232,7 +238,7 @@ public async Task DiscoverServersAsync_WithEmptyEntryPoint_ProvidersDefaultToCur
// Assert
Assert.NotEmpty(result);
- var currentProcessPath = System.Diagnostics.Process.GetCurrentProcess().MainModule?.FileName;
+ var currentProcessPath = Process.GetCurrentProcess().MainModule?.FileName;
Assert.All(result, provider =>
{
var actualEntryPoint = ((CommandGroupServerProvider)provider).EntryPoint;
@@ -252,7 +258,7 @@ public async Task DiscoverServersAsync_WithWhitespaceEntryPoint_ProvidersDefault
// Assert
Assert.NotEmpty(result);
- var currentProcessPath = System.Diagnostics.Process.GetCurrentProcess().MainModule?.FileName;
+ var currentProcessPath = Process.GetCurrentProcess().MainModule?.FileName;
Assert.All(result, provider =>
{
var actualEntryPoint = ((CommandGroupServerProvider)provider).EntryPoint;
@@ -446,8 +452,8 @@ public async Task DiscoverServersAsync_ResultCountIsConsistent()
public async Task ShouldDiscoverServers()
{
var commandFactory = CommandFactoryHelpers.CreateCommandFactory();
- var options = Microsoft.Extensions.Options.Options.Create(new ServerStartOptions());
- var logger = NSubstitute.Substitute.For>();
+ var options = ExtensionsOptions.Options.Create(new ServerStartOptions());
+ var logger = Substitute.For>();
var strategy = new CommandGroupDiscoveryStrategy(commandFactory, options, logger);
var result = await strategy.DiscoverServersAsync(TestContext.Current.CancellationToken);
Assert.NotNull(result);
@@ -457,9 +463,9 @@ public async Task ShouldDiscoverServers()
public async Task ShouldDiscoverServers_ExcludesIgnoredGroupsAndSetsProperties()
{
var commandFactory = CommandFactoryHelpers.CreateCommandFactory();
- var options = Microsoft.Extensions.Options.Options.Create(new ServerStartOptions { ReadOnly = true });
+ var options = ExtensionsOptions.Options.Create(new ServerStartOptions { ReadOnly = true });
var azmcpEntryPoint = McpTestUtilities.GetAzMcpExecutablePath();
- var logger = NSubstitute.Substitute.For>();
+ var logger = Substitute.For>();
var strategy = new CommandGroupDiscoveryStrategy(commandFactory, options, logger)
{
EntryPoint = azmcpEntryPoint
@@ -490,8 +496,8 @@ public void GetAzmcpExecutablePath_ReturnsCorrectPathForCurrentOS()
Assert.NotEmpty(azmcpPath);
// Should end with the correct executable name for the current OS
- if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(
- System.Runtime.InteropServices.OSPlatform.Windows))
+ if (RuntimeInformation.IsOSPlatform(
+ OSPlatform.Windows))
{
Assert.EndsWith("azmcp.exe", azmcpPath);
}
@@ -502,7 +508,7 @@ public void GetAzmcpExecutablePath_ReturnsCorrectPathForCurrentOS()
}
// Should be in the same directory as the test assembly
- var testAssemblyPath = System.Reflection.Assembly.GetExecutingAssembly().Location;
+ var testAssemblyPath = Assembly.GetExecutingAssembly().Location;
var testDirectory = Path.GetDirectoryName(testAssemblyPath);
var expectedDirectory = Path.GetDirectoryName(azmcpPath);
Assert.Equal(testDirectory, expectedDirectory);
diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/Discovery/ConsolidatedToolDiscoveryStrategyTests.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/Discovery/ConsolidatedToolDiscoveryStrategyTests.cs
index 0c97c74898..77a25116c3 100644
--- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/Discovery/ConsolidatedToolDiscoveryStrategyTests.cs
+++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/Discovery/ConsolidatedToolDiscoveryStrategyTests.cs
@@ -9,6 +9,7 @@
using Microsoft.Mcp.Core.Configuration;
using NSubstitute;
using Xunit;
+using ExtensionsOptions = Microsoft.Extensions.Options;
namespace Azure.Mcp.Core.Tests.Areas.Server.Commands.Discovery;
@@ -21,8 +22,8 @@ private static ConsolidatedToolDiscoveryStrategy CreateStrategy(
{
var factory = commandFactory ?? CommandFactoryHelpers.CreateCommandFactory();
var serviceProvider = CommandFactoryHelpers.SetupCommonServices().BuildServiceProvider();
- var startOptions = Microsoft.Extensions.Options.Options.Create(options ?? new ServerStartOptions());
- var configurationOptions = Microsoft.Extensions.Options.Options.Create(new McpServerConfiguration
+ var startOptions = ExtensionsOptions.Options.Create(options ?? new ServerStartOptions());
+ var configurationOptions = ExtensionsOptions.Options.Create(new McpServerConfiguration
{
Name = "Test Server",
ShortName = "test",
diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/Runtime/McpRuntimeTests.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/Runtime/McpRuntimeTests.cs
index ea29fc8f0a..285659c1b8 100644
--- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/Runtime/McpRuntimeTests.cs
+++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/Runtime/McpRuntimeTests.cs
@@ -8,7 +8,6 @@
using System.Text.Json.Nodes;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
-using Microsoft.Extensions.Options;
using Microsoft.Mcp.Core.Areas.Server.Commands.Runtime;
using Microsoft.Mcp.Core.Areas.Server.Commands.ToolLoading;
using Microsoft.Mcp.Core.Areas.Server.Options;
@@ -19,6 +18,7 @@
using ModelContextProtocol.Server;
using NSubstitute;
using Xunit;
+using ExtensionsOptions = Microsoft.Extensions.Options;
namespace Azure.Mcp.Core.Tests.Areas.Server.Commands.Runtime;
@@ -33,8 +33,8 @@ private static ServiceProvider CreateServiceProvider()
return services.BuildServiceProvider();
}
- private static IOptions CreateOptions(ServerStartOptions? options = null) =>
- Microsoft.Extensions.Options.Options.Create(options ?? new ServerStartOptions());
+ private static ExtensionsOptions.IOptions CreateOptions(ServerStartOptions? options = null) =>
+ ExtensionsOptions.Options.Create(options ?? new ServerStartOptions());
private static McpServer CreateMockServer() => Substitute.For();
diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ServiceCollectionExtensionsSerializedTests.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ServiceCollectionExtensionsSerializedTests.cs
index 5725da4ccd..faebf4aa75 100644
--- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ServiceCollectionExtensionsSerializedTests.cs
+++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ServiceCollectionExtensionsSerializedTests.cs
@@ -3,12 +3,12 @@
using System.Reflection;
using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Options;
using Microsoft.Mcp.Core.Areas.Server.Commands;
using Microsoft.Mcp.Core.Areas.Server.Options;
using Microsoft.Mcp.Core.Configuration;
using Microsoft.Mcp.Core.Helpers;
using Xunit;
+using ExtensionsOptions = Microsoft.Extensions.Options;
namespace Azure.Mcp.Core.Tests.Areas.Server.Commands;
@@ -37,7 +37,7 @@ public void InitializeConfigurationAndOptions_Defaults()
// Assert
var provider = services.BuildServiceProvider();
- var options = provider.GetRequiredService>();
+ var options = provider.GetRequiredService>();
Assert.NotNull(options.Value);
@@ -61,14 +61,14 @@ public void InitializeConfigurationAndOptions_HttpTransport()
{
Transport = TransportTypes.Http,
};
- var services = SetupBaseServices().AddSingleton(Microsoft.Extensions.Options.Options.Create(serviceStartOptions));
+ var services = SetupBaseServices().AddSingleton(ExtensionsOptions.Options.Create(serviceStartOptions));
// Act
services.InitializeConfigurationAndOptions(s_serverAssembly);
var provider = services.BuildServiceProvider();
// Assert
- var options = provider.GetRequiredService>();
+ var options = provider.GetRequiredService>();
Assert.NotNull(options.Value);
@@ -92,7 +92,7 @@ public void InitializeConfigurationAndOptions_Stdio()
var provider = services.BuildServiceProvider();
// Assert
- var options = provider.GetRequiredService>();
+ var options = provider.GetRequiredService>();
Assert.NotNull(options.Value);
@@ -117,7 +117,7 @@ public void InitializeConfigurationAndOptions_WithSupportLoggingFolder_DisablesT
{
DangerouslyWriteSupportLogsToDir = "/tmp/logs"
};
- var services = SetupBaseServices().AddSingleton(Microsoft.Extensions.Options.Options.Create(serviceStartOptions));
+ var services = SetupBaseServices().AddSingleton(ExtensionsOptions.Options.Create(serviceStartOptions));
// Act
Environment.SetEnvironmentVariable("AZURE_MCP_COLLECT_TELEMETRY", null);
@@ -125,7 +125,7 @@ public void InitializeConfigurationAndOptions_WithSupportLoggingFolder_DisablesT
var provider = services.BuildServiceProvider();
// Assert
- var options = provider.GetRequiredService>();
+ var options = provider.GetRequiredService>();
Assert.False(options.Value.IsTelemetryEnabled, "Telemetry should be disabled when support logging folder is set");
}
@@ -141,7 +141,7 @@ public void InitializeConfigurationAndOptions_WithSupportLoggingFolderAndEnvVarT
{
DangerouslyWriteSupportLogsToDir = "/tmp/logs"
};
- var services = SetupBaseServices().AddSingleton(Microsoft.Extensions.Options.Options.Create(serviceStartOptions));
+ var services = SetupBaseServices().AddSingleton(ExtensionsOptions.Options.Create(serviceStartOptions));
// Act
Environment.SetEnvironmentVariable("AZURE_MCP_COLLECT_TELEMETRY", "true");
@@ -149,7 +149,7 @@ public void InitializeConfigurationAndOptions_WithSupportLoggingFolderAndEnvVarT
var provider = services.BuildServiceProvider();
// Assert
- var options = provider.GetRequiredService>();
+ var options = provider.GetRequiredService>();
Assert.False(options.Value.IsTelemetryEnabled, "Telemetry should be disabled when support logging folder is set, regardless of environment variable");
}
@@ -167,7 +167,7 @@ public void InitializeConfigurationAndOptions_WithEmptyOrWhitespaceSupportLoggin
{
DangerouslyWriteSupportLogsToDir = folderPath
};
- var services = SetupBaseServices().AddSingleton(Microsoft.Extensions.Options.Options.Create(serviceStartOptions));
+ var services = SetupBaseServices().AddSingleton(ExtensionsOptions.Options.Create(serviceStartOptions));
// Act
Environment.SetEnvironmentVariable("AZURE_MCP_COLLECT_TELEMETRY", null);
@@ -175,7 +175,7 @@ public void InitializeConfigurationAndOptions_WithEmptyOrWhitespaceSupportLoggin
var provider = services.BuildServiceProvider();
// Assert
- var options = provider.GetRequiredService>();
+ var options = provider.GetRequiredService>();
Assert.True(options.Value.IsTelemetryEnabled, $"Telemetry should be enabled when support logging folder is '{folderPath}'");
}
}
diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ServiceCollectionExtensionsTests.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ServiceCollectionExtensionsTests.cs
index 4531ec380d..5c1e2dff21 100644
--- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ServiceCollectionExtensionsTests.cs
+++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ServiceCollectionExtensionsTests.cs
@@ -2,7 +2,6 @@
// Licensed under the MIT License.
using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Options;
using Microsoft.Mcp.Core.Areas.Server;
using Microsoft.Mcp.Core.Areas.Server.Commands;
using Microsoft.Mcp.Core.Areas.Server.Commands.Discovery;
@@ -15,12 +14,13 @@
using ModelContextProtocol.Server;
using NSubstitute;
using Xunit;
+using ExtensionsOptions = Microsoft.Extensions.Options;
namespace Azure.Mcp.Core.Tests.Areas.Server.Commands;
public class ServiceCollectionExtensionsTests
{
- private IServiceCollection SetupBaseServices()
+ private static IServiceCollection SetupBaseServices()
{
var services = CommandFactoryHelpers.SetupCommonServices();
services.AddSingleton(sp => CommandFactoryHelpers.CreateCommandFactory(sp));
@@ -37,7 +37,7 @@ private IServiceCollection SetupBaseServices()
Description = "Test description"
};
services.AddSingleton(serverConfiguration);
- services.AddSingleton(Microsoft.Extensions.Options.Options.Create(serverConfiguration));
+ services.AddSingleton(ExtensionsOptions.Options.Create(serverConfiguration));
return services;
}
@@ -191,7 +191,7 @@ public void AddAzureMcpServer_ConfiguresMcpServerOptions()
// Assert
var provider = services.BuildServiceProvider();
- var mcpServerOptions = provider.GetService>()?.Value;
+ var mcpServerOptions = provider.GetService>()?.Value;
// Verify server options are configured
Assert.NotNull(mcpServerOptions);
@@ -219,7 +219,7 @@ public void AddAzureMcpServer_RegistersOptionsWithSameInstance()
// Assert
var provider = services.BuildServiceProvider();
var registeredOptions = provider.GetService();
- var wrappedOptions = provider.GetService>()?.Value;
+ var wrappedOptions = provider.GetService>()?.Value;
// Verify both registrations point to the same instance
Assert.NotNull(registeredOptions);
@@ -251,7 +251,7 @@ public void AddAzureMcpServer_WithReadOnlyOption_RegistersOption()
Assert.True(registeredOptions.ReadOnly);
// Verify the option is also available as IOptions
- var optionsMonitor = provider.GetService>();
+ var optionsMonitor = provider.GetService>();
Assert.NotNull(optionsMonitor);
Assert.True(optionsMonitor.Value.ReadOnly);
}
@@ -399,7 +399,7 @@ public void AddAzureMcpServer_WithNullProvider_ConfiguresNullServerInstructions(
// Assert
var provider = services.BuildServiceProvider();
- var mcpServerOptions = provider.GetService>()?.Value;
+ var mcpServerOptions = provider.GetService>()?.Value;
// Verify server instructions are configured
Assert.NotNull(mcpServerOptions);
@@ -426,7 +426,7 @@ public void AddAzureMcpServer_WithProvider_ConfiguresServerInstructions()
// Assert
var provider = services.BuildServiceProvider();
- var mcpServerOptions = provider.GetService>()?.Value;
+ var mcpServerOptions = provider.GetService>()?.Value;
// Verify server instructions are configured
Assert.NotNull(mcpServerOptions);
diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ServiceInfoCommandTests.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ServiceInfoCommandTests.cs
index 802c5cf335..6758b266ef 100644
--- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ServiceInfoCommandTests.cs
+++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ServiceInfoCommandTests.cs
@@ -6,6 +6,7 @@
using Microsoft.Mcp.Core.Configuration;
using Microsoft.Mcp.Tests.Client;
using Xunit;
+using ExtensionsOptions = Microsoft.Extensions.Options;
namespace Azure.Mcp.Core.Tests.Areas.Server.Commands;
@@ -24,7 +25,7 @@ public ServiceInfoCommandTests()
Description = "Test Description",
RootCommandGroupName = "azmcp"
};
- Services.AddSingleton(Microsoft.Extensions.Options.Options.Create(_mcpServerConfiguration));
+ Services.AddSingleton(ExtensionsOptions.Options.Create(_mcpServerConfiguration));
}
[Fact]
diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ToolLoading/CommandFactoryToolLoaderTests.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ToolLoading/CommandFactoryToolLoaderTests.cs
index 49baeb48af..993a886a6a 100644
--- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ToolLoading/CommandFactoryToolLoaderTests.cs
+++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ToolLoading/CommandFactoryToolLoaderTests.cs
@@ -5,6 +5,7 @@
using System.CommandLine;
using System.Net;
+using System.Reflection;
using System.Text.Json;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
@@ -14,8 +15,10 @@
using Microsoft.Mcp.Core.Models.Command;
using Microsoft.Mcp.Core.Options;
using ModelContextProtocol.Protocol;
+using ModelContextProtocol.Server;
using NSubstitute;
using Xunit;
+using ExtensionsOptions = Microsoft.Extensions.Options;
namespace Azure.Mcp.Core.Tests.Areas.Server.Commands.ToolLoading;
@@ -27,16 +30,16 @@ private static (CommandFactoryToolLoader toolLoader, ICommandFactory commandFact
var commandFactory = CommandFactoryHelpers.CreateCommandFactory(serviceProvider);
var loggerFactory = serviceProvider.GetRequiredService();
var logger = loggerFactory.CreateLogger();
- var toolLoaderOptions = Microsoft.Extensions.Options.Options.Create(options ?? new ToolLoaderOptions());
+ var toolLoaderOptions = ExtensionsOptions.Options.Create(options ?? new ToolLoaderOptions());
var toolLoader = new CommandFactoryToolLoader(serviceProvider, commandFactory, toolLoaderOptions, logger);
return (toolLoader, commandFactory);
}
- private static ModelContextProtocol.Server.RequestContext CreateRequest()
+ private static RequestContext CreateRequest()
{
- var mockServer = Substitute.For();
- return new ModelContextProtocol.Server.RequestContext(mockServer, new() { Method = RequestMethods.ToolsList })
+ var mockServer = Substitute.For();
+ return new RequestContext(mockServer, new() { Method = RequestMethods.ToolsList })
{
Params = new ListToolsRequestParams()
};
@@ -326,8 +329,8 @@ public async Task CallToolHandler_WithValidTool_ExecutesSuccessfully()
var availableCommands = CommandFactory.GetVisibleCommands(commandFactory.AllCommands);
var firstCommand = availableCommands.First();
- var mockServer = Substitute.For();
- var request = new ModelContextProtocol.Server.RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
+ var mockServer = Substitute.For();
+ var request = new RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
{
Params = new CallToolRequestParams
{
@@ -348,8 +351,8 @@ public async Task CallToolHandler_WithNullParams_ReturnsError()
{
var (toolLoader, _) = CreateToolLoader();
- var mockServer = Substitute.For();
- var request = new ModelContextProtocol.Server.RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall }, null!);
+ var mockServer = Substitute.For();
+ var request = new RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall }, null!);
var result = await toolLoader.CallToolHandler(request, TestContext.Current.CancellationToken);
@@ -368,8 +371,8 @@ public async Task CallToolHandler_WithUnknownTool_ReturnsError()
{
var (toolLoader, _) = CreateToolLoader();
- var mockServer = Substitute.For();
- var request = new ModelContextProtocol.Server.RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
+ var mockServer = Substitute.For();
+ var request = new RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
{
Params = new CallToolRequestParams
{
@@ -459,10 +462,10 @@ public async Task CallToolHandler_BeforeListToolsHandler_ExecutesSuccessfully()
var targetCommand = subscriptionListCommand;
- var mockServer = Substitute.For();
+ var mockServer = Substitute.For();
var arguments = new Dictionary();
- var callToolRequest = new ModelContextProtocol.Server.RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
+ var callToolRequest = new RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
{
Params = new CallToolRequestParams
{
@@ -610,7 +613,7 @@ public async Task ListToolsHandler_EnumOption_IsExportedAsStringType()
var serviceProvider = CommandFactoryHelpers.CreateDefaultServiceProvider();
var loggerFactory = serviceProvider.GetRequiredService();
var logger = loggerFactory.CreateLogger();
- var toolLoaderOptions = Microsoft.Extensions.Options.Options.Create(new ToolLoaderOptions());
+ var toolLoaderOptions = ExtensionsOptions.Options.Create(new ToolLoaderOptions());
var fakeSystemCommand = new Command("fake-enum-get", "A fake command with an enum option for testing.");
OptionBinder.RegisterOptions(fakeSystemCommand);
@@ -621,7 +624,7 @@ public async Task ListToolsHandler_EnumOption_IsExportedAsStringType()
fakeCommand.Metadata.Returns(new ToolMetadata());
var commandFactory = CommandFactoryHelpers.CreateCommandFactory(serviceProvider);
- var commandMapField = typeof(CommandFactory).GetField("_commandMap", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
+ var commandMapField = typeof(CommandFactory).GetField("_commandMap", BindingFlags.NonPublic | BindingFlags.Instance);
var commandMap = (Dictionary)commandMapField!.GetValue(commandFactory)!;
commandMap["fake-enum-get"] = fakeCommand;
@@ -706,7 +709,7 @@ public async Task ListToolsHandler_ToolsWithSecretMetadata_HaveSecretHintInMeta(
var serviceProvider = CommandFactoryHelpers.CreateDefaultServiceProvider();
var loggerFactory = serviceProvider.GetRequiredService();
var logger = loggerFactory.CreateLogger();
- var toolLoaderOptions = Microsoft.Extensions.Options.Options.Create(new ToolLoaderOptions());
+ var toolLoaderOptions = ExtensionsOptions.Options.Create(new ToolLoaderOptions());
// Create a fake command factory that includes a command with secret metadata
var fakeCommand = Substitute.For();
@@ -721,7 +724,7 @@ public async Task ListToolsHandler_ToolsWithSecretMetadata_HaveSecretHintInMeta(
var commandFactory = CommandFactoryHelpers.CreateCommandFactory(serviceProvider);
// Add our fake command to the internal command map using reflection
- var commandMapField = typeof(CommandFactory).GetField("_commandMap", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
+ var commandMapField = typeof(CommandFactory).GetField("_commandMap", BindingFlags.NonPublic | BindingFlags.Instance);
var commandMap = (Dictionary)commandMapField!.GetValue(commandFactory)!;
commandMap["fake-secret-get"] = fakeCommand;
@@ -761,15 +764,15 @@ public async Task CallToolHandler_WithSecretTool_WhenClientDoesNotSupportElicita
.Returns(new CommandResponse { Status = HttpStatusCode.OK, Message = "Secret test response" });
// Add our fake command to the internal command map using reflection
- var commandMapField = typeof(CommandFactory).GetField("_commandMap", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
+ var commandMapField = typeof(CommandFactory).GetField("_commandMap", BindingFlags.NonPublic | BindingFlags.Instance);
var commandMap = (Dictionary)commandMapField!.GetValue(commandFactory)!;
commandMap["fake-secret-get"] = fakeCommand;
// Create mock server without elicitation capabilities
- var mockServer = Substitute.For();
+ var mockServer = Substitute.For();
mockServer.ClientCapabilities.Returns((ClientCapabilities?)null);
- var request = new ModelContextProtocol.Server.RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
+ var request = new RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
{
Params = new CallToolRequestParams
{
@@ -801,16 +804,16 @@ public async Task CallToolHandler_WithNonSecretTool_DoesNotTriggerElicitation()
.Returns(new CommandResponse { Status = HttpStatusCode.OK, Message = "Test response" });
// Add our fake command to the internal command map using reflection
- var commandMapField = typeof(CommandFactory).GetField("_commandMap", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
+ var commandMapField = typeof(CommandFactory).GetField("_commandMap", BindingFlags.NonPublic | BindingFlags.Instance);
var commandMap = (Dictionary)commandMapField!.GetValue(commandFactory)!;
commandMap["fake-non-secret-get"] = fakeCommand;
// Create mock server with elicitation capabilities
- var mockServer = Substitute.For();
+ var mockServer = Substitute.For();
var capabilities = new ClientCapabilities { Elicitation = new ElicitationCapability() };
mockServer.ClientCapabilities.Returns(capabilities);
- var request = new ModelContextProtocol.Server.RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
+ var request = new RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
{
Params = new CallToolRequestParams
{
@@ -843,15 +846,15 @@ public async Task CallToolHandler_WithSecretTool_WhenDangerouslyDisableElicitati
.Returns(new CommandResponse { Status = HttpStatusCode.OK, Message = "Secret test response" });
// Add our fake command to the internal command map using reflection
- var commandMapField = typeof(CommandFactory).GetField("_commandMap", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
+ var commandMapField = typeof(CommandFactory).GetField("_commandMap", BindingFlags.NonPublic | BindingFlags.Instance);
var commandMap = (Dictionary)commandMapField!.GetValue(commandFactory)!;
commandMap["fake-secret-get"] = fakeCommand;
// Create mock server - elicitation support doesn't matter when bypassed
- var mockServer = Substitute.For();
+ var mockServer = Substitute.For();
mockServer.ClientCapabilities.Returns((ClientCapabilities?)null);
- var request = new ModelContextProtocol.Server.RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
+ var request = new RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
{
Params = new CallToolRequestParams
{
@@ -888,15 +891,15 @@ public async Task CallToolHandler_WithSecretTool_WhenDangerouslyDisableElicitati
.Returns(new CommandResponse { Status = HttpStatusCode.OK, Message = "Secret test response" });
// Add our fake command to the internal command map using reflection
- var commandMapField = typeof(CommandFactory).GetField("_commandMap", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
+ var commandMapField = typeof(CommandFactory).GetField("_commandMap", BindingFlags.NonPublic | BindingFlags.Instance);
var commandMap = (Dictionary)commandMapField!.GetValue(commandFactory)!;
commandMap["fake-secret-get"] = fakeCommand;
// Create mock server without elicitation capabilities
- var mockServer = Substitute.For();
+ var mockServer = Substitute.For();
mockServer.ClientCapabilities.Returns((ClientCapabilities?)null);
- var request = new ModelContextProtocol.Server.RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
+ var request = new RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
{
Params = new CallToolRequestParams
{
@@ -950,8 +953,8 @@ public async Task CallToolHandler_WithToolFilter_AllowsSpecifiedTool()
var toolOptions = new ToolLoaderOptions { Tool = [specificToolName] };
var (toolLoader, _) = CreateToolLoader(toolOptions);
- var mockServer = Substitute.For();
- var request = new ModelContextProtocol.Server.RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
+ var mockServer = Substitute.For();
+ var request = new RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
{
Params = new CallToolRequestParams
{
@@ -993,8 +996,8 @@ public async Task CallToolHandler_WithToolFilter_RejectsNonSpecifiedTool()
var toolOptions = new ToolLoaderOptions { Tool = [specificToolName] };
var (toolLoader, _) = CreateToolLoader(toolOptions);
- var mockServer = Substitute.For();
- var request = new ModelContextProtocol.Server.RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
+ var mockServer = Substitute.For();
+ var request = new RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
{
Params = new CallToolRequestParams
{
@@ -1032,8 +1035,8 @@ public async Task CallToolHandler_WithToolFilterCaseInsensitive_AllowsSpecifiedT
var toolOptions = new ToolLoaderOptions { Tool = [specificToolName.ToUpperInvariant()] }; // Set filter to uppercase
var (toolLoader, _) = CreateToolLoader(toolOptions);
- var mockServer = Substitute.For();
- var request = new ModelContextProtocol.Server.RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
+ var mockServer = Substitute.For();
+ var request = new RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
{
Params = new CallToolRequestParams
{
@@ -1134,12 +1137,12 @@ public async Task CallToolHandler_WithReadOnlyMode_RejectsNonReadOnlyTool()
fakeCommand.Title.Returns("Fake Write Tool");
fakeCommand.Metadata.Returns(new ToolMetadata { ReadOnly = false });
- var commandMapField = typeof(CommandFactory).GetField("_commandMap", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
+ var commandMapField = typeof(CommandFactory).GetField("_commandMap", BindingFlags.NonPublic | BindingFlags.Instance);
var commandMap = (Dictionary)commandMapField!.GetValue(commandFactory)!;
commandMap["fake-write-tool"] = fakeCommand;
- var mockServer = Substitute.For();
- var request = new ModelContextProtocol.Server.RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
+ var mockServer = Substitute.For();
+ var request = new RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
{
Params = new CallToolRequestParams
{
@@ -1175,12 +1178,12 @@ public async Task CallToolHandler_WithReadOnlyMode_AllowsReadOnlyTool()
fakeCommand.ExecuteAsync(Arg.Any(), Arg.Any(), Arg.Any())
.Returns(new CommandResponse { Status = HttpStatusCode.OK, Message = "Read-only test response" });
- var commandMapField = typeof(CommandFactory).GetField("_commandMap", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
+ var commandMapField = typeof(CommandFactory).GetField("_commandMap", BindingFlags.NonPublic | BindingFlags.Instance);
var commandMap = (Dictionary)commandMapField!.GetValue(commandFactory)!;
commandMap["fake-readonly-tool"] = fakeCommand;
- var mockServer = Substitute.For();
- var request = new ModelContextProtocol.Server.RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
+ var mockServer = Substitute.For();
+ var request = new RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
{
Params = new CallToolRequestParams
{
@@ -1211,12 +1214,12 @@ public async Task CallToolHandler_WithHttpMode_RejectsLocalRequiredTool()
fakeCommand.Title.Returns("Fake Local Tool");
fakeCommand.Metadata.Returns(new ToolMetadata { LocalRequired = true });
- var commandMapField = typeof(CommandFactory).GetField("_commandMap", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
+ var commandMapField = typeof(CommandFactory).GetField("_commandMap", BindingFlags.NonPublic | BindingFlags.Instance);
var commandMap = (Dictionary)commandMapField!.GetValue(commandFactory)!;
commandMap["fake-local-tool"] = fakeCommand;
- var mockServer = Substitute.For();
- var request = new ModelContextProtocol.Server.RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
+ var mockServer = Substitute.For();
+ var request = new RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
{
Params = new CallToolRequestParams
{
@@ -1252,12 +1255,12 @@ public async Task CallToolHandler_WithoutReadOnlyMode_AllowsNonReadOnlyTool()
fakeCommand.ExecuteAsync(Arg.Any(), Arg.Any(), Arg.Any())
.Returns(new CommandResponse { Status = HttpStatusCode.OK, Message = "Write test response" });
- var commandMapField = typeof(CommandFactory).GetField("_commandMap", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
+ var commandMapField = typeof(CommandFactory).GetField("_commandMap", BindingFlags.NonPublic | BindingFlags.Instance);
var commandMap = (Dictionary)commandMapField!.GetValue(commandFactory)!;
commandMap["fake-write-tool-2"] = fakeCommand;
- var mockServer = Substitute.For();
- var request = new ModelContextProtocol.Server.RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
+ var mockServer = Substitute.For();
+ var request = new RequestContext(mockServer, new() { Method = RequestMethods.ToolsCall })
{
Params = new CallToolRequestParams
{
diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ToolLoading/NamespaceToolLoaderTests.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ToolLoading/NamespaceToolLoaderTests.cs
index e0ec729ed7..da36473cb7 100644
--- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ToolLoading/NamespaceToolLoaderTests.cs
+++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.Tests/Areas/Server/Commands/ToolLoading/NamespaceToolLoaderTests.cs
@@ -4,19 +4,24 @@
#pragma warning disable MCP9003 // Obsolete RequestContext constructor - migrating during Phase 1
#pragma warning disable MCP9005 // Deprecated Sampling/Logging APIs - backward compat during Phase 1
+using System.CommandLine;
+using System.Net;
using System.Text.Json;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
-using Microsoft.Extensions.Options;
using Microsoft.Mcp.Core.Areas.Server.Commands.Discovery;
using Microsoft.Mcp.Core.Areas.Server.Commands.ToolLoading;
using Microsoft.Mcp.Core.Areas.Server.Options;
using Microsoft.Mcp.Core.Commands;
using Microsoft.Mcp.Core.Helpers;
+using Microsoft.Mcp.Core.Models.Command;
+using ModelContextProtocol.Client;
using ModelContextProtocol.Protocol;
+using ModelContextProtocol.Server;
using NSubstitute;
using Xunit;
+using ExtensionsOptions = Microsoft.Extensions.Options;
namespace Azure.Mcp.Core.Tests.Areas.Server.Commands.ToolLoading;
@@ -24,7 +29,7 @@ public sealed class NamespaceToolLoaderTests : IAsyncDisposable
{
private readonly ServiceProvider _serviceProvider;
private readonly ICommandFactory _commandFactory;
- private readonly IOptions _options;
+ private readonly ExtensionsOptions.IOptions _options;
private readonly ILogger _logger;
public NamespaceToolLoaderTests()
@@ -32,7 +37,7 @@ public NamespaceToolLoaderTests()
_serviceProvider = CommandFactoryHelpers.CreateDefaultServiceProvider() as ServiceProvider
?? throw new InvalidOperationException("Failed to create service provider");
_commandFactory = CommandFactoryHelpers.CreateCommandFactory(_serviceProvider);
- _options = Microsoft.Extensions.Options.Options.Create(new ServerStartOptions());
+ _options = ExtensionsOptions.Options.Create(new ServerStartOptions());
_logger = NullLogger