Skip to content

Add prior discovery client connections#1697

Open
halter73 wants to merge 1 commit into
mainfrom
halter73-sdk-protocol-support-eval
Open

Add prior discovery client connections#1697
halter73 wants to merge 1 commit into
mainfrom
halter73-sdk-protocol-support-eval

Conversation

@halter73

@halter73 halter73 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add McpClientOptions.PriorDiscoverResult so trusted modern discovery snapshots can skip the server/discover probe.
  • Add McpClient.GetDiscoverResult() for reusable discovery snapshots, including cache hints.
  • Validate prior discovery compatibility, preserve pinned-version semantics, and keep 2026-07-28 request metadata emission intact.
  • Document the prior-knowledge reconnect path.

Closes #1696

Validation

  • dotnet build
  • dotnet test .\tests\ModelContextProtocol.Tests\ModelContextProtocol.Tests.csproj --filter "FullyQualifiedName~July2026ProtocolConnectionTests|FullyQualifiedName~July2026ProtocolListMetaEmissionTests"
  • dotnet test --filter "FullyQualifiedName!~DockerEverythingServerTests&FullyQualifiedName!~ServerConformanceTests"

Full dotnet test was also run. It hit pre-existing/environmental failures: Windows PATH resolution for TestServer.exe unless artifact folders are added to PATH, DockerEverythingServerTests.Sampling_Sse_EverythingServer failing against the external everything server with Unknown tool: trigger-sampling-request, one timing-sensitive CancelTaskAsync_ForWorkingTask_Succeeds that passed on rerun, and net9 conformance fixture startup timeout. The non-external suite passed after adding the generated test-server artifact folders to PATH.

Adds an opt-in PriorDiscoverResult client option for trusted modern discovery snapshots, exposes McpClient.GetDiscoverResult(), and reuses the discovery adoption path so clients can skip server/discover when reconnecting with prior knowledge.

Adds tests for zero-probe prior discovery, pinned-version validation, invalid legacy combinations, reusable snapshots, and 2026-07-28 per-request metadata emission.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

Add prior-knowledge connection path for modern protocol clients

1 participant