René's URL Explorer Experiment


Title: fix(mcp): recover cleanly from OAuth failures by j15z · Pull Request #5595 · simstudioai/sim · GitHub

Open Graph Title: fix(mcp): recover cleanly from OAuth failures by j15z · Pull Request #5595 · simstudioai/sim

X Title: fix(mcp): recover cleanly from OAuth failures by j15z · Pull Request #5595 · simstudioai/sim

Description: Summary This PR makes MCP authentication and refresh failures recover cleanly instead of leaving Workspace Settings in repeated discovery loops or generic error states. Abandoned OAuth servers now wait for an explicit reconnect, failed refreshes expose a retryable Failed state, and persisted connection errors reach the list and detail views. Towards Fixing #5665. Dual-auth servers can now be added with a configured static Authorization: Bearer ... header: the connection test tries that credential before optional OAuth discovery. Supplemental non-auth headers still follow OAuth discovery, preserving OAuth servers that need routing or metadata headers. Connection attempts honor the configured timeout, and diagnostics record timing, phase, outcome, auth type, and header names without header values. Connection-test and refresh failures now use safe categorized messages so an upstream server cannot reflect a configured credential into API responses, persisted status, or logs. OAuth-pending servers remain disconnected without negative caching; rejected static credentials increment the normal failure state and negative cache instead of being mislabeled as OAuth-pending. Failed refreshes cannot report a stale connected row unless a newer successful discovery actually won the race. Merge order Merge this PR before #5596. Once it lands in staging, rebase #5596 onto the updated base and resolve its verification path against these authentication, status-persistence, and negative-cache semantics. Related: #5596 Type of Change Bug fix New feature Breaking change Documentation Other: ___________ Testing The original PR validation passed 25 focused MCP/API test files (375 tests) and the React Query pattern audit. The final post-merge validation passed 13 focused MCP/API/UI/security test files (220 tests), including valid and rejected Bearer credentials, headerless OAuth, OAuth with supplemental headers, post-resolution SSRF blocking, reflected-secret handling, static-401 failure persistence, refresh race handling, and settings refresh states. API validation audit passed with all 949 routes Zod-backed. Biome passed for the changed and conflict-resolved files, and the full TypeScript check passed. Review focus: static Bearer precedence, preservation of OAuth-plus-supplemental-header behavior, safe failure-state persistence, and the credential-reflection boundary. 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) Post-Deploy Monitoring & Validation Search application logs for McpClient, McpService, authorization_required, timeout, and OAuth authorization pending during the first 24 hours. Healthy signals: abandoned OAuth servers stay disconnected without repeated discovery failures; static Bearer dual-auth servers connect; successful reconnects clear failure counters; no header values appear in MCP diagnostics. Failure signals: renewed discovery loops, static Bearer servers being redirected into OAuth, OAuth servers with supplemental headers failing connection tests, or credential fragments appearing in responses or logs. Roll back if MCP list availability regresses or refresh failures stop exposing a safe actionable error. Owner: MCP/settings team during the first business day after deployment. Screenshots/Videos Not applicable; this changes connection behavior and failure handling without altering layout.

Open Graph Description: Summary This PR makes MCP authentication and refresh failures recover cleanly instead of leaving Workspace Settings in repeated discovery loops or generic error states. Abandoned OAuth servers now ...

