René's URL Explorer Experiment


Title: fix(mcp): audit an upsert that rewrites or revives a server by waleedlatif1 · Pull Request #6602 · simstudioai/sim · GitHub

Open Graph Title: fix(mcp): audit an upsert that rewrites or revives a server by waleedlatif1 · Pull Request #6602 · simstudioai/sim

X Title: fix(mcp): audit an upsert that rewrites or revives a server by waleedlatif1 · Pull Request #6602 · simstudioai/sim

Description: Summary Registering a URL that already exists takes the upsert branch and rewrites the live row, but recorded no audit row at all — the ADDED audit was gated on !result.updated main recorded MCP_SERVER_ADDED for these unconditionally: wrong action, but a row existed. #5273 added the gate, so staging records nothing. This is an audit-coverage regression, the third traced to that PR A rewrite is now MCP_SERVER_UPDATED carrying updatedFields; reviving a soft-deleted row stays MCP_SERVER_ADDED Follow-up to #6598, which established updatedFields on the result What the upsert silently rewrites name, description, transport, headers, timeout, retries, enabled, authType, the connection reset — and the URL's query string. generateMcpServerId hashes origin + pathname only (utils.ts:238 strips query and fragment), so re-registering …/mcp?token=NEW over …/mcp?token=OLD lands on the same row and repoints it. MCP endpoints commonly carry tokens there, and headers carry auth. Reachability Entry point existingServerBehavior Reaches upsert? POST /api/mcp/servers (settings "add server") not passed yes Copilot manage_mcp_tool op add → registerMcpServerUseCase not passed yes POST /api/v2/mcp-servers → createMcpServerUseCase 'reject' only on revival The Copilot path is what motivated fixing this now: an agent can rewrite a server's headers and URL query with no audit trail. Two distinct missing rows createMcpServerUseCase throws unless idState.deleted, so v2's only updated case is a revival — it was dropping a legitimate ADDED row on every revival. Live rewrites and revivals need different actions, so the orchestration now surfaces the isRevival it already computed as revived on the result. Type of Change Bug fix Testing Two new tests: a query-string re-registration asserts MCP_SERVER_UPDATED with updatedFields containing url and headers; a soft-deleted revival asserts MCP_SERVER_ADDED with no updatedFields Verified they can fail: restoring the old gate turns both red with expected undefined to be 'mcp_server.updated' / 'mcp_server.added' — i.e. no row at all 514 tests pass across lib/mcp, app/api/mcp, app/api/v2/mcp updateValues retyped from Record to Partial; typecheck passing is the proof every key is a real column, which is what makes Object.keys safe here lint:check, check:api-validation:strict, check:openapi all pass Deliberately unchanged Analytics gating. mcp_server_connected still fires only for a genuine insert — a revival arguably counts as a new connection, but changing it would skew first_mcp_connected_at and is a separate decision. 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 Registering a URL that already exists takes the upsert branch and rewrites the live row, but recorded no audit row at all — the ADDED audit was gated on !result.updated main recorded MCP_S...

