Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions AspNetCore.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,7 @@
<Project Path="src/ProjectTemplates/Web.Client.ItemTemplates/Microsoft.DotNet.Web.Client.ItemTemplates.csproj" />
<Project Path="src/ProjectTemplates/Web.ItemTemplates/Microsoft.DotNet.Web.ItemTemplates.csproj" />
<Project Path="src/ProjectTemplates/Web.ProjectTemplates/Microsoft.DotNet.Web.ProjectTemplates.csproj" />
<Project Path="src/ProjectTemplates/McpServer.ProjectTemplates/Microsoft.McpServer.ProjectTemplates.csproj" />
</Folder>
<Folder Name="/src/Razor/" />
<Folder Name="/src/Razor/Razor.Runtime/">
Expand Down
1 change: 1 addition & 0 deletions eng/Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
$(RepoRoot)src\Components\Web.JS\node_modules\**\*.*proj;
$(RepoRoot)src\Installers\**\*.*proj;
$(RepoRoot)src\ProjectTemplates\Web.ProjectTemplates\content\**\*.*proj;
$(RepoRoot)src\ProjectTemplates\McpServer.ProjectTemplates\content\**\*.*proj;
$(RepoRoot)src\SignalR\clients\ts\**\node_modules\**\*.*proj;
" />

Expand Down
2 changes: 2 additions & 0 deletions eng/Dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ may be turned into `<PackageReference>` items in projects.
<LatestPackageReference Include="MessagePackAnalyzer" />
<LatestPackageReference Include="Microsoft.Data.SqlClient" />
<LatestPackageReference Include="Microsoft.Windows.CsWin32" />
<LatestPackageReference Include="ModelContextProtocol" />
<LatestPackageReference Include="ModelContextProtocol.AspNetCore" />
<LatestPackageReference Include="Mono.Cecil" />
<LatestPackageReference Include="Mono.TextTemplating" />
<LatestPackageReference Include="Moq" />
Expand Down
2 changes: 2 additions & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@
<MicrosoftIdentityWebDownstreamApiVersion>3.14.1</MicrosoftIdentityWebDownstreamApiVersion>
<MicrosoftWindowsCsWin32Version>0.3.269</MicrosoftWindowsCsWin32Version>
<MessagePackAnalyzerVersion>$(MessagePackVersion)</MessagePackAnalyzerVersion>
<ModelContextProtocolVersion>1.2.0</ModelContextProtocolVersion>
<ModelContextProtocolAspNetCoreVersion>$(ModelContextProtocolVersion)</ModelContextProtocolAspNetCoreVersion>
<MoqVersion>4.10.0</MoqVersion>
<MonoCecilVersion>0.11.2</MonoCecilVersion>
<MonoTextTemplatingVersion>2.2.1</MonoTextTemplatingVersion>
Expand Down
3 changes: 3 additions & 0 deletions src/ProjectTemplates/McpServer.ProjectTemplates/.gitignore
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
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>
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>
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</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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<Import Project="..\..\..\..\build\sources.props" />
<!--
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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<Import Project="..\..\..\Directory.Build.targets" />
<!--
This file intentionally left mostly blank to ensure the template projects
are independent from the template package build config.
-->
</Project>
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": [
""
]
}
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 not shown.
Loading
Loading