Skip to content

Add Azure Device Registry tool to Azure MCP Server #1961

Open
nimengan wants to merge 6 commits intomicrosoft:mainfrom
nimengan:adr-mcp
Open

Add Azure Device Registry tool to Azure MCP Server #1961
nimengan wants to merge 6 commits intomicrosoft:mainfrom
nimengan:adr-mcp

Conversation

@nimengan
Copy link

@nimengan nimengan commented Mar 6, 2026

What does this PR do?

Adds a new Azure.Mcp.Tools.DeviceRegistry toolset with the deviceregistry_namespace_list command, which lists Azure Device Registry namespaces in a specified subscription and optional resource group

[Any additional context, screenshots, or information that helps reviewers]

GitHub issue number?

#1962

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Updated servers/Azure.Mcp.Server/CHANGELOG.md and/or servers/Fabric.Mcp.Server/CHANGELOG.md for product changes (features, bug fixes, UI/UX, updated dependencies)
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Validate README.md changes using script at eng/scripts/Process-PackageReadMe.ps1. See Package README
    • Updated command list in /servers/Azure.Mcp.Server/docs/azmcp-commands.md and/or /docs/fabric-commands.md
    • Run .\eng\scripts\Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
    • For tools with new names, including new tools or renamed tools, update consolidated-tools.json
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated test prompts in /servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

Copilot AI review requested due to automatic review settings March 7, 2026 00:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Azure Device Registry tool area to the Azure MCP Server, introducing a first command to list Device Registry namespaces via the server’s command/tool framework.

Changes:

  • Introduces new Azure.Mcp.Tools.DeviceRegistry tool project with deviceregistry namespace list command and supporting service/models.
  • Adds unit tests + live/recorded-test scaffolding and test resource deployment templates for the new tool.
  • Wires the tool into Azure MCP Server registration and documentation/metadata (docs, consolidated tools, CODEOWNERS, solutions, packages, changelog entry).

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tools/Azure.Mcp.Tools.DeviceRegistry/src/Azure.Mcp.Tools.DeviceRegistry.csproj New tool project with dependencies and AOT compatibility setting.
tools/Azure.Mcp.Tools.DeviceRegistry/src/GlobalUsings.cs Adds project-wide System.CommandLine global using.
tools/Azure.Mcp.Tools.DeviceRegistry/src/AssemblyInfo.cs Exposes internals to unit/live test assemblies.
tools/Azure.Mcp.Tools.DeviceRegistry/src/DeviceRegistrySetup.cs Registers DI services and command groups for the new area.
tools/Azure.Mcp.Tools.DeviceRegistry/src/Commands/BaseDeviceRegistryCommand.cs Base command type for Device Registry commands (subscription-based).
tools/Azure.Mcp.Tools.DeviceRegistry/src/Commands/DeviceRegistryJsonContext.cs Source-generated System.Text.Json context for tool payloads.
tools/Azure.Mcp.Tools.DeviceRegistry/src/Commands/Namespace/NamespaceListCommand.cs Implements the namespace list command and tool response shaping.
tools/Azure.Mcp.Tools.DeviceRegistry/src/Models/DeviceRegistryNamespaceInfo.cs Output model for namespace list results.
tools/Azure.Mcp.Tools.DeviceRegistry/src/Options/BaseDeviceRegistryOptions.cs Base options for Device Registry commands (subscription).
tools/Azure.Mcp.Tools.DeviceRegistry/src/Options/DeviceRegistryOptionDefinitions.cs Adds a --namespace option definition (for future commands).
tools/Azure.Mcp.Tools.DeviceRegistry/src/Options/Namespace/NamespaceListOptions.cs Options type for namespace list command.
tools/Azure.Mcp.Tools.DeviceRegistry/src/Services/IDeviceRegistryService.cs Service contract for namespace listing.
tools/Azure.Mcp.Tools.DeviceRegistry/src/Services/DeviceRegistryService.cs Resource Graph-backed implementation for listing namespaces.
tools/Azure.Mcp.Tools.DeviceRegistry/src/Services/Models/DeviceRegistryNamespaceData.cs Resource Graph deserialization models.
tools/Azure.Mcp.Tools.DeviceRegistry/tests/Azure.Mcp.Tools.DeviceRegistry.UnitTests/Azure.Mcp.Tools.DeviceRegistry.UnitTests.csproj New unit test project for the tool.
tools/Azure.Mcp.Tools.DeviceRegistry/tests/Azure.Mcp.Tools.DeviceRegistry.UnitTests/Namespace/NamespaceListCommandTests.cs Unit tests for namespace list behavior and error handling.
tools/Azure.Mcp.Tools.DeviceRegistry/tests/Azure.Mcp.Tools.DeviceRegistry.LiveTests/Azure.Mcp.Tools.DeviceRegistry.LiveTests.csproj New live/recorded test project for server-integrated tool invocation.
tools/Azure.Mcp.Tools.DeviceRegistry/tests/Azure.Mcp.Tools.DeviceRegistry.LiveTests/assets.json Recording assets configuration for externalized recordings.
tools/Azure.Mcp.Tools.DeviceRegistry/tests/Azure.Mcp.Tools.DeviceRegistry.LiveTests/DeviceRegistryCommandTests.cs Live tests invoking deviceregistry_namespace_list.
tools/Azure.Mcp.Tools.DeviceRegistry/tests/test-resources.bicep Deploys Device Registry namespace + RBAC for test principal.
tools/Azure.Mcp.Tools.DeviceRegistry/tests/test-resources-post.ps1 Post-deploy script for test resource deployment.
servers/Azure.Mcp.Server/src/Program.cs Registers the new Device Registry area setup.
servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json Adds consolidated tool mapping for Device Registry namespace listing.
servers/Azure.Mcp.Server/docs/azmcp-commands.md Documents the new azmcp deviceregistry namespace list CLI command.
servers/Azure.Mcp.Server/docs/e2eTestPrompts.md Adds e2e prompts for the new tool.
servers/Azure.Mcp.Server/changelog-entries/1772227057670.yaml Adds changelog entry for the new command.
Directory.Packages.props Introduces Azure.ResourceManager.DeviceRegistry package version pin.
servers/Azure.Mcp.Server/Azure.Mcp.Server.slnx Adds DeviceRegistry projects to the server solution filter.
Microsoft.Mcp.slnx Adds DeviceRegistry projects to the root solution filter.
.github/CODEOWNERS Adds code ownership rules for the new tool directory.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@anannya03 anannya03 self-assigned this Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

3 participants