Skip to content

Commit 8dad361

Browse files
author
Tarek Mahmoud Sayed
committed
Make McpHttpHeaders internal via shared source
Move McpHttpHeaders.cs from src/ModelContextProtocol.Core/Protocol/ to src/Common/ and change from public to internal. Add Compile Include links in ModelContextProtocol.Core, ModelContextProtocol.AspNetCore, and both test projects so each assembly gets its own internal copy. This follows the existing shared source pattern used by Experimentals.cs, Throw.cs, etc.
1 parent f883121 commit 8dad361

5 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/ModelContextProtocol.Core/Protocol/McpHttpHeaders.cs renamed to src/Common/McpHttpHeaders.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace ModelContextProtocol.Protocol;
77
/// Per RFC 9110, HTTP header names are case-insensitive. Clients and servers must
88
/// use case-insensitive comparisons when processing these headers.
99
/// </remarks>
10-
public static class McpHttpHeaders
10+
internal static class McpHttpHeaders
1111
{
1212
/// <summary>
1313
/// The minimum protocol version that requires standard MCP request headers.
@@ -57,7 +57,7 @@ public static class McpHttpHeaders
5757
public const string ParamPrefix = "Mcp-Param-";
5858

5959
/// <summary>
60-
/// Key used in <see cref="JsonRpcMessageContext.Items"/> to store the <see cref="Tool"/>
60+
/// Key used in <see cref="JsonRpcMessageContext.Items"/> to store the tool
6161
/// definition for the current request, enabling the transport to add custom parameter headers.
6262
/// </summary>
6363
internal const string ToolContextKey = "Mcp.Tool";

src/ModelContextProtocol.AspNetCore/ModelContextProtocol.AspNetCore.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<ItemGroup>
2424
<Compile Include="..\Common\Experimentals.cs" Link="Experimentals.cs" />
2525
<Compile Include="..\Common\Obsoletions.cs" Link="Obsoletions.cs" />
26+
<Compile Include="..\Common\McpHttpHeaders.cs" Link="McpHttpHeaders.cs" />
2627
</ItemGroup>
2728

2829
<ItemGroup>

src/ModelContextProtocol.Core/ModelContextProtocol.Core.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<Compile Include="..\Common\Obsoletions.cs" Link="Obsoletions.cs" />
2727
<Compile Include="..\Common\Experimentals.cs" Link="Experimentals.cs" />
2828
<Compile Include="..\Common\EncodingUtilities.cs" Link="EncodingUtilities.cs" />
29+
<Compile Include="..\Common\McpHttpHeaders.cs" Link="McpHttpHeaders.cs" />
2930
<Compile Include="..\Common\HttpResponseMessageExtensions.cs" Link="HttpResponseMessageExtensions.cs" />
3031
<Compile Include="..\Common\ServerSentEvents\**\*.cs" Link="ServerSentEvents\%(RecursiveDir)%(FileName)%(Extension)" />
3132
</ItemGroup>

tests/ModelContextProtocol.AspNetCore.Tests/ModelContextProtocol.AspNetCore.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
<ItemGroup>
2525
<Compile Include="..\Common\**\*.cs" />
26+
<Compile Include="..\..\src\Common\McpHttpHeaders.cs" Link="McpHttpHeaders.cs" />
2627
</ItemGroup>
2728

2829
<ItemGroup>

tests/ModelContextProtocol.Tests/ModelContextProtocol.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
<Compile Include="..\..\src\ModelContextProtocol.Core\Server\InMemoryMcpTaskStore.cs" Link="Server\InMemoryMcpTaskStore.cs" />
4040
<!-- Include dependencies for the linked InMemoryMcpTaskStore.cs -->
4141
<Compile Include="..\..\src\Common\Experimentals.cs" Link="Experimentals.cs" />
42+
<Compile Include="..\..\src\Common\McpHttpHeaders.cs" Link="McpHttpHeaders.cs" />
4243
</ItemGroup>
4344

4445
<ItemGroup>

0 commit comments

Comments
 (0)