Skip to content

Commit 5a080c1

Browse files
FengFafa97claude
andcommitted
Fix build breaks left by the Core/Http/Stdio split
- EverythingServerExtensions.cs: SampleAsync's named parameter was renamed to chatOptions upstream; update the call site. - EverythingServer.Core.csproj: suppress MCP9005 (Sampling deprecated per SEP-2577), matching the sibling EverythingServer.Http.csproj. - EverythingServer.Http/Program.cs: suppress MCPEXP002 around the experimental RunSessionHandler assignment, matching the original Program.cs and docs/experimental.md. - launchSettings.json: remove trailing commas that broke JSON parsing and silently disabled both launch profiles. Verified: dotnet build succeeds with 0 warnings/errors, and both transports complete a live MCP initialize handshake (stdio and Streamable HTTP). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 738bf9c commit 5a080c1

4 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎samples/EverythingServer.Core/EverythingServer.Core.csproj‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
<TargetFramework>net9.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
7+
<!-- This sample demonstrates the Sampling feature, which SEP-2577 deprecates (MCP9005) but
8+
which continues to work. Suppress the deprecation warning for this project only. -->
9+
<NoWarn>$(NoWarn);MCP9005</NoWarn>
710
</PropertyGroup>
811

912
<ItemGroup>

‎samples/EverythingServer.Core/EverythingServerExtensions.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ await ctx.Server.SampleAsync([
5454
new ChatMessage(ChatRole.System, "You are a helpful test server"),
5555
new ChatMessage(ChatRole.User, $"Resource {uri}, context: A new subscription was started"),
5656
],
57-
options: new ChatOptions
57+
chatOptions: new ChatOptions
5858
{
5959
MaxOutputTokens = 100,
6060
Temperature = 0.7f,

‎samples/EverythingServer.Http/Program.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
.WithHttpTransport(options =>
2020
{
2121
// Add a RunSessionHandler to remove all subscriptions for the session when it ends
22+
#pragma warning disable MCPEXP002 // RunSessionHandler is experimental
2223
options.RunSessionHandler = async (httpContext, mcpServer, token) =>
2324
{
2425
if (mcpServer.SessionId == null)
@@ -44,6 +45,7 @@
4445
subscriptions.TryRemove(mcpServer.SessionId, out _);
4546
}
4647
};
48+
#pragma warning restore MCPEXP002
4749
})
4850
.AddEverythingMcpHandlers(subscriptions);
4951

‎samples/EverythingServer.Http/Properties/launchSettings.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
"dotnetRunMessages": true,
77
"applicationUrl": "http://localhost:3001",
88
"environmentVariables": {
9-
"ASPNETCORE_ENVIRONMENT": "Development",
9+
"ASPNETCORE_ENVIRONMENT": "Development"
1010
}
1111
},
1212
"https": {
1313
"commandName": "Project",
1414
"dotnetRunMessages": true,
1515
"applicationUrl": "https://localhost:7133;http://localhost:3001",
1616
"environmentVariables": {
17-
"ASPNETCORE_ENVIRONMENT": "Development",
17+
"ASPNETCORE_ENVIRONMENT": "Development"
1818
}
1919
}
2020
}

0 commit comments

Comments
 (0)