René's URL Explorer Experiment


Title: feat(mcp): reuse warm connections for tool execution and discovery by waleedlatif1 · Pull Request #5760 · simstudioai/sim · GitHub

Open Graph Title: feat(mcp): reuse warm connections for tool execution and discovery by waleedlatif1 · Pull Request #5760 · simstudioai/sim

X Title: feat(mcp): reuse warm connections for tool execution and discovery by waleedlatif1 · Pull Request #5760 · simstudioai/sim

Description: Summary Adds a warm MCP connection pool so tool execution and discovery reuse a live connection per server instead of connecting, initializing, and tearing down on every call (the connect-per-operation pattern behind the systemic -32001 request timeouts) One warm connection per server, keyed by server id; concurrent requests multiplex over the single transport (verified against the MCP SDK, LibreChat, Cline, VS Code) Single-flight creation (concurrent misses share one connect), 60s liveness ping-cache, and eviction on config change, max age (re-resolves the pinned SSRF IP), idle timeout, transport close, and session error Wires all four connect-per-op sites through one withServerClient seam; calls carrying per-request headers bypass the pool (can't share a connection under different headers) Reconnect stays demand-driven via the callers' existing retry — no background reconnect loop. On by default, no flag Type of Change New feature Testing Added connection-pool.test.ts (12) and service-pool.test.ts (3); full MCP suite green (347 tests), tsc clean, boundary audit at baseline Not yet exercised against a live server under load — will watch pool-hit / timeout metrics after deploy 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 Adds a warm MCP connection pool so tool execution and discovery reuse a live connection per server instead of connecting, initializing, and tearing down on every call (the connect-per-oper...

X Description: Summary Adds a warm MCP connection pool so tool execution and discovery reuse a live connection per server instead of connecting, initializing, and tearing down on every call (the connect-per-oper...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:13f0c652-1a9a-5378-dcdb-d83a4d769cab
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE278:19B134:ED0DB7:154AFE0:6A632B61
html-safe-nonceb6525412943915657a0963c24bfe5fe09e0e7bcaf4b23cbb747daaab2050b029
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjc4OjE5QjEzNDpFRDBEQjc6MTU0QUZFMDo2QTYzMkI2MSIsInZpc2l0b3JfaWQiOiI4MzE1NzY2ODY4MjczMjEyMjU3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacaf6a2291b958b25887a8a5f75d9fd63c87e3d3727ab2db0d521313dd2b17739c
hovercard-subject-tagpull_request:4083825980
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/5760/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 Adds a warm MCP connection pool so tool execution and discovery reuse a live connection per server instead of connecting, initializing, and tearing down on every call (the connect-per-oper...
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/5760/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F5760%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%2F5760%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/5760/files
Reloadhttps://github.com/simstudioai/sim/pull/5760/files
Reloadhttps://github.com/simstudioai/sim/pull/5760/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5760/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
mcp-connection-reusehttps://github.com/simstudioai/sim/tree/mcp-connection-reuse
Conversation 71 https://github.com/simstudioai/sim/pull/5760
Commits 13 https://github.com/simstudioai/sim/pull/5760/commits
Checks 19 https://github.com/simstudioai/sim/pull/5760/checks
Files changed https://github.com/simstudioai/sim/pull/5760/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5760/files
feat(mcp): reuse warm connections for tool execution and discovery https://github.com/simstudioai/sim/pull/5760/files#top
Show all changes 13 commits https://github.com/simstudioai/sim/pull/5760/files
e55fff5 feat(mcp): reuse warm connections for tool execution and discovery waleedlatif1 Jul 18, 2026 https://github.com/simstudioai/sim/pull/5760/commits/e55fff5d7a73db3a731fec96eadd60d04180c241
3b3bceb fix(mcp): make connection pool concurrency-safe and auth-scoped waleedlatif1 Jul 18, 2026 https://github.com/simstudioai/sim/pull/5760/commits/3b3bceb0423517c15ffa69d755c601bf84b8b850
70bd09d fix(mcp): decouple pool validity from updatedAt, widen dead-connectio… waleedlatif1 Jul 18, 2026 https://github.com/simstudioai/sim/pull/5760/commits/70bd09dcbf8436405f71ba770f48b544d16c7644
252a4a0 fix(mcp): retire pooled connections on auth failure and server delete waleedlatif1 Jul 18, 2026 https://github.com/simstudioai/sim/pull/5760/commits/252a4a073908a151d786b64309fcdd5ad393d129
b86cfa3 improvement(mcp): defer bulk-discovery env resolution to the pool mis… waleedlatif1 Jul 18, 2026 https://github.com/simstudioai/sim/pull/5760/commits/b86cfa321840b33ac4317a615701136c5a871efa
0362f9f fix(mcp): retire in-flight creates evicted mid-connect via server gen… waleedlatif1 Jul 18, 2026 https://github.com/simstudioai/sim/pull/5760/commits/0362f9f20a0016010e154d623f9caec06c7a5b06
de3527f fix(mcp): use evicted-mid-create connections one-shot and decouple po… waleedlatif1 Jul 18, 2026 https://github.com/simstudioai/sim/pull/5760/commits/de3527fe1de97b264217bdb3ecee34733b3aead4
fc2ee4c improvement(mcp): dedupe create thunks into buildClient, harden dispo… waleedlatif1 Jul 18, 2026 https://github.com/simstudioai/sim/pull/5760/commits/fc2ee4c1ef51388b87f2d4e08347b472369f54b6
0edd043 fix(mcp): close acquire-gap races (re-resolve after stale ping, skip … waleedlatif1 Jul 18, 2026 https://github.com/simstudioai/sim/pull/5760/commits/0edd043d97dd00289d38f6a4add0bb8a277f02d4
3ac3d2d fix(mcp): retry auth failures in executeTool; simplify acquire re-che… waleedlatif1 Jul 19, 2026 https://github.com/simstudioai/sim/pull/5760/commits/3ac3d2d8d91711dfd0b178c2de33b8f36c3823d4
abd9848 fix(mcp): let bulk discovery reconnect a lost notification connection… waleedlatif1 Jul 19, 2026 https://github.com/simstudioai/sim/pull/5760/commits/abd98481f7bf22e3732a9bf16a3963682120b659
65bd1f3 fix(mcp): recover rotated credentials on discovery via shared fetchSe… waleedlatif1 Jul 19, 2026 https://github.com/simstudioai/sim/pull/5760/commits/65bd1f3e038fa7b5e5561b1ae01b8a99319921bc
d74d48d chore(mcp): add debug logging for pool hit/miss/eviction observability waleedlatif1 Jul 19, 2026 https://github.com/simstudioai/sim/pull/5760/commits/d74d48dfaf119d273137c6bfa51bdc5e6c55f296
Clear filters https://github.com/simstudioai/sim/pull/5760/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5760/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5760/files
client.ts https://github.com/simstudioai/sim/pull/5760/files#diff-25cb24353597fac644145b37622d21ec7315282c29ccb1c4275f3ccb46441e1a
connection-pool.test.ts https://github.com/simstudioai/sim/pull/5760/files#diff-47521513e62c7e86cb2eabf09d81e3fa902a809364bcd733ac2babd08a4ea204
connection-pool.ts https://github.com/simstudioai/sim/pull/5760/files#diff-ef14c807c9e6154a7800b88841aa776c6acaac462146766ce0a5a948f695692d
server-lifecycle.test.ts https://github.com/simstudioai/sim/pull/5760/files#diff-67f6d21d4ca70f641992cb737b97f58b22cdbe2c804878d6fb2cc2e77bebbc50
server-lifecycle.ts https://github.com/simstudioai/sim/pull/5760/files#diff-0680f8bc617e13ef336c024a3a18671af0b7fd2658f55f5de274b33a97de9581
service-pool.test.ts https://github.com/simstudioai/sim/pull/5760/files#diff-5a7ef912642fe4e358794fa800ad30376539d56e2cbb22c2e1120be5ee24b6e9
service.test.ts https://github.com/simstudioai/sim/pull/5760/files#diff-35a9a41078c4e0e406f16e149b98f01c835e3b12ab4ecee70e06b77f33e6846a
service.ts https://github.com/simstudioai/sim/pull/5760/files#diff-19f6b7bbc0682d9438560d27d332499a5f8e1e4d1bf8aeb68dde6f2431137355
apps/sim/lib/mcp/client.tshttps://github.com/simstudioai/sim/pull/5760/files#diff-25cb24353597fac644145b37622d21ec7315282c29ccb1c4275f3ccb46441e1a
View file https://github.com/simstudioai/sim/blob/d74d48dfaf119d273137c6bfa51bdc5e6c55f296/apps/sim/lib/mcp/client.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5760/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5760/files#diff-25cb24353597fac644145b37622d21ec7315282c29ccb1c4275f3ccb46441e1a
https://github.com/simstudioai/sim/pull/5760/files#diff-25cb24353597fac644145b37622d21ec7315282c29ccb1c4275f3ccb46441e1a
apps/sim/lib/mcp/connection-pool.test.tshttps://github.com/simstudioai/sim/pull/5760/files#diff-47521513e62c7e86cb2eabf09d81e3fa902a809364bcd733ac2babd08a4ea204
View file https://github.com/simstudioai/sim/blob/d74d48dfaf119d273137c6bfa51bdc5e6c55f296/apps/sim/lib/mcp/connection-pool.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5760/{{ revealButtonHref }}
Please reload this pagehttps://github.com/simstudioai/sim/pull/5760/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5760/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.