fix(mcp): probe-based OAuth detection in test-connection#4689
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview The MCP server modal (form + JSON import) consumes the new Reviewed by Cursor Bugbot for commit 54b6a50. Configure here. |
de3780c to
27a0cfd
Compare
Greptile SummaryThis PR replaces a fragile regex heuristic for OAuth detection (scanning error message strings for "401", "oauth", etc.) with a spec-compliant probe (
Confidence Score: 5/5Safe to merge — the change is well-scoped, the probe is inserted after all existing SSRF/domain guards, and the structured contract replaces a fragile string-matching heuristic without altering any other behavior. The probe correctly short-circuits only on an explicit RFC 9728 OAuth challenge (resource_metadata or scope in WWW-Authenticate), leaving all non-OAuth error paths untouched. The authType field flows cleanly from the probe through the contract and into both submit paths. No existing guards are bypassed and the error handling for real connection failures is preserved. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fix(mcp): guard undefined url in probe a..." | Re-trigger Greptile |
|
@greptile @cursor review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 54b6a50. Configure here.
Summary
test-connectionrunsdetectMcpAuthTypefirst; on 401 +resource_metadata(RFC 9728) it returns{ success: false, authRequired: true, authType: 'oauth' }via the typed contractauthRequiredflag — removes the prior regex heuristic on error message stringsauthTypeis threaded fromtest-connectionthrough to the create call soperformCreateMcpServerskips its own probe (one probe per add instead of two)Type of Change
Testing
Tested manually against
https://mcp.semrush.com/v1/mcpend-to-end:Checklist