X Description: Summary This PR makes MCP authentication and refresh failures recover cleanly instead of leaving Workspace Settings in repeated discovery loops or generic error states. Abandoned OAuth servers now ...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:bd064273-258b-5f3d-fd2f-d655714bb940
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB64A:1793BD:2E570C1:40A22B3:6A634170
html-safe-nonce600cc8277999df294e11c01ce5cb1a51c76ed6de1a39c25213507496aa131a9c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNjRBOjE3OTNCRDoyRTU3MEMxOjQwQTIyQjM6NkE2MzQxNzAiLCJ2aXNpdG9yX2lkIjoiMjgyMjkzODI5NTgzOTk2NTU1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmace3ad2bb3d3bffa444974d42a2eb84d199a4592bb8216d98b271aac64ccdb1c91
hovercard-subject-tagpull_request:4036380819
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/5595/files
twitter:imagehttps://avatars.githubusercontent.com/u/96924014?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/96924014?s=400&v=4
og:image:altSummary This PR makes MCP authentication and refresh failures recover cleanly instead of leaving Workspace Settings in repeated discovery loops or generic error states. Abandoned OAuth servers now ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None59e55daad7174ca59d63c6974d58276ccb5477442e550bebb3c035e1bef11c94
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
release990295d92a4cc7b63fbbd83a046217cd7d77d49c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/5595/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F5595%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%2F5595%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/5595/files
Reloadhttps://github.com/simstudioai/sim/pull/5595/files
Reloadhttps://github.com/simstudioai/sim/pull/5595/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5595/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
j15zhttps://github.com/j15z
staginghttps://github.com/simstudioai/sim/tree/staging
fix/mcp-pagehttps://github.com/simstudioai/sim/tree/fix/mcp-page
Conversation 13 https://github.com/simstudioai/sim/pull/5595
Commits 5 https://github.com/simstudioai/sim/pull/5595/commits
Checks 18 https://github.com/simstudioai/sim/pull/5595/checks
Files changed https://github.com/simstudioai/sim/pull/5595/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5595/files
fix(mcp): recover cleanly from OAuth failures https://github.com/simstudioai/sim/pull/5595/files#top
Show all changes 5 commits https://github.com/simstudioai/sim/pull/5595/files
e72a777 fix(mcp): improve OAuth failure recovery j15z Jul 11, 2026 https://github.com/simstudioai/sim/pull/5595/commits/e72a777d25b0abfb8722c4810d70e05c8204ccff
97b3e73 fix(mcp): address OAuth recovery review findings j15z Jul 11, 2026 https://github.com/simstudioai/sim/pull/5595/commits/97b3e73ac30af0be09b55f827af6d4a209479246
c0bd4e4 fix(mcp): prefer static bearer auth in connection tests j15z Jul 14, 2026 https://github.com/simstudioai/sim/pull/5595/commits/c0bd4e4b142d97a20bc5c8922210376860a5bb38
23320ee fix(mcp): preserve discovery failure state j15z Jul 14, 2026 https://github.com/simstudioai/sim/pull/5595/commits/23320ee439fb5dc6bf74924075af1923553524c6
7b2378c Merge remote-tracking branch 'origin/staging' into fix/mcp-page j15z Jul 14, 2026 https://github.com/simstudioai/sim/pull/5595/commits/7b2378cd73fdd46a85096526952fea2199076e7e
Clear filters https://github.com/simstudioai/sim/pull/5595/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5595/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5595/files
route.test.ts https://github.com/simstudioai/sim/pull/5595/files#diff-6eb780ca829effe8da2b4e83b434f759ef21c0c240edd9488e2fd64e69158218
route.ts https://github.com/simstudioai/sim/pull/5595/files#diff-6c4e49ccae37c7db07a63677cbfcd98affb095eaf48a31e267818ef632853002
route.test.ts https://github.com/simstudioai/sim/pull/5595/files#diff-6fb5ef8fe360a64681ddc23079ab9d848c00fe874284f1c63aebcd064a59633e
route.ts https://github.com/simstudioai/sim/pull/5595/files#diff-c17c6c2db02c547d29b44e4d9889ee09f2c27c1de2952ee2f02de2de8023725b
mcp.tsx https://github.com/simstudioai/sim/pull/5595/files#diff-a4da5c277b6d754bb18bdf732cde648008b9624c1d73729926799e4a5c6a8fbc
refresh-action-state.test.ts https://github.com/simstudioai/sim/pull/5595/files#diff-3a3f6051987a760658253f25267a15f4f22e878577122755c4f65ead4ad1bc8d
refresh-action-state.ts https://github.com/simstudioai/sim/pull/5595/files#diff-598d1ea182d77a9e1fef771ff1c57d00ca4e3fffa8b3ddf0f8725df68225c5ca
server-tools-label.test.ts https://github.com/simstudioai/sim/pull/5595/files#diff-be7cc174073d5acb7f1b316accde77ac0425ff9bc4e1ecdac3ff5516cca5a396
server-tools-label.ts https://github.com/simstudioai/sim/pull/5595/files#diff-85f08b569fc4f0f12fe592e238e4a86f52f0ce360a4b88f16e03aff7f3f0fabc
settings-header.tsx https://github.com/simstudioai/sim/pull/5595/files#diff-3d234352f39ccc5c170e72e9f5262bc343c0db7782b47097cb6f802e3348f89e
mcp.test.tsx https://github.com/simstudioai/sim/pull/5595/files#diff-58613984e62df58143314ca6786be24368d490d4302be8b703d81d85519e8cbd
mcp.ts https://github.com/simstudioai/sim/pull/5595/files#diff-155dcbbfb44ea9f00a3bc5e2f52b439962b86957ee62ffec4f1837cf5701cc4e
client.test.ts https://github.com/simstudioai/sim/pull/5595/files#diff-3c669f1cfdbdbd74ae67141932035c61beea21909c92d6e0b8ad9f26b569dcab
client.ts https://github.com/simstudioai/sim/pull/5595/files#diff-25cb24353597fac644145b37622d21ec7315282c29ccb1c4275f3ccb46441e1a
service.test.ts https://github.com/simstudioai/sim/pull/5595/files#diff-35a9a41078c4e0e406f16e149b98f01c835e3b12ab4ecee70e06b77f33e6846a
service.ts https://github.com/simstudioai/sim/pull/5595/files#diff-19f6b7bbc0682d9438560d27d332499a5f8e1e4d1bf8aeb68dde6f2431137355
apps/sim/app/api/mcp/servers/[id]/refresh/route.test.tshttps://github.com/simstudioai/sim/pull/5595/files#diff-6eb780ca829effe8da2b4e83b434f759ef21c0c240edd9488e2fd64e69158218
View file https://github.com/simstudioai/sim/blob/7b2378cd73fdd46a85096526952fea2199076e7e/apps/sim/app/api/mcp/servers/%5Bid%5D/refresh/route.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5595/{{ revealButtonHref }}
apps/sim/app/api/mcp/servers/[id]/refresh/route.tshttps://github.com/simstudioai/sim/pull/5595/files#diff-6c4e49ccae37c7db07a63677cbfcd98affb095eaf48a31e267818ef632853002
View file https://github.com/simstudioai/sim/blob/7b2378cd73fdd46a85096526952fea2199076e7e/apps/sim/app/api/mcp/servers/%5Bid%5D/refresh/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5595/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5595/files#diff-6c4e49ccae37c7db07a63677cbfcd98affb095eaf48a31e267818ef632853002
https://github.com/simstudioai/sim/pull/5595/files#diff-6c4e49ccae37c7db07a63677cbfcd98affb095eaf48a31e267818ef632853002
https://github.com/simstudioai/sim/pull/5595/files#diff-6c4e49ccae37c7db07a63677cbfcd98affb095eaf48a31e267818ef632853002
https://github.com/simstudioai/sim/pull/5595/files#diff-6c4e49ccae37c7db07a63677cbfcd98affb095eaf48a31e267818ef632853002
Please reload this pagehttps://github.com/simstudioai/sim/pull/5595/files
https://github.com/simstudioai/sim/pull/5595/files#diff-6c4e49ccae37c7db07a63677cbfcd98affb095eaf48a31e267818ef632853002
Please reload this pagehttps://github.com/simstudioai/sim/pull/5595/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5595/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.