-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Transfer the MCP Server project template from extensions to aspnetcore #66260
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
Merged
jeffhandley
merged 9 commits into
dotnet:main
from
jeffhandley:jeffhandley/mcpserver-aspnetcore
Apr 28, 2026
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d73a6b3
Add McpServer project template package
jeffhandley 3d64549
Update MCP Server docs link and preview references
jeffhandley 6f65baa
Align McpServerTemplateTest with aspnetcore test patterns
jeffhandley e7b3b49
Suffix the MCP project template package with the version. Add test/doc.
jeffhandley 0742a4b
Merge branch 'main' into jeffhandley/mcpserver-aspnetcore
jeffhandley 8c897b5
Fix MCP Server template tests for CI by replacing multi-RID with sing…
jeffhandley 63be7ed
Skip self-contained MCP template tests on Helix; revert preRestoreAction
jeffhandley b7475a8
Skip NativeAOT MCP template tests on all Helix queues
jeffhandley 2e35348
Set precedence for mcpserver template
jeffhandley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # This file is generated by the build | ||
| content/*/*.*proj | ||
| content/*/*/*.*proj |
52 changes: 52 additions & 0 deletions
52
src/ProjectTemplates/McpServer.ProjectTemplates/McpServer-Local-CSharp.csproj.in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>${DefaultNetCoreTargetFramework}</TargetFramework> | ||
| <!--#if (SelfContained || NativeAot)--> | ||
| <RuntimeIdentifiers>win-x64;win-arm64;osx-arm64;linux-x64;linux-arm64;linux-musl-x64</RuntimeIdentifiers> | ||
| <!--#else--> | ||
| <RollForward>Major</RollForward> | ||
| <!--#endif --> | ||
| <OutputType>Exe</OutputType> | ||
| <Nullable>enable</Nullable> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
|
|
||
| <!-- Set up the NuGet package to be an MCP server --> | ||
| <PackAsTool>true</PackAsTool> | ||
| <PackageType>McpServer</PackageType> | ||
| <!--#if (SelfContained || NativeAot)--> | ||
|
|
||
| <!-- Set up the MCP server to be a self-contained application that does not rely on a shared framework --> | ||
| <SelfContained>true</SelfContained> | ||
| <PublishSelfContained>true</PublishSelfContained> | ||
|
|
||
| <!-- Set up the MCP server to be a single file executable --> | ||
| <PublishSingleFile>true</PublishSingleFile> | ||
| <!--#endif --> | ||
| <!--#if (NativeAot)--> | ||
|
|
||
| <!-- Configure the MCP server to be a native AOT application with invariant globalization --> | ||
| <PublishAot>true</PublishAot> | ||
| <InvariantGlobalization>true</InvariantGlobalization> | ||
| <!--#endif --> | ||
|
|
||
| <!-- Set recommended package metadata --> | ||
| <PackageReadmeFile>README.md</PackageReadmeFile> | ||
| <PackageId>SampleMcpServer</PackageId> | ||
| <PackageVersion>0.1.0-beta</PackageVersion> | ||
| <PackageTags>AI; MCP; server; stdio</PackageTags> | ||
| <Description>An MCP server using the MCP C# SDK.</Description> | ||
| </PropertyGroup> | ||
|
|
||
| <!-- Include additional files for browsing the MCP server. --> | ||
| <ItemGroup> | ||
| <None Include=".mcp\server.json" Pack="true" PackagePath="/.mcp/" /> | ||
| <None Include="README.md" Pack="true" PackagePath="/" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Microsoft.Extensions.Hosting" Version="${MicrosoftExtensionsHostingVersion}" /> | ||
| <PackageReference Include="ModelContextProtocol" Version="${ModelContextProtocolVersion}" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
35 changes: 35 additions & 0 deletions
35
src/ProjectTemplates/McpServer.ProjectTemplates/McpServer-Remote-CSharp.csproj.in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>${DefaultNetCoreTargetFramework}</TargetFramework> | ||
| <!--#if (SelfContained || NativeAot)--> | ||
| <RuntimeIdentifiers>win-x64;win-arm64;osx-arm64;linux-x64;linux-arm64;linux-musl-x64</RuntimeIdentifiers> | ||
| <!--#else--> | ||
| <RollForward>Major</RollForward> | ||
| <!--#endif --> | ||
| <Nullable>enable</Nullable> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <UserSecretsId>aaaaaaaa-bbbb-cccc-dddd-eeeeeeffffff</UserSecretsId> | ||
|
|
||
| <!--#if (SelfContained || NativeAot)--> | ||
|
|
||
| <!-- Set up the MCP server to be a self-contained application that does not rely on a shared framework --> | ||
| <SelfContained>true</SelfContained> | ||
| <PublishSelfContained>true</PublishSelfContained> | ||
|
|
||
| <!-- Set up the MCP server to be a single file executable --> | ||
| <PublishSingleFile>true</PublishSingleFile> | ||
| <!--#endif --> | ||
| <!--#if (NativeAot)--> | ||
|
|
||
| <!-- Configure the MCP server to be a native AOT application with invariant globalization --> | ||
| <PublishAot>true</PublishAot> | ||
| <InvariantGlobalization>true</InvariantGlobalization> | ||
| <!--#endif --> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="ModelContextProtocol.AspNetCore" Version="${ModelContextProtocolAspNetCoreVersion}" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
24 changes: 24 additions & 0 deletions
24
src/ProjectTemplates/McpServer.ProjectTemplates/Microsoft.McpServer.ProjectTemplates.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework> | ||
| <PackageId>Microsoft.McpServer.ProjectTemplates.$(AspNetCoreMajorMinorVersion)</PackageId> | ||
| <Description>MCP Server Template Pack for Microsoft Template Engine</Description> | ||
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <!-- Lists the versions of dependencies not built in this repo. --> | ||
| <GeneratedContentProperties> | ||
| DefaultNetCoreTargetFramework=$(DefaultNetCoreTargetFramework); | ||
| MicrosoftExtensionsHostingVersion=$(MicrosoftExtensionsHostingVersion); | ||
| ModelContextProtocolVersion=$(ModelContextProtocolVersion); | ||
| ModelContextProtocolAspNetCoreVersion=$(ModelContextProtocolAspNetCoreVersion); | ||
| </GeneratedContentProperties> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <GeneratedContent Include="McpServer-Local-CSharp.csproj.in" OutputPath="content/McpServer-CSharp/local/McpServer-CSharp.csproj" /> | ||
| <GeneratedContent Include="McpServer-Remote-CSharp.csproj.in" OutputPath="content/McpServer-CSharp/remote/McpServer-CSharp.csproj" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
8 changes: 8 additions & 0 deletions
8
src/ProjectTemplates/McpServer.ProjectTemplates/content/Directory.Build.props
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <Project> | ||
| <Import Project="..\..\..\..\build\sources.props" /> | ||
|
jeffhandley marked this conversation as resolved.
|
||
| <!-- | ||
| This file intentionally left mostly blank to ensure the template projects | ||
| are independent from the template package build config (other than to share | ||
| the same NuGet restore sources). | ||
| --> | ||
| </Project> | ||
7 changes: 7 additions & 0 deletions
7
src/ProjectTemplates/McpServer.ProjectTemplates/content/Directory.Build.targets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <Project> | ||
| <Import Project="..\..\..\Directory.Build.targets" /> | ||
|
jeffhandley marked this conversation as resolved.
|
||
| <!-- | ||
| This file intentionally left mostly blank to ensure the template projects | ||
| are independent from the template package build config. | ||
| --> | ||
| </Project> | ||
33 changes: 33 additions & 0 deletions
33
.../McpServer.ProjectTemplates/content/McpServer-CSharp/.template.config/dotnetcli.host.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| { | ||
| "$schema": "https://json.schemastore.org/dotnetcli.host", | ||
| "symbolInfo": { | ||
| "Transport": { | ||
| "longName": "transport", | ||
| "shortName": "t" | ||
| }, | ||
| "NativeAot": { | ||
| "longName": "aot", | ||
| "shortName": "" | ||
| }, | ||
| "SelfContained": { | ||
| "longName": "self-contained", | ||
| "shortName": "" | ||
| }, | ||
| "Framework": { | ||
| "longName": "framework" | ||
| }, | ||
| "skipRestore": { | ||
| "longName": "no-restore", | ||
| "shortName": "" | ||
| }, | ||
| "httpPort": { | ||
| "isHidden": true | ||
| }, | ||
| "httpsPort": { | ||
| "isHidden": true | ||
| } | ||
| }, | ||
| "usageExamples": [ | ||
| "" | ||
| ] | ||
| } |
19 changes: 19 additions & 0 deletions
19
...plates/McpServer.ProjectTemplates/content/McpServer-CSharp/.template.config/ide.host.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "$schema": "https://json.schemastore.org/ide.host", | ||
| "order": 0, | ||
| "icon": "ide/icon.ico", | ||
| "symbolInfo": [ | ||
| { | ||
| "id": "Transport", | ||
| "isVisible": true | ||
| }, | ||
| { | ||
| "id": "NativeAot", | ||
| "isVisible": true | ||
| }, | ||
| { | ||
| "id": "SelfContained", | ||
| "isVisible": true | ||
| } | ||
| ] | ||
| } |
Binary file added
BIN
+37.2 KB
...mplates/McpServer.ProjectTemplates/content/McpServer-CSharp/.template.config/ide/icon.ico
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.