Title: fix(mcp): keep a legacy server row from blanking the whole server list by waleedlatif1 · Pull Request #5762 · simstudioai/sim · GitHub
Open Graph Title: fix(mcp): keep a legacy server row from blanking the whole server list by waleedlatif1 · Pull Request #5762 · simstudioai/sim
X Title: fix(mcp): keep a legacy server row from blanking the whole server list by waleedlatif1 · Pull Request #5762 · simstudioai/sim
Description: Summary The MCP server-list response validated transport/authType/connectionStatus with strict enums, but those are free-text DB columns that can hold legacy values (e.g. transport http/sse from before the streamable-http consolidation). Because the client strict-parses the whole z.array(...) with retry:false, one off-enum row blanked the entire workspace's MCP list ("Response failed contract validation"). Found live in prod: 13 active rows (sse/http) across 11 workspaces. Same class as #5593, which only covered consecutiveFailures. Fix: response-side .catch() tolerance on all three strict-enum-over-free-text columns (request bodies stay strict) — transport → streamable-http, authType/connectionStatus → undefined. Uses Zod's built-in .catch(), matching the existing pattern in contracts/admin.ts. Stop the workspace-fork copy from propagating legacy transport values (the still-active vector that regenerated bad rows). Bundled two correctness fixes found in the same MCP audit: create/upsert path now resets connection status on a headers→OAuth flip (mirrors the update path, kills a false "connected" state); bulk discovery now drops the positive tool cache on OAuth-pending (mirrors the single-server path, no stale tools after re-auth). Data backfill of the 13 legacy rows handled separately. Type of Change Bug fix Testing 149 tests pass across lib/api/contracts, app/api/mcp/servers, lib/mcp, and ee/workspace-forking; typecheck, Biome, and check:api-validation all clean. Runtime-verified: bad response values coerce (no throw), valid values pass through, and create/test request bodies still reject invalid transport. Follow-up (not in this PR) Optional durable hardening: per-row isolation at the list route (drop+log a malformed row) as a backstop for any future strict field. The three .catch()es close the entire present class, so this is future-proofing only. 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 The MCP server-list response validated transport/authType/connectionStatus with strict enums, but those are free-text DB columns that can hold legacy values (e.g. transport http/sse from b...
X Description: Summary The MCP server-list response validated transport/authType/connectionStatus with strict enums, but those are free-text DB columns that can hold legacy values (e.g. transport http/sse from b...
Opengraph URL: https://github.com/simstudioai/sim/pull/5762
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:8219ae1f-d63c-874c-f408-cd27b8b4284c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B12C:2F2710:101625D:175D31B:6A633210 |
| html-safe-nonce | 019dc377552deb12eeec9e30adc7cfb01ec2126538832f65acb1bfb1ec90e836 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTJDOjJGMjcxMDoxMDE2MjVEOjE3NUQzMUI6NkE2MzMyMTAiLCJ2aXNpdG9yX2lkIjoiNTc5Njk2MjQ0OTc2Mjc1OTE4NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f99165face8ad20eaf8efc635af893d39dc17c9afc50d6d070f2ddd87c27cd0b |
| hovercard-subject-tag | pull_request:4085348412 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/5762/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary The MCP server-list response validated transport/authType/connectionStatus with strict enums, but those are free-text DB columns that can hold legacy values (e.g. transport http/sse from b... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | df6e1c2adcceb061ec8c4106a1b34f38280f08e13f2b195c661c202834cbc3b1 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 822a0ff2a479845adcdd40a1a7b1734a56e05818 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width