Add Azure Monitor Instrumentation MCP Server#1960
Conversation
…nstrumentation tool according to #file:new-command.md
…tool metadata in azmcp-commands.md
…Tools_Successfully test
There was a problem hiding this comment.
Pull request overview
Adds a new Azure Monitor Instrumentation area/tooling to the Azure MCP Server to provide deterministic, step-by-step onboarding and (App Insights 2.x → 3.x) migration guidance for local workspaces, plus a bundled set of learning resources and generator configs.
Changes:
- Introduces an orchestrator-based workflow (
orchestrator_start/orchestrator_next) and a brownfield findings submission flow. - Adds a generator pipeline (detectors + generators) and embedded learning-resource content to drive guidance.
- Wires the new area into the server (registration, consolidated tool mapping, docs, changelog, slnx).
Reviewed changes
Copilot reviewed 67 out of 67 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Tools/SubmitBrownfieldAnalysisTool.cs | MCP tool for submitting brownfield findings and generating a migration spec |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Tools/OrchestratorTool.cs | Main orchestrator tool managing sessions and action progression |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Tools/ListLearningResourcesTool.cs | Lists local markdown learning resources under Resources/ |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Tools/GetLearningResourceTool.cs | Reads a specific resource file with path traversal protections |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Resources/migration/dotnet/appinsights-2x-to-3x-no-code-change.md | Migration guidance content (no-code-change path) |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Resources/migration/dotnet/appinsights-2x-to-3x-code-migration.md | Migration guidance content (code-change path) |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Resources/generator-configs/templates/aspnetcore/instrumentation-code.cs | Code template snippet for ASP.NET Core greenfield instrumentation |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Resources/generator-configs/aspnetcore-greenfield.json | Generator config describing greenfield onboarding actions |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Resources/generator-configs/aspnet-classic-greenfield.json | Generator config for classic ASP.NET onboarding (future/unused in this PR) |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Resources/examples/dotnet/aspnetcore-setup.md | Example learning resource for ASP.NET Core setup |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Resources/concepts/dotnet/opentelemetry-pipeline.md | Concept resource: OTel pipeline overview |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Resources/concepts/dotnet/azure-monitor-distro.md | Concept resource: Azure Monitor distro overview |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Resources/api-reference/dotnet/WithTracing.md | API reference content: tracing configuration |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Resources/api-reference/dotnet/WithMetrics.md | API reference content: metrics configuration |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Resources/api-reference/dotnet/WithLogging.md | API reference content: logging configuration |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Resources/api-reference/dotnet/UseAzureMonitorExporter.md | API reference content: exporter helper |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Resources/api-reference/dotnet/UseAzureMonitor.md | API reference content: distro helper |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Resources/api-reference/dotnet/SdkCreateTracerProviderBuilder.md | API reference content: legacy per-signal builders |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Resources/api-reference/dotnet/Sampling.md | API reference content: sampling overview |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Resources/api-reference/dotnet/OpenTelemetrySdkCreate.md | API reference content: non-host multi-signal setup |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Resources/api-reference/dotnet/LogProcessors.md | API reference content: log processor patterns |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Resources/api-reference/dotnet/ConfigureResource.md | API reference content: resource configuration |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Resources/api-reference/dotnet/ConfigureOpenTelemetryProvider.md | API reference content: ConfigureOpenTelemetry*Provider |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Resources/api-reference/dotnet/AzureMonitorExporter.md | API reference content: per-signal exporters |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Resources/api-reference/dotnet/AddOpenTelemetry.md | API reference content: hosted AddOpenTelemetry() |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Resources/api-reference/dotnet/AddApplicationInsightsTelemetry.md | API reference content: AI SDK 3.x AddApplicationInsightsTelemetry() |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Resources/api-reference/dotnet/ActivityProcessors.md | API reference content: activity processors patterns |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Pipeline/WorkspaceAnalyzer.cs | Analyzer pipeline orchestrating detectors and generator selection |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Options/MonitorInstrumentationOptionDefinitions.cs | CLI option definitions for the new commands |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Options/CommandOptions.cs | Options models for command binding |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/MonitorInstrumentationSetup.cs | Area setup wiring DI + command registration |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Models/OnboardingSpecValidator.cs | Validates generated onboarding specs |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Models/OnboardingSpecBuilder.cs | Fluent builder for onboarding specs and config-driven actions |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Models/OnboardingSpec.cs | Spec model |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Models/OnboardingJsonContext.cs | STJ source-gen context for models/response types |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Models/OnboardingAction.cs | Action model + typed detail records |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Models/GeneratorConfigLoader.cs | Loads generator configs/templates from embedded resources |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Models/Enums.cs | Enum definitions for language/app type/state/action type |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Models/Decision.cs | Decision model |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Models/Constants.cs | Shared constants used by generators/workflow |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Models/BrownfieldFindings.cs | Brownfield findings schema submitted by the agent |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Models/Analysis.cs | Analysis model and related records |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Models/ActionDetailsExtensions.cs | Converts typed action details to dictionary form |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/GlobalUsings.cs | Global usings for commandline parsing types |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Generators/IGenerator.cs | Generator interface |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Generators/AspNetCoreGreenfieldGenerator.cs | Greenfield generator using JSON config |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Generators/AspNetCoreBrownfieldGenerator.cs | Brownfield generator producing targeted migration plan |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Detectors/PythonInstrumentationRegistry.cs | Python instrumentation registry loader (not wired in setup yet) |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Detectors/IDetectors.cs | Detector interfaces and result record |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Detectors/DotNetLanguageDetector.cs | Detects .NET workspaces |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Detectors/DotNetInstrumentationDetector.cs | Detects existing instrumentation in .NET projects/config |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Detectors/DotNetAppTypeDetector.cs | Detects .NET project types and entry points |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Commands/SubmitBrownfieldAnalysisCommand.cs | CLI command wrapping brownfield submission tool |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Commands/OrchestratorStartCommand.cs | CLI command wrapping orchestrator start |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Commands/OrchestratorNextCommand.cs | CLI command wrapping orchestrator next |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Commands/MonitorInstrumentationJsonContext.cs | STJ source-gen context for string result payloads |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Commands/ListLearningResourcesCommand.cs | CLI command wrapping list resources tool |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Commands/GetLearningResourceCommand.cs | CLI command wrapping get resource tool |
| tools/Azure.Mcp.Tools.MonitorInstrumentation/src/Azure.Mcp.Tools.MonitorInstrumentation.csproj | New tool project definition + embedded/content resources |
| servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json | Adds a new “guide_azure_monitor_instrumentation” consolidated tool mapping |
| servers/Azure.Mcp.Server/src/Program.cs | Registers the new area setup in the server |
| servers/Azure.Mcp.Server/README.md | Adds prompt examples + area listing for Monitor Instrumentation |
| servers/Azure.Mcp.Server/docs/e2eTestPrompts.md | Adds e2e prompts for the new tools |
| servers/Azure.Mcp.Server/docs/azmcp-commands.md | Documents new azmcp monitorinstrumentation ... commands |
| servers/Azure.Mcp.Server/CHANGELOG.md | Adds changelog entry for the new tool area |
| servers/Azure.Mcp.Server/changelog-entries/1772839803444.yaml | Adds a changelog-entry YAML for the feature |
| Microsoft.Mcp.slnx | Adds the new project to the solution tree |
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Looking good, next step will be to add tests for the newly added tool and commands. see https://github.com/Azure/azure-mcp/blob/main/docs/new-command.md#%EF%B8%8F-test-infrastructure-requirements
…elContextProtocol package.
…aSyncTests.AzCommandsMetadata_Should_Be_Synchronized
I've addressed the feedbacks and added unit tests. Can you review it again? |
* Add support for only AspNetCore * adjust code * Check #file:azmcp-commands.md to see if it's updated for the MonitorInstrumentation tool according to #file:new-command.md * Run `cd .\eng\scripts\ && .\Update-AzCommandsMetadata.ps1` to update tool metadata in azmcp-commands.md * Update CHANGELOG * Updated servers/Azure.Mcp.Server/README.md documentation * Updated test prompts in /servers/Azure.Mcp.Server/docs/e2eTestPrompts.md * all related MonitorInstrumentation prompts now meet rank <= 3 and score >= 0.4 * Pre-merge checklist item: update consolidated-tools.json as this is a new tool * Remove the links in markdowns * update additional changes * rename submit_brownfield_analysis to submit_brownfield_review * fix whitespace formatting and imports ordering * Revert command description changes * Fix ToolMetadata Properties to pass the ConsolidatedMode_Should_List_Tools_Successfully test * dotnet format Microsoft.Mcp.slnx * Address feedbacks * Rename SubmitBrownfieldAnalysis to SendBrownfieldAnalysis. Remove ModelContextProtocol package. * update name changes in md files and consolidated-tools.json * Add basic unit tests * Add more unit tests for OrchestratorTool and SendBrownfieldAnalysisTool * Fix error FINALNEWLINE: Fix final newline. * Fix error in Azure.Mcp.Server.UnitTests.Infrastructure.CommandMetadataSyncTests.AzCommandsMetadata_Should_Be_Synchronized
What does this PR do?
[Provide a clear, concise description of the changes]This MCP server namespace provides guided, deterministic onboarding for Azure Monitor (Application Insights / OpenTelemetry) instrumentation. It helps an agent or developer inspect a local workspace, choose the right instrumentation path (greenfield or brownfield), and execute migration/onboarding steps in a controlled sequence.
The official document for instrumenting customer's ASP.NET Core application manually is here: https://learn.microsoft.com/en-us/dotnet/api/overview/azure/monitor.opentelemetry.aspnetcore-readme?view=azure-dotnet
[Any additional context, screenshots, or information that helps reviewers]GitHub issue number?
[Link to the GitHub issue this PR addresses]#1801
Pre-merge Checklist
servers/Azure.Mcp.Server/CHANGELOG.mdand/orservers/Fabric.Mcp.Server/CHANGELOG.mdfor product changes (features, bug fixes, UI/UX, updated dependencies)servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationeng/scripts/Process-PackageReadMe.ps1. See Package README/servers/Azure.Mcp.Server/docs/azmcp-commands.mdand/or/docs/fabric-commands.md.\eng\scripts\Update-AzCommandsMetadata.ps1to update tool metadata in azmcp-commands.md (required for CI)ToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptsconsolidated-tools.json/servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline