feat(THU-618): support editing MCP servers in settings#1008
feat(THU-618): support editing MCP servers in settings#1008raivieiraadriano92 wants to merge 3 commits into
Conversation
Semgrep Security ScanNo security issues found. |
|
Preview environment deployed 🚀
Stack: Auto-destroys on PR close/merge. Login via the bundled Keycloak realm — |
PR Metrics
Updated Fri, 19 Jun 2026 12:59:33 GMT · run #1969 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 191cfad. Configure here.
| } | ||
|
|
||
| if (connectsInFlight.current.has(server.id) && existing.url === server.url && existing.type === server.type) { | ||
| return |
There was a problem hiding this comment.
In-flight connect skips credential refresh
Low Severity
updateServer returns without calling reconnectServer when a connect is already in flight for the same URL and transport. Saving an edit that only updates credentials (same endpoint) during that window updates mcp_secrets but leaves the live client using the credentials read at the start of the original connect.
Reviewed by Cursor Bugbot for commit 191cfad. Configure here.


Adds an Edit action to the MCP servers settings page so users can update an existing server's config (name, URL, headers, credentials) without deleting and re-adding it.
updateMcpServerDAL helper + tests.useAddServerFormreused for both add and edit; the dialog opens prefilled when editing.Fixes THU-618.
Note
Medium Risk
Touches live MCP connection lifecycle (reconnect on edit), credential storage semantics, and OAuth-vs-bearer edit rules; well covered by new tests but mis-sync could leave stale clients or wipe credentials.
Overview
Adds in-place editing for MCP servers on the settings page so users can change name, URL, transport, and bearer credentials without delete-and-re-add.
The shared add/edit dialog is driven by
useAddServerFormedit mode (openEditDialog,hasConnectionEdits): metadata-only saves skip re-probing; connection field changes still require a successful test. OAuth tokens are not shown in the token field; clearing bearer vs leaving OAuth on rename is handled inupdateMcpServerWithCredentials.DAL gains
updateMcpServer/updateMcpServerWithCredentials(row patch + optional credential replace/delete/unchanged).MCPProviderreplacesupdateServerStatuswithupdateServer, which patches the in-memory row and disconnects, connects, or reconnects so URL/type/credential changes actually redial.useMcpSyncpropagates DB row diffs throughupdateServer, not only enable toggles.Reviewed by Cursor Bugbot for commit 191cfad. Bugbot is set up for automated code reviews on this repo. Configure here.