René's URL Explorer Experiment


Title: improvement(mcp): per-server tool queries + negative cache by waleedlatif1 · Pull Request #4715 · simstudioai/sim · GitHub

Open Graph Title: improvement(mcp): per-server tool queries + negative cache by waleedlatif1 · Pull Request #4715 · simstudioai/sim

X Title: improvement(mcp): per-server tool queries + negative cache by waleedlatif1 · Pull Request #4715 · simstudioai/sim

Description: Summary Move MCP tool discovery off the workspace-aggregated Promise.all fan-out onto per-server React Query keys (mcpKeys.serverToolsList(workspaceId, serverId)), matching how Cursor and Claude Code render remote MCP. A slow or hung server can no longer block another server's tools from loading. useMcpToolsQuery is now a useQueries combiner over the live server list. Public shape (data, isLoading, isFetching, error) preserved so every existing consumer compiles unchanged. Add short-TTL negative cache: when listTools fails (timeout, connection error) we mark the server unhealthy for 30s so subsequent discovery short-circuits instead of re-paying the timeout. OAuth-required errors are exempt so re-auth retries immediately. Drop LIST_TOOLS_TIMEOUT_MS 30s → 10s to bound worst-case first failure. Invalidations are per-server where the action is per-server (OAuth popup uses serverId from postMessage; SSE tools_changed uses serverId from payload; refresh/update/delete target a single key). Bulk operations stay workspace-broad. Type of Change Improvement Testing Tested manually. 289 MCP tests pass (incl. 3 new negative-cache tests + updated semantics on the existing "does not poison another server's cache" test). `bun run check:api-validation` passes. 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 Move MCP tool discovery off the workspace-aggregated Promise.all fan-out onto per-server React Query keys (mcpKeys.serverToolsList(workspaceId, serverId)), matching how Cursor and Claude C...

