Add MCP connection-readiness gating and surface setup URL#257
Draft
DheerajPannala wants to merge 3 commits into
Draft
Add MCP connection-readiness gating and surface setup URL#257DheerajPannala wants to merge 3 commits into
DheerajPannala wants to merge 3 commits into
Conversation
DheerajPannala
commented
Jun 9, 2026
- Parse per-server and aggregate connection metadata (allConnectionsUrl, missingConnectionsUrl, connectivityStatus) from the tooling gateway response, supporting both the legacy bare-array and wrapped {mcpServers, ...} shapes.
- Carry aggregate metadata in an internal McpDiscoveryResult.
- Gate ListToolServersAsync: throw McpConnectionsRequiredException when the aggregate connectivity status is present and not "Ready". Dev-manifest and legacy responses are never gated.
- Add public McpConnectionsRequiredException (MissingConnectionsUrl, ConnectivityStatus, ServerNames).
- Parse per-server and aggregate connection metadata (allConnectionsUrl, missingConnectionsUrl, connectivityStatus) from the tooling gateway response, supporting both the legacy bare-array and wrapped {mcpServers, ...} shapes.
- Carry aggregate metadata in an internal McpDiscoveryResult.
- Gate ListToolServersAsync: throw McpConnectionsRequiredException when the aggregate connectivity status is present and not "Ready". Dev-manifest and legacy responses are never gated.
- Add public McpConnectionsRequiredException (MissingConnectionsUrl, ConnectivityStatus, ServerNames).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
EnumerateToolsFromServersAsync wrapped the server-listing call in a broad catch that swallowed all exceptions and returned an empty result. This hid the connection-readiness gating exception from callers, so the agent never received it and could not surface the connection-setup URL. - Re-throw McpConnectionsRequiredException in both EnumerateToolsFromServersAsync overloads before the broad catch, so it reaches the agent's turn handler. - Generic (non-gating) listing failures still return an empty result (unchanged). - Add tests covering propagation with and without a token provider, plus a regression guard that generic failures still return empty. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
@DheerajPannala please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
- Drop Trim() on JSON property names in TryGetPropertyCaseInsensitive (ordinal case-insensitive match) - Remove dead JsonSerializerOptions on JsonElement deserialize - Move ReadyConnectivityStatus const with fields; drop redundant null-forgiving in IsReadyStatus - Raise connection-gate log to Warning so it surfaces until handlers are universal - Document McpConnectionsRequiredException on the enumeration APIs and note ServerNames may be empty - Add edge-case gating tests (aggregate-only trust, status variants, empty names, null URL) - Record the change in Tooling and extension changelogs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
| config.Setup(c => c["MCP_PLATFORM_ENDPOINT"]).Returns("https://test.endpoint"); | ||
|
|
||
| handler ??= Respond("[]"); | ||
| var httpClient = new HttpClient(handler); |
Comment on lines
+422
to
+429
| foreach (var property in element.EnumerateObject()) | ||
| { | ||
| if (string.Equals(property.Name, propertyName, StringComparison.OrdinalIgnoreCase)) | ||
| { | ||
| value = property.Value; | ||
| return true; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.