X Description: Summary Registering a URL that already exists takes the upsert branch and rewrites the live row, but recorded no audit row at all — the ADDED audit was gated on !result.updated main recorded MCP_S...

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

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:6537d16d-9dc0-3584-8b61-16d20e93fd61
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id839E:1EC912:5C1DDE:82F35D:6AFB4363
html-safe-nonce0d5efa9e6d0b373b4f132c865c13ac9279f6309b2cc04c4941e582f5402b0653
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MzlFOjFFQzkxMjo1QzFEREU6ODJGMzVEOjZBRkI0MzYzIiwidmlzaXRvcl9pZCI6IjEzOTM1NDU2ODMzNjA0OTg1MzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaccd29736428f9cb0289874cef592bc7dbd78e7627e480ef76ec3fac8f3762073e
hovercard-subject-tagpull_request:4259251385
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/6602/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 Registering a URL that already exists takes the upsert branch and rewrites the live row, but recorded no audit row at all — the ADDED audit was gated on !result.updated main recorded MCP_S...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noned849b928f455c800985398e7f1b659425adb312a5fa14fba5d9a14e62e9fe5dd
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
releasea6c2f87cbcb6414452377b4967858ed6a66f1109
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/6602/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F6602%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%2F6602%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/6602/files
Reloadhttps://github.com/simstudioai/sim/pull/6602/files
Reloadhttps://github.com/simstudioai/sim/pull/6602/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests200 (200)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
fix/mcp-upsert-audithttps://github.com/simstudioai/sim/tree/fix/mcp-upsert-audit
Conversation 11 https://github.com/simstudioai/sim/pull/6602
Commits 2 https://github.com/simstudioai/sim/pull/6602/commits
Checks 30 https://github.com/simstudioai/sim/pull/6602/checks
Files changed https://github.com/simstudioai/sim/pull/6602/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6602/files
fix(mcp): audit an upsert that rewrites or revives a server https://github.com/simstudioai/sim/pull/6602/files#top
Show all changes 2 commits https://github.com/simstudioai/sim/pull/6602/files
a2b72d5 fix(mcp): audit an upsert that rewrites or revives a server waleedlatif1 Aug 12, 2026 https://github.com/simstudioai/sim/pull/6602/commits/a2b72d5600b17f7fa55399c2b8cb8f6613e32e8e
47daecf fix(mcp): redact audit URLs and drop unwritten columns from updatedFi… waleedlatif1 Aug 12, 2026 https://github.com/simstudioai/sim/pull/6602/commits/47daecfaf8c31824091a7151738e5260e746d8ce
Clear filters https://github.com/simstudioai/sim/pull/6602/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6602/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6602/files
use-cases.ts https://github.com/simstudioai/sim/pull/6602/files#diff-35be730cbfeea492e794ed88cbcc97422fd7fd3aecc227c7972a8f6e81296cc9
server-lifecycle.test.ts https://github.com/simstudioai/sim/pull/6602/files#diff-67f6d21d4ca70f641992cb737b97f58b22cdbe2c804878d6fb2cc2e77bebbc50
server-lifecycle.ts https://github.com/simstudioai/sim/pull/6602/files#diff-0680f8bc617e13ef336c024a3a18671af0b7fd2658f55f5de274b33a97de9581
apps/sim/lib/mcp/application/use-cases.tshttps://github.com/simstudioai/sim/pull/6602/files#diff-35be730cbfeea492e794ed88cbcc97422fd7fd3aecc227c7972a8f6e81296cc9
View file https://github.com/simstudioai/sim/blob/47daecfaf8c31824091a7151738e5260e746d8ce/apps/sim/lib/mcp/application/use-cases.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6602/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6602/files#diff-35be730cbfeea492e794ed88cbcc97422fd7fd3aecc227c7972a8f6e81296cc9
https://github.com/simstudioai/sim/pull/6602/files#diff-35be730cbfeea492e794ed88cbcc97422fd7fd3aecc227c7972a8f6e81296cc9
https://github.com/simstudioai/sim/pull/6602/files#diff-35be730cbfeea492e794ed88cbcc97422fd7fd3aecc227c7972a8f6e81296cc9
Please reload this pagehttps://github.com/simstudioai/sim/pull/6602/files
https://github.com/simstudioai/sim/pull/6602/files#diff-35be730cbfeea492e794ed88cbcc97422fd7fd3aecc227c7972a8f6e81296cc9
https://github.com/simstudioai/sim/pull/6602/files#diff-35be730cbfeea492e794ed88cbcc97422fd7fd3aecc227c7972a8f6e81296cc9
https://github.com/simstudioai/sim/pull/6602/files#diff-35be730cbfeea492e794ed88cbcc97422fd7fd3aecc227c7972a8f6e81296cc9
https://github.com/simstudioai/sim/pull/6602/files#diff-35be730cbfeea492e794ed88cbcc97422fd7fd3aecc227c7972a8f6e81296cc9
https://github.com/simstudioai/sim/pull/6602/files#diff-35be730cbfeea492e794ed88cbcc97422fd7fd3aecc227c7972a8f6e81296cc9
apps/sim/lib/mcp/orchestration/server-lifecycle.test.tshttps://github.com/simstudioai/sim/pull/6602/files#diff-67f6d21d4ca70f641992cb737b97f58b22cdbe2c804878d6fb2cc2e77bebbc50
View file https://github.com/simstudioai/sim/blob/47daecfaf8c31824091a7151738e5260e746d8ce/apps/sim/lib/mcp/orchestration/server-lifecycle.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6602/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6602/files#diff-67f6d21d4ca70f641992cb737b97f58b22cdbe2c804878d6fb2cc2e77bebbc50
https://github.com/simstudioai/sim/pull/6602/files#diff-67f6d21d4ca70f641992cb737b97f58b22cdbe2c804878d6fb2cc2e77bebbc50
https://github.com/simstudioai/sim/pull/6602/files#diff-67f6d21d4ca70f641992cb737b97f58b22cdbe2c804878d6fb2cc2e77bebbc50
https://github.com/simstudioai/sim/pull/6602/files#diff-67f6d21d4ca70f641992cb737b97f58b22cdbe2c804878d6fb2cc2e77bebbc50
https://github.com/simstudioai/sim/pull/6602/files#diff-67f6d21d4ca70f641992cb737b97f58b22cdbe2c804878d6fb2cc2e77bebbc50
apps/sim/lib/mcp/orchestration/server-lifecycle.tshttps://github.com/simstudioai/sim/pull/6602/files#diff-0680f8bc617e13ef336c024a3a18671af0b7fd2658f55f5de274b33a97de9581
View file https://github.com/simstudioai/sim/blob/47daecfaf8c31824091a7151738e5260e746d8ce/apps/sim/lib/mcp/orchestration/server-lifecycle.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6602/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6602/files#diff-0680f8bc617e13ef336c024a3a18671af0b7fd2658f55f5de274b33a97de9581
https://github.com/simstudioai/sim/pull/6602/files#diff-0680f8bc617e13ef336c024a3a18671af0b7fd2658f55f5de274b33a97de9581
https://github.com/simstudioai/sim/pull/6602/files#diff-0680f8bc617e13ef336c024a3a18671af0b7fd2658f55f5de274b33a97de9581
https://github.com/simstudioai/sim/pull/6602/files#diff-0680f8bc617e13ef336c024a3a18671af0b7fd2658f55f5de274b33a97de9581
https://github.com/simstudioai/sim/pull/6602/files#diff-0680f8bc617e13ef336c024a3a18671af0b7fd2658f55f5de274b33a97de9581
https://github.com/simstudioai/sim/pull/6602/files#diff-0680f8bc617e13ef336c024a3a18671af0b7fd2658f55f5de274b33a97de9581
https://github.com/simstudioai/sim/pull/6602/files#diff-0680f8bc617e13ef336c024a3a18671af0b7fd2658f55f5de274b33a97de9581
cursorhttps://github.com/apps/cursor
Aug 12, 2026https://github.com/simstudioai/sim/pull/6602/files#r3763774379
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
apps/sim/lib/mcp/orchestration/server-lifecycle.ts#L229-L230https://github.com/simstudioai/sim/blob/47daecfaf8c31824091a7151738e5260e746d8ce/apps/sim/lib/mcp/orchestration/server-lifecycle.ts#L229-L230
https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjU4YTBlYmQ5LTU1YjUtNDIyNy1iOTRlLWQ0M2JlNDk5YjQ0OSIsImVuY3J5cHRpb25LZXkiOiJSblBWWkxBYnVuYnprT0N1NFhTa1pzQnVmRUpfa2g3LS1UazZZeXFVajBzIiwiYnJhbmNoIjoiZml4L21jcC11cHNlcnQtYXVkaXQiLCJyZXBvT3duZXIiOiJzaW1zdHVkaW9haSIsInJlcG9OYW1lIjoic2ltIiwicHJvdmlkZXIiOiJnaXRodWIifX0
https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjU4YTBlYmQ5LTU1YjUtNDIyNy1iOTRlLWQ0M2JlNDk5YjQ0OSIsImVuY3J5cHRpb25LZXkiOiJSblBWWkxBYnVuYnprT0N1NFhTa1pzQnVmRUpfa2g3LS1UazZZeXFVajBzIiwiYnJhbmNoIjoiZml4L21jcC11cHNlcnQtYXVkaXQiLCJyZXBvT3duZXIiOiJzaW1zdHVkaW9haSIsInJlcG9OYW1lIjoic2ltIiwicHJOdW1iZXIiOjY2MDIsImNvbW1pdFNoYSI6IjQ3ZGFlY2ZhZjhjMzE4MjQwOTFhNzE1MTczOGU1MjYwZTc0NmQ4Y2UiLCJwcm92aWRlciI6ImdpdGh1YiJ9fQ
Cursor Bugbothttps://cursor.com/bugbot
47daecfhttps://github.com/simstudioai/sim/commit/47daecfaf8c31824091a7151738e5260e746d8ce
herehttps://www.cursor.com/dashboard/bugbot
Please reload this pagehttps://github.com/simstudioai/sim/pull/6602/files
https://github.com/simstudioai/sim/pull/6602/files#diff-0680f8bc617e13ef336c024a3a18671af0b7fd2658f55f5de274b33a97de9581
https://github.com/simstudioai/sim/pull/6602/files#diff-0680f8bc617e13ef336c024a3a18671af0b7fd2658f55f5de274b33a97de9581
https://github.com/simstudioai/sim/pull/6602/files#diff-0680f8bc617e13ef336c024a3a18671af0b7fd2658f55f5de274b33a97de9581
https://github.com/simstudioai/sim/pull/6602/files#diff-0680f8bc617e13ef336c024a3a18671af0b7fd2658f55f5de274b33a97de9581
https://github.com/simstudioai/sim/pull/6602/files#diff-0680f8bc617e13ef336c024a3a18671af0b7fd2658f55f5de274b33a97de9581
https://github.com/simstudioai/sim/pull/6602/files#diff-0680f8bc617e13ef336c024a3a18671af0b7fd2658f55f5de274b33a97de9581
https://github.com/simstudioai/sim/pull/6602/files#diff-0680f8bc617e13ef336c024a3a18671af0b7fd2658f55f5de274b33a97de9581
https://github.com/simstudioai/sim/pull/6602/files#diff-0680f8bc617e13ef336c024a3a18671af0b7fd2658f55f5de274b33a97de9581
https://github.com/simstudioai/sim/pull/6602/files#diff-0680f8bc617e13ef336c024a3a18671af0b7fd2658f55f5de274b33a97de9581
Please reload this pagehttps://github.com/simstudioai/sim/pull/6602/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.