-
Notifications
You must be signed in to change notification settings - Fork 839
Update MCP server template #6772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
318def4
to
81941d1
Compare
.../Microsoft.Extensions.AI.Templates/src/McpServer/McpServer-CSharp/McpServer-CSharp.csproj.in
Show resolved
Hide resolved
.../Microsoft.Extensions.AI.Templates/src/McpServer/McpServer-CSharp/McpServer-CSharp.csproj.in
Outdated
Show resolved
Hide resolved
.../Microsoft.Extensions.AI.Templates/src/McpServer/McpServer-CSharp/McpServer-CSharp.csproj.in
Outdated
Show resolved
Hide resolved
...sions.AI.Templates.IntegrationTests/Snapshots/mcpserver.AotTrue.verified/mcpserver/README.md
Outdated
Show resolved
Hide resolved
...rosoft.Extensions.AI.Templates/src/McpServer/McpServer-CSharp/.template.config/ide.host.json
Show resolved
Hide resolved
...rosoft.Extensions.AI.Templates/src/McpServer/McpServer-CSharp/.template.config/template.json
Outdated
Show resolved
Hide resolved
src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/McpServer/McpServer-CSharp/README.md
Show resolved
Hide resolved
9004017
to
62a4e1d
Compare
There was a problem hiding this 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.
src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/McpServer/McpServer-CSharp/README.md
Outdated
Show resolved
Hide resolved
src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/McpServer/McpServer-CSharp/README.md
Outdated
Show resolved
Hide resolved
.../Microsoft.Extensions.AI.Templates/src/McpServer/McpServer-CSharp/McpServer-CSharp.csproj.in
Show resolved
Hide resolved
ac15849
to
582b4ce
Compare
582b4ce
to
86fac67
Compare
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.
--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:
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