Skip to content

Conversation

jeffkl
Copy link
Contributor

@jeffkl jeffkl commented Sep 4, 2025

Fixes #6560

This updates the MCP server template to have some new guidance particularly to use a self-contained, single file executable. It also allows for users to specify that they want to use AOT via a command-line argument.

Option Default Value
--framework net9.0
--self-contained true
--aot false

The matrix of possible values for some MSBuild properties is a little complicated, this table explains how certain arguments affect them:

Option RuntimeIdentifiers PublishSelfContained PublishSingleFile PublishAot RollForward
--self-contained:true
--self-contained:false
--aot:true

And the default values for RuntimeIdentifers is:

  • win-x64
  • win-arm64
  • osx-arm64
  • linux-x64
  • linux-arm64
  • linux-musl-x64
Microsoft Reviewers: Open in CodeFlow

@jeffkl jeffkl requested a review from joelverhagen September 4, 2025 21:14
@github-actions github-actions bot added the area-ai-templates Microsoft.Extensions.AI.Templates label Sep 4, 2025
@jeffkl jeffkl force-pushed the update-mcp-server-template branch 2 times, most recently from 318def4 to 81941d1 Compare September 4, 2025 23:01
@joelverhagen
Copy link
Member

@jeffkl jeffkl force-pushed the update-mcp-server-template branch from 9004017 to 62a4e1d Compare September 8, 2025 17:04
@jeffkl jeffkl marked this pull request as ready for review September 8, 2025 17:05
@Copilot Copilot AI review requested due to automatic review settings September 8, 2025 17:05
@jeffkl jeffkl requested a review from a team as a code owner September 8, 2025 17:05
Copy link
Contributor

@Copilot 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

This PR updates the MCP server template to provide better guidance for users, particularly around creating self-contained, single-file executables. The update adds command-line options for users to specify framework targets, self-containment, and AOT compilation settings.

  • Adds support for --framework, --self-contained, and --aot command-line arguments with appropriate defaults
  • Updates project configuration to generate self-contained single-file executables by default
  • Includes conditional MSBuild properties based on template arguments for different deployment scenarios

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Multiple snapshot test files Updated to reflect new template output with self-contained configurations
McpServerSnapshotTests.cs Added test methods for new template argument scenarios
README.md Enhanced documentation explaining self-contained vs framework-dependent deployment
McpServer-CSharp.csproj.in Updated MSBuild properties with conditional logic for different deployment modes
template.json Added new parameter symbols for framework, AOT, and self-contained options
ide.host.json Made new template parameters visible in IDE
dotnetcli.host.json Configured CLI parameter names and visibility

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@jeffkl jeffkl force-pushed the update-mcp-server-template branch from ac15849 to 582b4ce Compare September 8, 2025 17:09
@jeffkl jeffkl force-pushed the update-mcp-server-template branch from 582b4ce to 86fac67 Compare September 8, 2025 17:10
@jeffkl jeffkl merged commit c498de0 into dotnet:main Sep 11, 2025
6 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-ai-templates Microsoft.Extensions.AI.Templates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve the MCP server template to produce self-contained packages

4 participants