René's URL Explorer Experiment


Title: fix(mcp): bound OAuth discovery/DCR/token fetches with a timeout by waleedlatif1 · Pull Request #5776 · simstudioai/sim · GitHub

Open Graph Title: fix(mcp): bound OAuth discovery/DCR/token fetches with a timeout by waleedlatif1 · Pull Request #5776 · simstudioai/sim

X Title: fix(mcp): bound OAuth discovery/DCR/token fetches with a timeout by waleedlatif1 · Pull Request #5776 · simstudioai/sim

Description: Summary MCP OAuth (app.withgauge.com/mcp and others) can leave /oauth/start hanging for minutes, stranding the UI on "Connecting…". Root cause: the MCP SDK issues OAuth discovery / dynamic client registration / token exchange with a bare fetch and no AbortSignal (only the JSON-RPC layer gets the SDK's request timeout), and undici's default headers/body timeouts are 5 minutes. A slow or unresponsive authorization server therefore blocks the request handler — and the browser waiting on it — indefinitely. Fix: bound each guarded OAuth/revocation leg with a 30s AbortSignal.timeout, composed with any caller-provided signal via AbortSignal.any so cancellation still works. Only our own deadline is relabeled to a clear McpError; caller aborts and all other failures propagate unchanged. Scoped to createSsrfGuardedMcpFetch (OAuth discovery, RFC 7009 revocation, auth-type probe). The live MCP transport (createPinnedMcpFetch) is untouched, so tool-execution timeouts are unaffected. Why this design (empirically grounded) The MCP TS SDK applies no timeout to OAuth HTTP legs — it delegates to the injected fetchFn. Well-behaved clients (OpenAI Codex) add an explicit per-leg discovery timeout; local clients (Claude Code/Inspector) run OAuth on the user's machine so a human masks the hang. A hosted, server-side client must bound it itself. SSRF validation and IP-pinning are kept — Sim accepts arbitrary user URLs and must guard egress (unlike local clients). This PR only adds the missing deadline; redirect/retry behavior is deliberately unchanged to avoid regressing auth servers that 302 during discovery. Backwards compatibility / no regressions Existing callers (auth.ts, revoke.ts, probe.ts) call createSsrfGuardedMcpFetch() with no args → default 30s; behavior for healthy servers (each leg completes in well under a second) is unchanged. A caller-supplied AbortSignal is composed, not replaced. 30s mirrors the existing DEFAULT_CONNECTION_TIMEOUT precedent; only pathologically slow (>30s/leg) servers change from "eventually/never" to a fast, actionable error. Type of Change Bug fix Testing Tested manually + unit tests. Added coverage: signal is always attached, deadline surfaces an McpError, and a caller abort propagates unchanged (composed with the deadline). Full lib/mcp + app/api/mcp suite: 429 passing. Lint + typecheck clean. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Open Graph Description: Summary MCP OAuth (app.withgauge.com/mcp and others) can leave /oauth/start hanging for minutes, stranding the UI on "Connecting…". Root cause: the MCP SDK issues OAuth discovery / dynam...

X Description: Summary MCP OAuth (app.withgauge.com/mcp and others) can leave /oauth/start hanging for minutes, stranding the UI on "Connecting…". Root cause: the MCP SDK issues OAuth discovery...

Opengraph URL: https://github.com/simstudioai/sim/pull/5776

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:1f50b303-b74b-4e91-5e36-86009d4a14d1
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8632:F27A1:C3EB0D:1189B1F:6A632B38
html-safe-nonce0ea0ccc4507bc5cfd5a6c1a3d1a944afe185ff410f9cea23f00618c39c9f0412
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NjMyOkYyN0ExOkMzRUIwRDoxMTg5QjFGOjZBNjMyQjM4IiwidmlzaXRvcl9pZCI6IjYyNTMxMDAyMTcyNTQ3NTEwMzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacbeac87ad16c5e94c61afd135ed29e5a2407ead9f42bff54dcf7b895aedd4e5eb
hovercard-subject-tagpull_request:4094511465
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/5776/files
twitter:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
og:image:altSummary MCP OAuth (app.withgauge.com/mcp and others) can leave /oauth/start hanging for minutes, stranding the UI on "Connecting…". Root cause: the MCP SDK issues OAuth discovery / dynam...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None30c644d502bce6cd2e59f9000b4744f2b64819abea8e8f959b18e3ad793125aa
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release331492a48ebd91d66ef2de38e1901bb911c9fe9b
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/5776/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F5776%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F5776%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/5776/files
Reloadhttps://github.com/simstudioai/sim/pull/5776/files
Reloadhttps://github.com/simstudioai/sim/pull/5776/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5776/files
simstudioai https://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Notifications https://github.com/login?return_to=%2Fsimstudioai%2Fsim
Fork 3.7k https://github.com/login?return_to=%2Fsimstudioai%2Fsim
Star 29.2k https://github.com/login?return_to=%2Fsimstudioai%2Fsim
Code https://github.com/simstudioai/sim
Issues 111 https://github.com/simstudioai/sim/issues
Pull requests 120 https://github.com/simstudioai/sim/pulls
Actions https://github.com/simstudioai/sim/actions
Projects https://github.com/simstudioai/sim/projects
Security and quality 0 https://github.com/simstudioai/sim/security
Insights https://github.com/simstudioai/sim/pulse
Code https://github.com/simstudioai/sim
Issues https://github.com/simstudioai/sim/issues
Pull requests https://github.com/simstudioai/sim/pulls
Actions https://github.com/simstudioai/sim/actions
Projects https://github.com/simstudioai/sim/projects
Security and quality https://github.com/simstudioai/sim/security
Insights https://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
staginghttps://github.com/simstudioai/sim/tree/staging
fix/mcp-oauth-fetch-timeouthttps://github.com/simstudioai/sim/tree/fix/mcp-oauth-fetch-timeout
Conversation 20 https://github.com/simstudioai/sim/pull/5776
Commits 5 https://github.com/simstudioai/sim/pull/5776/commits
Checks 19 https://github.com/simstudioai/sim/pull/5776/checks
Files changed 2 https://github.com/simstudioai/sim/pull/5776/files
fix(mcp): bound OAuth discovery/DCR/token fetches with a timeout https://github.com/simstudioai/sim/pull/5776/files#top
Show all changes 5 commits https://github.com/simstudioai/sim/pull/5776/files
4fa5fde fix(mcp): bound OAuth discovery/DCR/token fetches with a timeout waleedlatif1 Jul 20, 2026 https://github.com/simstudioai/sim/pull/5776/commits/4fa5fde24a4ae4bfe1223298e67b70afb2a710e8
aa42acb fix(mcp): bound SSRF/DNS validation by the deadline too waleedlatif1 Jul 20, 2026 https://github.com/simstudioai/sim/pull/5776/commits/aa42acb9499eaedab51bbb60c456ab761281b079
ea33016 fix(mcp): compose caller signal before validation + attribute timeout… waleedlatif1 Jul 20, 2026 https://github.com/simstudioai/sim/pull/5776/commits/ea33016280ce41efe781ae69bc6ec334674d6b35
071d0cc fix(mcp): adopt in-flight validation on early abort to avoid unhandle… waleedlatif1 Jul 20, 2026 https://github.com/simstudioai/sim/pull/5776/commits/071d0cc7dad3dbd1bf601bcd09fe09f83757c01a
1a8be6f test(mcp): use sleep() instead of raw setTimeout in pinned-fetch test waleedlatif1 Jul 20, 2026 https://github.com/simstudioai/sim/pull/5776/commits/1a8be6f57fada2448258970c5901e98ce7f06808
Clear filters https://github.com/simstudioai/sim/pull/5776/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5776/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5776/files
pinned-fetch.test.ts https://github.com/simstudioai/sim/pull/5776/files#diff-eb3b541d290de33fb3e61f5b074e2cfdb26cfd7a770a0ce1566316334a5ffec9
pinned-fetch.ts https://github.com/simstudioai/sim/pull/5776/files#diff-762eddc0923a0e087da8b1ddba48178609b8d41572e63b65e0cc2d027e79648c
apps/sim/lib/mcp/pinned-fetch.test.tshttps://github.com/simstudioai/sim/pull/5776/files#diff-eb3b541d290de33fb3e61f5b074e2cfdb26cfd7a770a0ce1566316334a5ffec9
View file https://github.com/simstudioai/sim/blob/1a8be6f57fada2448258970c5901e98ce7f06808/apps/sim/lib/mcp/pinned-fetch.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5776/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5776/files#diff-eb3b541d290de33fb3e61f5b074e2cfdb26cfd7a770a0ce1566316334a5ffec9
https://github.com/simstudioai/sim/pull/5776/files#diff-eb3b541d290de33fb3e61f5b074e2cfdb26cfd7a770a0ce1566316334a5ffec9
https://github.com/simstudioai/sim/pull/5776/files#diff-eb3b541d290de33fb3e61f5b074e2cfdb26cfd7a770a0ce1566316334a5ffec9
apps/sim/lib/mcp/pinned-fetch.tshttps://github.com/simstudioai/sim/pull/5776/files#diff-762eddc0923a0e087da8b1ddba48178609b8d41572e63b65e0cc2d027e79648c
View file https://github.com/simstudioai/sim/blob/1a8be6f57fada2448258970c5901e98ce7f06808/apps/sim/lib/mcp/pinned-fetch.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5776/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5776/files#diff-762eddc0923a0e087da8b1ddba48178609b8d41572e63b65e0cc2d027e79648c
https://github.com/simstudioai/sim/pull/5776/files#diff-762eddc0923a0e087da8b1ddba48178609b8d41572e63b65e0cc2d027e79648c
https://github.com/simstudioai/sim/pull/5776/files#diff-762eddc0923a0e087da8b1ddba48178609b8d41572e63b65e0cc2d027e79648c
Please reload this pagehttps://github.com/simstudioai/sim/pull/5776/files
https://github.com/simstudioai/sim/pull/5776/files#diff-762eddc0923a0e087da8b1ddba48178609b8d41572e63b65e0cc2d027e79648c
Please reload this pagehttps://github.com/simstudioai/sim/pull/5776/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5776/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5776/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.