Skip to content

Strengthen mcp-csharp-test with prescriptive MCP-specific steps#936

Closed
leslierichardson95 wants to merge 1 commit into
dotnet:mainfrom
leslierichardson95:leslierichardson95/strengthen-mcp-csharp-test
Closed

Strengthen mcp-csharp-test with prescriptive MCP-specific steps#936
leslierichardson95 wants to merge 1 commit into
dotnet:mainfrom
leslierichardson95:leslierichardson95/strengthen-mcp-csharp-test

Conversation

@leslierichardson95

Copy link
Copy Markdown
Contributor

What

Strengthens mcp-csharp-test with prescriptive, MCP-specific guidance so it helps strong models, not just weak ones.

Why

The cross-family skills-eval (#889) rated this skill high-impact (0.65) but STRENGTHEN 0/5 — it misses both frontier models because it "assumes context they solve unaided." The body largely showed generic xUnit patterns a frontier model already knows, so a skilled run tied with baseline.

Changes (kept lean — the skill is already token-efficient)

  • Default integration tests to the SDK's in-memory ClientServerTestBase instead of spawning dotnet run via StdioClientTransport; reserve the process-spawning transport for a single end-to-end smoke test. (Per-fixture process spawning is the top cause of flaky/hanging integration tests — the skill's own Pitfalls section calls this out.)
  • Add an MCP-specific quality assertion: every tool must expose a non-empty Description (MCP clients rely on descriptions to choose tools) — a check frontier models don't write by default.
  • Add matching Validation checklist items.

Verification

skill-validator check runs in CI. Recommend a cross-family eval re-run (-f skills="mcp-csharp-test" -f executors="opus,gpt" -f runs=5; prior avgN was ~2.8, so use more runs).

Refs #889

The cross-family eval (dotnet#889) rated mcp-csharp-test high-impact (0.65) but
STRENGTHEN 0/5 — it misses frontier models because it 'assumes context
they solve unaided' (generic xUnit testing). Add opinionated,
MCP-specific steps that change behavior even for strong models, while
keeping the skill token-efficient:

- Default integration tests to the SDK's in-memory ClientServerTestBase;
  reserve process-spawning StdioClientTransport for one E2E smoke test
  (spawning dotnet run per fixture is the top cause of flaky/hanging tests)
- Add an MCP-specific quality assertion: every tool must expose a
  non-empty Description (MCP clients rely on it to choose tools)
- Add matching Validation checklist items

Refs dotnet#889

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 6a8ce111-58e5-48a7-9f7f-8de972bdc693
Copilot AI review requested due to automatic review settings July 23, 2026 23:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Strengthens the plugins/dotnet-ai skill mcp-csharp-test by adding more MCP-specific, prescriptive testing guidance intended to improve outcomes for frontier models.

Changes:

  • Adds guidance to prefer in-memory integration testing via ClientServerTestBase, limiting StdioClientTransport to an E2E smoke test.
  • Adds an MCP-specific quality check: require tools to have non-empty Description.
  • Updates the Validation checklist to reflect the new testing recommendations and assertions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +96 to 99
Test the full MCP protocol through a real MCP client.

> **Default to in-memory testing.** Use the SDK's `ClientServerTestBase` (see [references/test-patterns.md](references/test-patterns.md)) — it wires client and server in-process, so tests are fast and deterministic with no spawned process. Reserve the process-spawning `StdioClientTransport` below for **one** end-to-end smoke test, not your whole suite — spawning `dotnet run` per fixture is the #1 cause of flaky, hanging integration tests.

Comment on lines +131 to +132
var tools = await _client.ListToolsAsync();
tools.Should().OnlyContain(t => !string.IsNullOrWhiteSpace(t.Description));
@leslierichardson95

Copy link
Copy Markdown
Contributor Author

Superseded by #940, which moves this change to a branch on the primary dotnet/skills repo. Closing this fork PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants