Skip to content

Commit 00587e7

Browse files
AClerboisCopilot
andauthored
Update server.json versioning and packaging logic (#4432)
* Update server.json versioning and packaging logic Refactored packaging to copy server.json to the intermediate output directory and update its "version" field to match the build version before packing. Changed hardcoded version from 5.0.0-preview.1 to 0.0.1 in server.json and project metadata. Added MSBuild target to automate version update for consistent packaging. * Update src/Tools/McpServer/Microsoft.FluentUI.AspNetCore.McpServer.csproj Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 302f503 commit 00587e7

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

src/Tools/McpServer/.mcp/server.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"registryType": "nuget",
1515
"registryBaseUrl": "https://api.nuget.org",
1616
"identifier": "Microsoft.FluentUI.AspNetCore.McpServer",
17-
"version": "5.0.0-preview.1",
17+
"version": "0.0.1",
1818
"runtimeHint": "dnx",
1919
"transport": {
2020
"type": "stdio"
@@ -26,5 +26,5 @@
2626
"source": "github"
2727
},
2828
"title": "Fluent UI Blazor MCP Server",
29-
"version": "5.0.0-preview.1"
29+
"version": "0.0.1"
3030
}

src/Tools/McpServer/Microsoft.FluentUI.AspNetCore.McpServer.csproj

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@
7272
<!-- Include README and MCP server manifest in package -->
7373
<ItemGroup>
7474
<None Include="README.md" Pack="true" PackagePath="\" />
75-
<None Include=".mcp\server.json" Pack="true" PackagePath=".mcp\" />
75+
<None Include=".mcp\server.json" />
76+
<None Include="$(IntermediateOutputPath).mcp\server.json" Pack="true" PackagePath=".mcp\" />
7677
<None Include="..\..\..\icon.png" Pack="true" PackagePath="\" />
7778
</ItemGroup>
7879

@@ -149,4 +150,33 @@
149150
<Message Text="MCP documentation JSON cleaned." Importance="high" Condition="Exists('$(McpDocumentationJsonPath)')" />
150151
</Target>
151152

153+
<!--
154+
Target to update version in server.json before packing.
155+
This copies server.json to intermediate directory and replaces version placeholders.
156+
-->
157+
<Target Name="UpdateMcpServerJsonVersion" BeforeTargets="BeforeBuild">
158+
<PropertyGroup>
159+
<McpServerJsonSource>$(MSBuildThisFileDirectory).mcp\server.json</McpServerJsonSource>
160+
<McpServerJsonTarget>$(IntermediateOutputPath).mcp\server.json</McpServerJsonTarget>
161+
</PropertyGroup>
162+
163+
<MakeDir Directories="$(IntermediateOutputPath).mcp" />
164+
165+
<!-- Read the source file -->
166+
<ReadLinesFromFile File="$(McpServerJsonSource)">
167+
<Output TaskParameter="Lines" ItemName="McpServerJsonLines" />
168+
</ReadLinesFromFile>
169+
170+
<!-- Replace version in each line and write to target -->
171+
<ItemGroup>
172+
<McpServerJsonLinesUpdated Include="@(McpServerJsonLines)">
173+
<Text>$([System.Text.RegularExpressions.Regex]::Replace('%(Identity)', '"version":\s*"[^"]*"', '"version": "$(Version)"'))</Text>
174+
</McpServerJsonLinesUpdated>
175+
</ItemGroup>
176+
177+
<WriteLinesToFile File="$(McpServerJsonTarget)" Lines="@(McpServerJsonLinesUpdated->'%(Text)')" Overwrite="true" />
178+
179+
<Message Text="Updated server.json version to $(Version)" Importance="high" />
180+
</Target>
181+
152182
</Project>

0 commit comments

Comments
 (0)