Skip to content

Commit 7a9d587

Browse files
committed
Update MCP server to 2026-07-28 specification
1 parent 3df4277 commit 7a9d587

2 files changed

Lines changed: 20 additions & 5 deletions

File tree

OpenBullet2.Web.Tests/Integration/McpIntegrationTests.cs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class McpIntegrationTests(ITestOutputHelper testOutputHelper)
2323
: IntegrationTests(testOutputHelper)
2424
{
2525
[Fact]
26-
public async Task McpEndpoint_ExposesSampleTool()
26+
public async Task McpEndpoint_Supports20260728ProtocolAndExposesTools()
2727
{
2828
using var httpClient = Factory.CreateClient();
2929
var transport = new HttpClientTransport(
@@ -34,10 +34,18 @@ public async Task McpEndpoint_ExposesSampleTool()
3434
},
3535
httpClient);
3636

37-
await using var client = await McpClient.CreateAsync(transport, cancellationToken: TestCancellationToken);
37+
await using var client = await McpClient.CreateAsync(
38+
transport,
39+
new McpClientOptions
40+
{
41+
ProtocolVersion = "2026-07-28"
42+
},
43+
cancellationToken: TestCancellationToken);
3844

3945
var tools = await client.ListToolsAsync(cancellationToken: TestCancellationToken);
4046

47+
Assert.Equal("2026-07-28", client.NegotiatedProtocolVersion);
48+
Assert.Null(client.SessionId);
4149
Assert.Contains(tools, tool => tool.Name == "get_server_info");
4250
Assert.Contains(tools, tool => tool.Name == "get_environment");
4351
Assert.Contains(tools, tool => tool.Name == "create_config");
@@ -61,7 +69,7 @@ public async Task McpEndpoint_ExposesSampleTool()
6169
}
6270

6371
[Fact]
64-
public async Task McpEndpoint_CallsSampleTool()
72+
public async Task McpEndpoint_RemainsCompatibleWith20251125ProtocolAndCallsTool()
6573
{
6674
using var httpClient = Factory.CreateClient();
6775
var transport = new HttpClientTransport(
@@ -72,7 +80,13 @@ public async Task McpEndpoint_CallsSampleTool()
7280
},
7381
httpClient);
7482

75-
await using var client = await McpClient.CreateAsync(transport, cancellationToken: TestCancellationToken);
83+
await using var client = await McpClient.CreateAsync(
84+
transport,
85+
new McpClientOptions
86+
{
87+
ProtocolVersion = "2025-11-25"
88+
},
89+
cancellationToken: TestCancellationToken);
7690

7791
var result = await client.CallToolAsync(
7892
"get_server_info",
@@ -81,6 +95,7 @@ public async Task McpEndpoint_CallsSampleTool()
8195
var version = GetRequiredService<IUpdateService>().CurrentVersion;
8296
var text = Assert.IsType<TextContentBlock>(Assert.Single(result.Content)).Text;
8397

98+
Assert.Equal("2025-11-25", client.NegotiatedProtocolVersion);
8499
Assert.False(result.IsError ?? false);
85100
Assert.Contains("OpenBullet 2 server info", text);
86101
Assert.Contains(version.ToString(), text);

OpenBullet2.Web/OpenBullet2.Web.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="5.1.0" />
5656
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.7"/>
5757
<PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="3.2.2" />
58-
<PackageReference Include="ModelContextProtocol.AspNetCore" Version="1.3.0" />
58+
<PackageReference Include="ModelContextProtocol.AspNetCore" Version="2.1.0" />
5959
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.5"/>
6060
<PackageReference Include="Serilog.AspNetCore" Version="10.0.0" />
6161
<PackageReference Include="Serilog.Exceptions" Version="8.4.0" />

0 commit comments

Comments
 (0)