X Description: Summary Move MCP tool discovery off the workspace-aggregated Promise.all fan-out onto per-server React Query keys (mcpKeys.serverToolsList(workspaceId, serverId)), matching how Cursor and Claude C...

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

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:d4757a2c-4210-887e-1b1a-29d139ef783c
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9CAA:1BB96C:1512759:1CC4046:6AFB76A5
html-safe-nonce5a87b75d6dc2f01a5de756c4b5cc3c0d0f4c4845eb92bbe8b0bd5dd03f5ab845
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Q0FBOjFCQjk2QzoxNTEyNzU5OjFDQzQwNDY6NkFGQjc2QTUiLCJ2aXNpdG9yX2lkIjoiNjAxNjg2MzcyNjMyOTgzMjA1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmace459a92fdf26ed5c724b1fc4caf46f7a419021cd38d0be210f089676013c1df2
hovercard-subject-tagpull_request:3727556631
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/4715/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 Move MCP tool discovery off the workspace-aggregated Promise.all fan-out onto per-server React Query keys (mcpKeys.serverToolsList(workspaceId, serverId)), matching how Cursor and Claude C...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None0e29e7974fdda2feeaf5c891efd4b23b0734b23480232b62c7bdef13f40b5b48
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
release2e8872b770cc4d5d0cc1f2026afab747a268e2ce
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/4715/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F4715%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F4715%2Ffiles
Sign uphttps://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/4715/files
Reloadhttps://github.com/simstudioai/sim/pull/4715/files
Reloadhttps://github.com/simstudioai/sim/pull/4715/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests201 (201)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://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
improvement/mcp-per-server-querieshttps://github.com/simstudioai/sim/tree/improvement/mcp-per-server-queries
Conversation 46 https://github.com/simstudioai/sim/pull/4715
Commits 10 https://github.com/simstudioai/sim/pull/4715/commits
Checks 13 https://github.com/simstudioai/sim/pull/4715/checks
Files changed https://github.com/simstudioai/sim/pull/4715/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/4715/files
improvement(mcp): per-server tool queries + negative cache https://github.com/simstudioai/sim/pull/4715/files#top
Show all changes 10 commits https://github.com/simstudioai/sim/pull/4715/files
ecaabc6 improvement(mcp): per-server tool queries + negative cache so one slo… waleedlatif1 May 22, 2026 https://github.com/simstudioai/sim/pull/4715/commits/ecaabc6d924c70e42837e92ad98dfb08055d2982
fbcffed improvement(mcp): in-flight dedup + 2min negative TTL + no refetch on… waleedlatif1 May 22, 2026 https://github.com/simstudioai/sim/pull/4715/commits/fbcffed68305352d8a7bf2c442cc352dbfae08fe
397dd64 fix(mcp): address bugbot/greptile review on per-server tool discovery waleedlatif1 May 22, 2026 https://github.com/simstudioai/sim/pull/4715/commits/397dd64afca44f0eaa6b6963fda7058bd13b1965
8713f0d update icons waleedlatif1 May 22, 2026 https://github.com/simstudioai/sim/pull/4715/commits/8713f0da844f49537149d00b33e9ecb421d89486
7ebef04 chore(mcp): remove dead query keys and trim verbose comments waleedlatif1 May 22, 2026 https://github.com/simstudioai/sim/pull/4715/commits/7ebef04ada01d0040d8f7b59488580c0824b2c46
fedf75e fix(mcp): map negative-cache cooldown error to HTTP 503 waleedlatif1 May 22, 2026 https://github.com/simstudioai/sim/pull/4715/commits/fedf75eedd85f4094e6fa4706bb29d487e28d1cc
aa2d756 test(mcp): cover cooldown error → 503 categorization waleedlatif1 May 22, 2026 https://github.com/simstudioai/sim/pull/4715/commits/aa2d7562b11c740087bb1e816bf243acb90065f4
a91546e fix(mcp): address second-round bugbot review waleedlatif1 May 22, 2026 https://github.com/simstudioai/sim/pull/4715/commits/a91546e1457e511e4e8ed8ecefdafee65a506571
3fd031c chore(mcp): trim verbose comments waleedlatif1 May 22, 2026 https://github.com/simstudioai/sim/pull/4715/commits/3fd031c7ebb134b9b0c52a6c5e32dd54eead7516
ed1b970 fix(mcp): third-round bugbot review waleedlatif1 May 22, 2026 https://github.com/simstudioai/sim/pull/4715/commits/ed1b970fcd2a49e95d68a214b2e0ede2fffa4eea
Clear filters https://github.com/simstudioai/sim/pull/4715/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/4715/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/4715/files
route.ts https://github.com/simstudioai/sim/pull/4715/files#diff-fddc94965e6ed092dfac21e607fbef44888d286f2a177502cf531e9ca01bd1ce
route.ts https://github.com/simstudioai/sim/pull/4715/files#diff-6c4e49ccae37c7db07a63677cbfcd98affb095eaf48a31e267818ef632853002
route.ts https://github.com/simstudioai/sim/pull/4715/files#diff-996c743d5e8a330e59c381233d961abe818c086daa5c27329e3634a8d46f264b
icons.tsx https://github.com/simstudioai/sim/pull/4715/files#diff-75502961b6b1b69fd8b140643edfe13c66790af9f167e9a545cbcff6b2e9a20d
use-mcp-oauth-popup.ts https://github.com/simstudioai/sim/pull/4715/files#diff-5df86f3eb1fd9d834449d899802403e25e5d0eabb741cf592ea4491b42c20cbf
use-mcp-tools.ts https://github.com/simstudioai/sim/pull/4715/files#diff-bbb749519fd2c6f9861521b120f69c3fccf26db7b5186a714711917ad9bfa0b4
mcp.ts https://github.com/simstudioai/sim/pull/4715/files#diff-155dcbbfb44ea9f00a3bc5e2f52b439962b86957ee62ffec4f1837cf5701cc4e
service.test.ts https://github.com/simstudioai/sim/pull/4715/files#diff-35a9a41078c4e0e406f16e149b98f01c835e3b12ab4ecee70e06b77f33e6846a
service.ts https://github.com/simstudioai/sim/pull/4715/files#diff-19f6b7bbc0682d9438560d27d332499a5f8e1e4d1bf8aeb68dde6f2431137355
utils.test.ts https://github.com/simstudioai/sim/pull/4715/files#diff-9513abf5f55ac7ccad8953c0baee77dbc7122bd798fbb36133ec7941c7e34173
utils.ts https://github.com/simstudioai/sim/pull/4715/files#diff-3e3a2ab59257f1f643c0bfcbb46e4acb6a9ac29cb0906aa9c4d9d9a05e8852a4
apps/sim/app/api/mcp/oauth/callback/route.tshttps://github.com/simstudioai/sim/pull/4715/files#diff-fddc94965e6ed092dfac21e607fbef44888d286f2a177502cf531e9ca01bd1ce
View file https://github.com/simstudioai/sim/blob/ed1b970fcd2a49e95d68a214b2e0ede2fffa4eea/apps/sim/app/api/mcp/oauth/callback/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4715/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/4715/files#diff-fddc94965e6ed092dfac21e607fbef44888d286f2a177502cf531e9ca01bd1ce
https://github.com/simstudioai/sim/pull/4715/files#diff-fddc94965e6ed092dfac21e607fbef44888d286f2a177502cf531e9ca01bd1ce
apps/sim/app/api/mcp/servers/[id]/refresh/route.tshttps://github.com/simstudioai/sim/pull/4715/files#diff-6c4e49ccae37c7db07a63677cbfcd98affb095eaf48a31e267818ef632853002
View file https://github.com/simstudioai/sim/blob/ed1b970fcd2a49e95d68a214b2e0ede2fffa4eea/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/4715/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/4715/files#diff-6c4e49ccae37c7db07a63677cbfcd98affb095eaf48a31e267818ef632853002
https://github.com/simstudioai/sim/pull/4715/files#diff-6c4e49ccae37c7db07a63677cbfcd98affb095eaf48a31e267818ef632853002
apps/sim/app/api/mcp/tools/discover/route.tshttps://github.com/simstudioai/sim/pull/4715/files#diff-996c743d5e8a330e59c381233d961abe818c086daa5c27329e3634a8d46f264b
View file https://github.com/simstudioai/sim/blob/ed1b970fcd2a49e95d68a214b2e0ede2fffa4eea/apps/sim/app/api/mcp/tools/discover/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4715/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/4715/files#diff-996c743d5e8a330e59c381233d961abe818c086daa5c27329e3634a8d46f264b
https://github.com/simstudioai/sim/pull/4715/files#diff-996c743d5e8a330e59c381233d961abe818c086daa5c27329e3634a8d46f264b
https://github.com/simstudioai/sim/pull/4715/files#diff-996c743d5e8a330e59c381233d961abe818c086daa5c27329e3634a8d46f264b
https://github.com/simstudioai/sim/pull/4715/files#diff-996c743d5e8a330e59c381233d961abe818c086daa5c27329e3634a8d46f264b
apps/sim/components/icons.tsxhttps://github.com/simstudioai/sim/pull/4715/files#diff-75502961b6b1b69fd8b140643edfe13c66790af9f167e9a545cbcff6b2e9a20d
View file https://github.com/simstudioai/sim/blob/ed1b970fcd2a49e95d68a214b2e0ede2fffa4eea/apps/sim/components/icons.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4715/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/4715/files#diff-75502961b6b1b69fd8b140643edfe13c66790af9f167e9a545cbcff6b2e9a20d
https://github.com/simstudioai/sim/pull/4715/files#diff-75502961b6b1b69fd8b140643edfe13c66790af9f167e9a545cbcff6b2e9a20d
https://github.com/simstudioai/sim/pull/4715/files#diff-75502961b6b1b69fd8b140643edfe13c66790af9f167e9a545cbcff6b2e9a20d
https://github.com/simstudioai/sim/pull/4715/files#diff-75502961b6b1b69fd8b140643edfe13c66790af9f167e9a545cbcff6b2e9a20d
https://github.com/simstudioai/sim/pull/4715/files#diff-75502961b6b1b69fd8b140643edfe13c66790af9f167e9a545cbcff6b2e9a20d
https://github.com/simstudioai/sim/pull/4715/files#diff-75502961b6b1b69fd8b140643edfe13c66790af9f167e9a545cbcff6b2e9a20d
https://github.com/simstudioai/sim/pull/4715/files#diff-75502961b6b1b69fd8b140643edfe13c66790af9f167e9a545cbcff6b2e9a20d
apps/sim/hooks/mcp/use-mcp-oauth-popup.tshttps://github.com/simstudioai/sim/pull/4715/files#diff-5df86f3eb1fd9d834449d899802403e25e5d0eabb741cf592ea4491b42c20cbf
View file https://github.com/simstudioai/sim/blob/ed1b970fcd2a49e95d68a214b2e0ede2fffa4eea/apps/sim/hooks/mcp/use-mcp-oauth-popup.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4715/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/4715/files#diff-5df86f3eb1fd9d834449d899802403e25e5d0eabb741cf592ea4491b42c20cbf
https://github.com/simstudioai/sim/pull/4715/files#diff-5df86f3eb1fd9d834449d899802403e25e5d0eabb741cf592ea4491b42c20cbf
apps/sim/hooks/mcp/use-mcp-tools.tshttps://github.com/simstudioai/sim/pull/4715/files#diff-bbb749519fd2c6f9861521b120f69c3fccf26db7b5186a714711917ad9bfa0b4
View file https://github.com/simstudioai/sim/blob/ed1b970fcd2a49e95d68a214b2e0ede2fffa4eea/apps/sim/hooks/mcp/use-mcp-tools.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4715/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/4715/files#diff-bbb749519fd2c6f9861521b120f69c3fccf26db7b5186a714711917ad9bfa0b4
https://github.com/simstudioai/sim/pull/4715/files#diff-bbb749519fd2c6f9861521b120f69c3fccf26db7b5186a714711917ad9bfa0b4
https://github.com/simstudioai/sim/pull/4715/files#diff-bbb749519fd2c6f9861521b120f69c3fccf26db7b5186a714711917ad9bfa0b4
Please reload this pagehttps://github.com/simstudioai/sim/pull/4715/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/4715/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.