Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
cd2fa76
enable packaging the Azure MCP Server as a RID-specific AOT .NET tool
baronfel Jun 20, 2025
2fe3c64
Add packaging doc and sync RIDs with npm processes
baronfel Jul 18, 2025
741063c
cleanup generated packages a bit - provide more useful details based …
baronfel Jul 18, 2025
76e4a9f
make a dotnet-focused version of the README to use in the tool package
baronfel Jul 18, 2025
37621ab
Suppress NU5104, fix server.json
joelverhagen Jul 18, 2025
b0983a2
Add schema, used in the mcpserver template
joelverhagen Jul 18, 2025
8262e8a
Automatically update the server.json
joelverhagen Jul 18, 2025
833c252
fix spelling
baronfel Jul 18, 2025
760c140
fix urls, ensure we use the 9 runtime so we can run tests
baronfel Jul 18, 2025
2f90133
Break out the conditions in a clearer way
joelverhagen Jul 18, 2025
43bc054
Ensure AspNetCoreRuntime is also installed
chidozieononiwu Jul 18, 2025
a65c066
another spelling
baronfel Jul 18, 2025
1a1a3c4
install the entire 9 SDK since it's not currently possible to install…
baronfel Jul 18, 2025
604f4d3
minor fixes after rebase
baronfel Jul 25, 2025
c1bac59
add changelog note for tool packaging
baronfel Jul 25, 2025
00223f8
remove custom README in favor of staying aligned wiht repo-root for now
baronfel Jul 26, 2025
d38816a
dotnet format with new SDK version
baronfel Jul 28, 2025
f1f814d
add .git-blame-ignore-revs file to prevent formatting commits from cl…
baronfel Jul 28, 2025
ce65498
Merge branch 'main' into package-as-AOT-dotnet-tool
baronfel Jul 29, 2025
42b6d3a
update test to check correct invariant
baronfel Jul 29, 2025
74f2b3b
add note about tie between TFM and docker base image version
baronfel Jul 29, 2025
fed4de5
Merge upstream changes
dsplaisted Aug 14, 2025
3821312
Remove .NET 10 Preview 6 workaround
dsplaisted Aug 14, 2025
1ad1e0e
Merge branch 'main' into package-as-AOT-dotnet-tool
joelverhagen Aug 21, 2025
5620313
Only set .NET tool properties when BuildNative is true
joelverhagen Aug 21, 2025
57438ec
Switched to latest System.Text.Json
joelverhagen Aug 21, 2025
f5cd59c
Merge remote-tracking branch 'origin/main' into package-as-AOT-dotnet…
joelverhagen Aug 21, 2025
d1107d4
Update core/src/AzureMcp.Cli/.mcp/server.json
joelverhagen Aug 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@
"MACPOOL",
"MACVMIMAGE",
"malaysiawest",
"mcpserver",
"mexicocentral",
"midsole",
"Microbundle",
Expand All @@ -387,9 +388,11 @@
"mygroup",
"myworkbook",
"mysvc",
"netstandard",
"newzealandnorth",
"Newtonsoft",
"Npgsql",
"nupkg",
"norequired",
"northcentralus",
"northeurope",
Expand Down
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ The Azure MCP Server updates automatically by default whenever a new release com
- Enhanced `BaseAzureService` with `EscapeKqlString` method for safe KQL query construction across all Azure services. [[#938](https://github.com/Azure/azure-mcp/pull/938)]
- Fixed KQL string escaping in Workbooks service queries.
- Standardized Azure Storage command descriptions, option names, and parameter names for consistency across all storage commands. Updated JSON serialization context to remove unused model types and improve organization. [[#1015](https://github.com/Azure/azure-mcp/pull/1015)]
- Update to .NET 10 SDK to prepare for .NET tool packing.
- Update to .NET 10 SDK to prepare for .NET tool packing. [[#1023](https://github.com/Azure/azure-mcp/pull/1023)]
- Enhance `bestpractices` and `azureterraformbestpractices` tool descriptions to better work with the vscode copilot tool grouping feature. [[#1029](https://github.com/Azure/azure-mcp/pull/1029)]
- The Azure MCP Server can now be packaged as a .NET SDK Tool for easier use by users with the .NET 10 SDK installed. [[#422](https://github.com/Azure/azure-mcp/issues/422)]

## 0.5.7 (2025-08-19)

Expand Down Expand Up @@ -584,4 +585,4 @@ The Azure MCP Server updates automatically by default whenever a new release com
- See https://github.com/Azure/azure-mcp/releases/tag/0.0.10

### Other Changes
- See Blog post for details https://devblogs.microsoft.com/azure-sdk/introducing-the-azure-mcp-server/
- See Blog post for details https://devblogs.microsoft.com/azure-sdk/introducing-the-azure-mcp-server/
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
<PackageVersion Include="System.Linq.AsyncEnumerable" Version="10.0.0-preview.5.25277.114" />
<PackageVersion Include="System.Net.ServerSentEvents" Version="10.0.0-preview.5.25277.114" />
<PackageVersion Include="System.Numerics.Tensors" Version="9.0.0" />
<PackageVersion Include="System.Text.Json" Version="9.0.8" />
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.12.0" />
<PackageVersion Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.3.0" />
<PackageVersion Include="Microsoft.Extensions.Azure" Version="1.11.0" />
Expand Down
31 changes: 31 additions & 0 deletions core/src/AzureMcp.Cli/.mcp/server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"$schema": "https://modelcontextprotocol.io/schemas/draft/2025-07-09/server.json",
"description": "$(PackageDescription)",
"name": "io.github.microsoft/mcp",
"packages": [
{
"registry_name": "nuget",
"name": "$(PackageId)",
"version": "$(PackageVersion)",
"package_arguments": [
{
"type": "positional",
"value": "server",
"value_hint": "server"
},
{
"type": "positional",
"value": "start",
"value_hint": "start"
}
]
}
],
"repository": {
"url": "$(RepositoryUrl)",
"source": "github"
},
"version_detail": {
"version": "$(PackageVersion)"
}
}
35 changes: 33 additions & 2 deletions core/src/AzureMcp.Cli/AzureMcp.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<DebugType>embedded</DebugType>
</PropertyGroup>

<!-- Enable Trim and AOT Analyzers -->
<PropertyGroup>
<EnableAotAnalyzer>true</EnableAotAnalyzer>
Expand All @@ -35,10 +34,40 @@
<SelfContained>true</SelfContained>
<IlcOptimizationPreference>Size</IlcOptimizationPreference>
<IlcFoldIdenticalMethodBodies>true</IlcFoldIdenticalMethodBodies>
<CopyOutputSymbolsToPublishDirectory>false</CopyOutputSymbolsToPublishDirectory>
</PropertyGroup>

<!-- .NET Tool Package settings -->
<PropertyGroup Condition="'$(BuildNative)' == 'true'">
<IsPackable>true</IsPackable>
<PackAsTool>true</PackAsTool>
<PackageType>McpServer</PackageType>
<PackageId>Azure.Mcp</PackageId>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<ToolCommandName>$(CliName)</ToolCommandName>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<!-- Keep these aligned with OS + arch build-matrix.json. -->
<RuntimeIdentifiers>win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
</PropertyGroup>

<!-- Properties for the root (RID-less) .NET Tool package -->
<PropertyGroup Condition="'$(BuildNative)' == 'true' and '$(RuntimeIdentifier)' == ''">
<PackageDescription>Azure MCP Server - Model Context Protocol implementation for Azure.</PackageDescription>
<PackageTags>azure;mcp;</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
<McpServerJsonTemplateFile>.mcp/server.json</McpServerJsonTemplateFile>
</PropertyGroup>
<ItemGroup Condition="'$(BuildNative)' == 'true' and '$(RuntimeIdentifier)' == ''">
<None Include="../../../README.md" Pack="true" PackagePath="./README.md" />
</ItemGroup>

<!-- Properties for the RID-specific .NET Tool packages -->
<PropertyGroup Condition="'$(BuildNative)' == 'true' and '$(RuntimeIdentifier)' != ''">
<PackageDescription>Azure MCP Server - Model Context Protocol implementation for Azure. Internal implementation package for $(RuntimeIdentifier).</PackageDescription>
</PropertyGroup>

<!-- Debug configuration -->
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<PublishSingleFile>false</PublishSingleFile>
<SelfContained>false</SelfContained>
<DebugType>portable</DebugType>
Expand Down Expand Up @@ -79,4 +108,6 @@
<ContentWithTargetPath Remove="@(FilesToRemove)" />
</ItemGroup>
</Target>

<Import Project="PackServerJson.targets" />
</Project>
101 changes: 101 additions & 0 deletions core/src/AzureMcp.Cli/PackServerJson.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<Project>
<!--
This targets file introduces a new target that runs during dotnet pack.

It reads a template .mcp/server.json file and fills in the placeholders. The resulting file is included in the output .NET tool package (a .nupkg file,NuGet package).

The schema of the .mcp/server.json file is owned by the MCP Registry project:
https://github.com/modelcontextprotocol/registry/blob/main/docs/server-json/README.md

It is used by NuGet.org to render the needed MCP client/host configuration (such as VS Code mcp.json). It is also used by VS Code when installing a NuGet-based MCP server so it can generate configuration during installation.

The server.json file declares the required inputs for the Azure MCP server process, such as CLI arguments that launch the stdio-based MCP server. The server.json file is only included in the root (RID-less) .NET tool package, based on the McpServerJsonTemplateFile property.

For more information about MCP servers in NuGet packages (.NET tool packages), see:
https://learn.microsoft.com/nuget/concepts/nuget-mcp
-->

<ItemGroup Condition="'$(RuntimeIdentifier)' == ''">
<!--
This dependency is already in the runtime graph via AzureMcp.Core.
Use it at pack time in SerializePropertiesToJson to fill in .mcp/server.json placeholders.
-->
<PackageReference Include="System.Text.Json" GeneratePathProperty="true" />
</ItemGroup>

<UsingTask TaskName="SerializePropertiesToJson" TaskFactory="RoslynCodeTaskFactory" AssemblyName="Microsoft.Build.Tasks.Core">
<ParameterGroup>
<PackageId ParameterType="System.String" Required="true" />
<PackageVersion ParameterType="System.String" Required="true" />
<PackageDescription ParameterType="System.String" Required="true" />
<RepositoryUrl ParameterType="System.String" Required="true" />

<JsonPackageId ParameterType="System.String" Output="true" />
<JsonPackageVersion ParameterType="System.String" Output="true" />
<JsonPackageDescription ParameterType="System.String" Output="true" />
<JsonRepositoryUrl ParameterType="System.String" Output="true" />
</ParameterGroup>
<Task>
<Reference Include="$(PkgSystem_Text_Json)/lib/netstandard2.0/System.Text.Json.dll"/>
<Using Namespace="System.Text.Json"/>
<Code Type="Fragment" Language="cs">
<![CDATA[
JsonPackageId = JsonSerializer.Serialize(PackageId);
JsonPackageVersion = JsonSerializer.Serialize(PackageVersion);
JsonPackageDescription = JsonSerializer.Serialize(PackageDescription);
JsonRepositoryUrl = JsonSerializer.Serialize(RepositoryUrl);
]]>
</Code>
</Task>
</UsingTask>

<Target
Name="UpdateServerJsonForPackaging"
DependsOnTargets="_InitializeNuspecRepositoryInformationProperties"
BeforeTargets="GenerateNuspec;_GetPackageFiles"
Outputs="@(_UpdatedServerJsonPath)"
Condition="'$(McpServerJsonTemplateFile)' != ''">

<PropertyGroup>
<_UpdatedServerJsonPath>$(IntermediateOutputPath).mcp\server.json</_UpdatedServerJsonPath>
<_McpServerJsonFileContent>$([System.IO.File]::ReadAllText($(McpServerJsonTemplateFile)))</_McpServerJsonFileContent>
</PropertyGroup>

<SerializePropertiesToJson
PackageId="$(PackageId)"
PackageVersion="$(PackageVersion)"
PackageDescription="$(PackageDescription)"
RepositoryUrl="$(RepositoryUrl)">
<Output TaskParameter="JsonPackageId" PropertyName="JsonPackageId" />
<Output TaskParameter="JsonPackageVersion" PropertyName="JsonPackageVersion" />
<Output TaskParameter="JsonPackageDescription" PropertyName="JsonPackageDescription" />
<Output TaskParameter="JsonRepositoryUrl" PropertyName="JsonRepositoryUrl" />
</SerializePropertiesToJson>

<PropertyGroup>
<_McpServerJsonFileContent>$(_McpServerJsonFileContent
.Replace('"%24(PackageId)"', '$(JsonPackageId)')
.Replace('"%24(PackageVersion)"', '$(JsonPackageVersion)')
.Replace('"%24(PackageDescription)"', '$(JsonPackageDescription)')
.Replace('"%24(RepositoryUrl)"', '$(JsonRepositoryUrl)'))</_McpServerJsonFileContent>
</PropertyGroup>

<ItemGroup>
<_McpServerJsonFileContentLine Include="$(_McpServerJsonFileContent)" />
</ItemGroup>

<WriteLinesToFile
File="$(_UpdatedServerJsonPath)"
Lines="@(_McpServerJsonFileContentLine)"
Overwrite="true"
WriteOnlyWhenDifferent="true" />

<ItemGroup>
<ItemWrites Include="$(_UpdatedServerJsonPath)" />
</ItemGroup>

<ItemGroup>
<None Include="$(_UpdatedServerJsonPath)" Pack="true" PackagePath="/.mcp/server.json" />
</ItemGroup>
</Target>
</Project>
37 changes: 37 additions & 0 deletions eng/dnx/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# How the .NET Tool packaging process works

Much like the [npm packages](https://github.com/azure/azure-mcp/blob/main/eng/npm/README.md), the Azure MCP server is published as a .NET Tool that supports specific platforms. This feature is new as of [.NET 10 preview 6](https://github.com/dotnet/core/blob/main/release-notes/10.0/preview/preview6/sdk.md#platform-specific-net-tools).

To make platform-specific .NET Tools work, it is necessary to publish

* a platform-agnostic tool that contains a manifest with all supported platform-specific tool packages
* N different platform-specific tool packages

In .NET 10, all of the orchestration required to generate these is contained in three gestures
* Setting relevant `<RuntimeIdentifiers>` values in the project file
* Setting the `<PackAsTool>` property to `true` in the project file
* building the packages with `dotnet pack`

As long as the application is not using AOT, this single gesture will create all of the required NuGet packages, which can then be published to feeds as necessary.

## Supporting AOT packages

The .NET Tools feature does support AOT platform-specific packages (aka setting `<PublishAot>` to true in the project file), but because the .NET Toolchain does not support cross-platform AOT compilation, the individual platform-specific packages must be built on each platform, often through a CI/CD system's ability to matrix across platforms. In this case, the command to build the platform-specific packages would be

```
dotnet pack -r <runtime identifier>
```

In most cases, you can rely on the .NET SDK to fill in the appropriate RID for the current host by using

```
dotnet pack --use-current-runtime
```

In addition, you will need to create the 'wrapper' package separately via the following command:

```
dotnet pack
```

Once you have all N packages you can publish them to feeds as you would any package.