Repository navigation
fix(mcp): classify unresolvable and egress-refused server URLs in discovery - #9341
Merged
Merged
Conversation
…covery An MCP server whose hostname no longer resolves made tool discovery answer 500 and log at error. McpDnsResolutionError is now a server-unavailable condition (discover 422, v2 503), and categorizeError maps it to 502 and egress/domain refusals to 403, matching test-connection and server lifecycle.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
There was a problem hiding this comment.
No issues found across 3 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Heads up: you’re close to your flex budget. Increase your flex budget so reviews don’t pause.
Turn on auto-fix | Re-trigger cubic
Contributor
[Medium impact] This PR appears safe to merge. SummaryClassifies MCP DNS failures and blocked server URLs without returning their raw error messages.
No actionable issues found. Tests were inspected but not run.
|
This branch was previously deployed
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.
Summary
/api/mcp/tools/discoveranswer 500 and log at error:McpDnsResolutionErrorfrom the SSRF pre-check fell throughisMcpServerUnavailableErrorandcategorizeErrorisMcpServerUnavailableErrornow treats it as server-unavailable: discover answers 422 + warn, v2GET /api/v2/mcp-servers/{id}/toolsanswers its documented 503categorizeErrormaps it to 502 (Server hostname could not be resolved) andMcpSsrfError/McpDomainNotAllowedErrorto 403, matching test-connection and server lifecycle; reaches discover refresh,servers/[id]/refresh, and MCP tool executionType of Change
Testing
discover/route.test.ts(DNS → 422, SSRF and domain refusal → 403) andv2/mcp-servers/[mcpServerId]/tools/route.test.ts(DNS → 503); all four fail on the pre-fix code (500) and pass with the fixapp/api/mcp/tools,app/api/mcp/servers/[id]/refresh,app/api/v2/mcp-servers,lib/internal/mcp,lib/mcp/utils.test.tscheck:api-validation:strict,check:comment-hygiene,check:test-patterns; full suite, type-check, and audits run in CIChecklist
test-auditauthoring gate)