Repository navigation
fix(mcp): return 400 from test-connection when the server hostname does not exist - #10474
Merged
Merged
Conversation
…es not exist A hostname the resolver proves does not exist (ENOTFOUND) is the caller's input, so test-connection now answers 400 with the same message. Transient lookup failures (EAI_AGAIN, timeouts) keep returning 502. The classification reuses isHostNotFound, matching the credential validators' site_not_found split.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues remain. SummaryThe PR returns 400 when a tested MCP hostname does not exist, while keeping 502 for temporary DNS failures.
Reviews (3) · Last reviewed commit: "test(mcp): cover test-connection status ..." · Reviewed by Greptile |
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
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
POST /api/mcp/servers/test-connectionanswered 502 for every DNS failure, so a hostname the user mistyped surfaced as a gateway error and counted toward 5xx.McpDnsResolutionErrornow carrieshostNotFound, set from the existingisHostNotFoundpredicate (onlyENOTFOUND). The route returns 400 when it is set and keeps 502 for transient lookup failures (EAI_AGAIN, timeouts). The message is unchanged.Other callers are unchanged:
validateMcpServerUrl(create/update) and the managed connector already project DNS failures tovalidation/internalin the application layer.categorizeMcpServerError(discovery and execution against a registered server) keeps 502, because by then a hostname that stopped resolving is a server-side condition.Type of Change
Testing
domain-check.test.tscoversENOTFOUND→hostNotFound: trueandEAI_AGAIN→falsethrough the real DNS-validation path. Both cases fail on the pre-fixdomain-check.ts.Checklist