Skip to content

Commit add8f86

Browse files
committed
Add ModelContextProtocol.Hosting package
1 parent 317f468 commit add8f86

33 files changed

+164
-80
lines changed

Directory.Packages.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<PackageVersion Include="Microsoft.Bcl.Memory" Version="9.0.4" />
1111
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
1212
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.3" />
13+
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="8.0.1" />
1314
<PackageVersion Include="System.IO.Pipelines" Version="8.0.0" />
1415
<PackageVersion Include="System.Text.Json" Version="8.0.5" />
1516
<PackageVersion Include="System.Threading.Channels" Version="8.0.0" />

ModelContextProtocol.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EverythingServer", "samples
5454
EndProject
5555
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModelContextProtocol.AspNetCore", "src\ModelContextProtocol.AspNetCore\ModelContextProtocol.AspNetCore.csproj", "{37B6A5E0-9995-497D-8B43-3BC6870CC716}"
5656
EndProject
57+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModelContextProtocol.Hosting", "src\ModelContextProtocol.Hosting\ModelContextProtocol.Hosting.csproj", "{3F5C7E8A-F123-4D2B-8B9A-1E2F3D4C5B6A}"
58+
EndProject
5759
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModelContextProtocol.AspNetCore.Tests", "tests\ModelContextProtocol.AspNetCore.Tests\ModelContextProtocol.AspNetCore.Tests.csproj", "{85557BA6-3D29-4C95-A646-2A972B1C2F25}"
5860
EndProject
5961
Global
@@ -106,6 +108,10 @@ Global
106108
{37B6A5E0-9995-497D-8B43-3BC6870CC716}.Debug|Any CPU.Build.0 = Debug|Any CPU
107109
{37B6A5E0-9995-497D-8B43-3BC6870CC716}.Release|Any CPU.ActiveCfg = Release|Any CPU
108110
{37B6A5E0-9995-497D-8B43-3BC6870CC716}.Release|Any CPU.Build.0 = Release|Any CPU
111+
{3F5C7E8A-F123-4D2B-8B9A-1E2F3D4C5B6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
112+
{3F5C7E8A-F123-4D2B-8B9A-1E2F3D4C5B6A}.Debug|Any CPU.Build.0 = Debug|Any CPU
113+
{3F5C7E8A-F123-4D2B-8B9A-1E2F3D4C5B6A}.Release|Any CPU.ActiveCfg = Release|Any CPU
114+
{3F5C7E8A-F123-4D2B-8B9A-1E2F3D4C5B6A}.Release|Any CPU.Build.0 = Release|Any CPU
109115
{85557BA6-3D29-4C95-A646-2A972B1C2F25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
110116
{85557BA6-3D29-4C95-A646-2A972B1C2F25}.Debug|Any CPU.Build.0 = Debug|Any CPU
111117
{85557BA6-3D29-4C95-A646-2A972B1C2F25}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -127,6 +133,7 @@ Global
127133
{0D1552DC-E6ED-4AAC-5562-12F8352F46AA} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
128134
{17B8453F-AB72-99C5-E5EA-D0B065A6AE65} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
129135
{37B6A5E0-9995-497D-8B43-3BC6870CC716} = {A2F1F52A-9107-4BF8-8C3F-2F6670E7D0AD}
136+
{3F5C7E8A-F123-4D2B-8B9A-1E2F3D4C5B6A} = {A2F1F52A-9107-4BF8-8C3F-2F6670E7D0AD}
130137
{85557BA6-3D29-4C95-A646-2A972B1C2F25} = {2A77AF5C-138A-4EBB-9A13-9205DCD67928}
131138
EndGlobalSection
132139
GlobalSection(ExtensibilityGlobals) = postSolution

samples/AspNetCoreSseServer/AspNetCoreSseServer.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<ProjectReference Include="..\..\src\ModelContextProtocol\ModelContextProtocol.csproj" />
1211
<ProjectReference Include="..\..\src\ModelContextProtocol.AspNetCore\ModelContextProtocol.AspNetCore.csproj" />
1312
</ItemGroup>
1413

samples/EverythingServer/EverythingServer.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</ItemGroup>
1616

1717
<ItemGroup>
18-
<ProjectReference Include="..\..\src\ModelContextProtocol\ModelContextProtocol.csproj" />
18+
<ProjectReference Include="..\..\src\ModelContextProtocol.Hosting\ModelContextProtocol.Hosting.csproj" />
1919
</ItemGroup>
2020

2121
</Project>

samples/QuickstartWeatherServer/QuickstartWeatherServer.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</ItemGroup>
1414

1515
<ItemGroup>
16-
<ProjectReference Include="..\..\src\ModelContextProtocol\ModelContextProtocol.csproj" />
16+
<ProjectReference Include="..\..\src\ModelContextProtocol.Hosting\ModelContextProtocol.Hosting.csproj" />
1717
</ItemGroup>
1818

1919
</Project>

samples/TestServerWithHosting/TestServerWithHosting.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</ItemGroup>
1919

2020
<ItemGroup>
21-
<ProjectReference Include="..\..\src\ModelContextProtocol\ModelContextProtocol.csproj" />
21+
<ProjectReference Include="..\..\src\ModelContextProtocol.Hosting\ModelContextProtocol.Hosting.csproj" />
2222
</ItemGroup>
2323

2424
</Project>

src/ModelContextProtocol.AspNetCore/HttpMcpServerBuilderExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Microsoft.Extensions.DependencyInjection.Extensions;
1+
using Microsoft.Extensions.DependencyInjection.Extensions;
22
using ModelContextProtocol.AspNetCore;
33
using ModelContextProtocol.Server;
44

src/ModelContextProtocol.AspNetCore/ModelContextProtocol.AspNetCore.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@
1919
<ItemGroup>
2020
<None Include="README.md" pack="true" PackagePath="\" />
2121
</ItemGroup>
22+
2223
<ItemGroup>
23-
<ProjectReference Include="..\ModelContextProtocol\ModelContextProtocol.csproj" />
24+
<ProjectReference Include="..\ModelContextProtocol.Hosting\ModelContextProtocol.Hosting.csproj" />
2425
</ItemGroup>
2526

2627
</Project>

src/ModelContextProtocol/Configuration/DefaultMcpServerBuilder.cs renamed to src/ModelContextProtocol.Hosting/DefaultMcpServerBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ namespace Microsoft.Extensions.DependencyInjection;
44

55
/// <summary>
66
/// Default implementation of <see cref="IMcpServerBuilder"/> that enables fluent configuration
7-
/// of the Model Context Protocol (MCP) server. This builder is returned by the
8-
/// <see cref="McpServerServiceCollectionExtensions.AddMcpServer"/> extension method and
7+
/// of the Model Context Protocol (MCP) server. This builder is returned by the
8+
/// <see cref="McpServerServiceCollectionExtensions.AddMcpServer"/> extension method and
99
/// provides access to the service collection for registering additional MCP components.
1010
/// </summary>
1111
internal sealed class DefaultMcpServerBuilder : IMcpServerBuilder

src/ModelContextProtocol/Configuration/IMcpServerBuilder.cs renamed to src/ModelContextProtocol.Hosting/IMcpServerBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Microsoft.Extensions.DependencyInjection;
1212
/// and server transports, allowing for comprehensive server configuration through a chain of method calls.
1313
/// </para>
1414
/// <para>
15-
/// The builder is obtained from the <see cref="McpServerServiceCollectionExtensions.AddMcpServer"/> extension
15+
/// The builder is obtained from the <see cref="McpServerServiceCollectionExtensions.AddMcpServer"/> extension
1616
/// method and provides access to the underlying service collection via the <see cref="Services"/> property.
1717
/// </para>
1818
/// </remarks>

0 commit comments

Comments
 (0)