Skip to content

Commit a502efb

Browse files
Copilotstephentoub
andauthored
Update tests for @modelcontextprotocol/server-everything 2026.1.26 (#1273)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
1 parent ec4c732 commit a502efb

File tree

6 files changed

+107
-78
lines changed

6 files changed

+107
-78
lines changed

package-lock.json

Lines changed: 9 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Pinned npm dependencies for MCP C# SDK integration and conformance tests",
44
"dependencies": {
55
"@modelcontextprotocol/conformance": "0.1.13",
6-
"@modelcontextprotocol/server-everything": "2025.12.18",
6+
"@modelcontextprotocol/server-everything": "2026.1.26",
77
"@modelcontextprotocol/server-memory": "2026.1.26"
88
}
99
}

tests/ModelContextProtocol.TestServer/Program.cs

Lines changed: 44 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ private static void ConfigureTools(McpServerOptions options, string? cliArg)
142142
},
143143
new Tool
144144
{
145-
Name = "sampleLLM",
146-
Description = "Samples from an LLM using MCP's sampling feature.",
145+
Name = "trigger-sampling-request",
146+
Description = "Trigger a Request from the Server for LLM Sampling",
147147
InputSchema = JsonElement.Parse("""
148148
{
149149
"type": "object",
@@ -205,15 +205,15 @@ private static void ConfigureTools(McpServerOptions options, string? cliArg)
205205
Content = [new TextContentBlock { Text = request.Server.SessionId ?? string.Empty }]
206206
};
207207
}
208-
else if (request.Params?.Name == "sampleLLM")
208+
else if (request.Params?.Name == "trigger-sampling-request")
209209
{
210210
if (request.Params?.Arguments is null ||
211211
!request.Params.Arguments.TryGetValue("prompt", out var prompt) ||
212212
!request.Params.Arguments.TryGetValue("maxTokens", out var maxTokens))
213213
{
214214
throw new McpProtocolException("Missing required arguments 'prompt' and 'maxTokens'", McpErrorCode.InvalidParams);
215215
}
216-
var sampleResult = await request.Server.SampleAsync(CreateRequestSamplingParams(prompt.ToString(), "sampleLLM", Convert.ToInt32(maxTokens.GetRawText())),
216+
var sampleResult = await request.Server.SampleAsync(CreateRequestSamplingParams(prompt.ToString(), "trigger-sampling-request", Convert.ToInt32(maxTokens.GetRawText())),
217217
cancellationToken: cancellationToken);
218218

219219
return new CallToolResult
@@ -257,28 +257,48 @@ private static void ConfigurePrompts(McpServerOptions options)
257257
Prompts = [
258258
new Prompt
259259
{
260-
Name = "simple_prompt",
260+
Name = "simple-prompt",
261261
Description = "A prompt without arguments"
262262
},
263263
new Prompt
264264
{
265-
Name = "complex_prompt",
265+
Name = "args-prompt",
266266
Description = "A prompt with arguments",
267267
Arguments =
268268
[
269269
new PromptArgument
270270
{
271-
Name = "temperature",
272-
Description = "Temperature setting",
271+
Name = "city",
272+
Description = "Name of the city",
273273
Required = true
274274
},
275275
new PromptArgument
276276
{
277-
Name = "style",
278-
Description = "Output style",
277+
Name = "state",
278+
Description = "Name of the state",
279279
Required = false
280280
}
281281
]
282+
},
283+
new Prompt
284+
{
285+
Name = "completable-prompt",
286+
Description = "A prompt with completable arguments",
287+
Arguments =
288+
[
289+
new PromptArgument
290+
{
291+
Name = "department",
292+
Description = "Choose the department",
293+
Required = true
294+
},
295+
new PromptArgument
296+
{
297+
Name = "name",
298+
Description = "Choose a team member",
299+
Required = true
300+
}
301+
]
282302
}
283303
]
284304
};
@@ -287,36 +307,33 @@ private static void ConfigurePrompts(McpServerOptions options)
287307
options.Handlers.GetPromptHandler = async (request, cancellationToken) =>
288308
{
289309
List<PromptMessage> messages = [];
290-
if (request.Params?.Name == "simple_prompt")
310+
if (request.Params?.Name == "simple-prompt")
291311
{
292312
messages.Add(new PromptMessage
293313
{
294314
Role = Role.User,
295315
Content = new TextContentBlock { Text = "This is a simple prompt without arguments." },
296316
});
297317
}
298-
else if (request.Params?.Name == "complex_prompt")
318+
else if (request.Params?.Name == "args-prompt")
299319
{
300-
string temperature = request.Params.Arguments?["temperature"].ToString() ?? "unknown";
301-
string style = request.Params.Arguments?["style"].ToString() ?? "unknown";
320+
string city = request.Params.Arguments?["city"].ToString() ?? "unknown";
321+
string state = request.Params.Arguments?["state"].ToString() ?? "";
322+
string location = !string.IsNullOrEmpty(state) ? $"{city}, {state}" : city;
302323
messages.Add(new PromptMessage
303324
{
304325
Role = Role.User,
305-
Content = new TextContentBlock { Text = $"This is a complex prompt with arguments: temperature={temperature}, style={style}" },
306-
});
307-
messages.Add(new PromptMessage
308-
{
309-
Role = Role.Assistant,
310-
Content = new TextContentBlock { Text = "I understand. You've provided a complex prompt with temperature and style arguments. How would you like me to proceed?" },
326+
Content = new TextContentBlock { Text = $"What's weather in {location}?" },
311327
});
328+
}
329+
else if (request.Params?.Name == "completable-prompt")
330+
{
331+
string department = request.Params.Arguments?["department"].ToString() ?? "unknown";
332+
string name = request.Params.Arguments?["name"].ToString() ?? "unknown";
312333
messages.Add(new PromptMessage
313334
{
314335
Role = Role.User,
315-
Content = new ImageContentBlock
316-
{
317-
Data = MCP_TINY_IMAGE,
318-
MimeType = "image/png"
319-
}
336+
Content = new TextContentBlock { Text = $"Please promote {name} to the head of the {department} team." },
320337
});
321338
}
322339
else
@@ -516,8 +533,8 @@ private static void ConfigureCompletions(McpServerOptions options)
516533
List<string> sampleResourceIds = ["1", "2", "3", "4", "5"];
517534
Dictionary<string, List<string>> exampleCompletions = new()
518535
{
519-
{"style", ["casual", "formal", "technical", "friendly"]},
520-
{"temperature", ["0", "0.5", "0.7", "1.0"]},
536+
{"department", ["Engineering", "Sales", "Marketing", "Support"]},
537+
{"name", ["Alice", "Bob", "Charlie"]},
521538
};
522539

523540
options.Handlers.CompleteHandler = async (request, cancellationToken) =>

tests/ModelContextProtocol.Tests/ClientIntegrationTestFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class ClientIntegrationTestFixture
1515

1616
public ClientIntegrationTestFixture()
1717
{
18-
const string ServerEverythingVersion = "2025.12.18";
18+
const string ServerEverythingVersion = "2026.1.26";
1919

2020
EverythingServerTransportOptions = new()
2121
{

0 commit comments

Comments
 (0)