Skip to content

feat(THU-618): support editing MCP servers in settings#1008

Open
raivieiraadriano92 wants to merge 3 commits into
mainfrom
raivieiraadriano92/thu-618-allow-editing-mcp-server-config-after-adding
Open

feat(THU-618): support editing MCP servers in settings#1008
raivieiraadriano92 wants to merge 3 commits into
mainfrom
raivieiraadriano92/thu-618-allow-editing-mcp-server-config-after-adding

Conversation

@raivieiraadriano92

@raivieiraadriano92 raivieiraadriano92 commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

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.

  • New updateMcpServer DAL helper + tests.
  • useAddServerForm reused 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 useAddServerForm edit 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 in updateMcpServerWithCredentials.

DAL gains updateMcpServer / updateMcpServerWithCredentials (row patch + optional credential replace/delete/unchanged). MCPProvider replaces updateServerStatus with updateServer, which patches the in-memory row and disconnects, connects, or reconnects so URL/type/credential changes actually redial. useMcpSync propagates DB row diffs through updateServer, not only enable toggles.

Reviewed by Cursor Bugbot for commit 191cfad. Bugbot is set up for automated code reviews on this repo. Configure here.

@raivieiraadriano92 raivieiraadriano92 self-assigned this Jun 18, 2026
@raivieiraadriano92 raivieiraadriano92 marked this pull request as ready for review June 18, 2026 21:53
@github-actions

Copy link
Copy Markdown

Semgrep Security Scan

No security issues found.

Comment thread src/settings/mcp-servers.tsx
Comment thread src/hooks/use-add-server-form.ts
@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown

Preview environment deployed 🚀

Service URL
Marketing / blog / docs https://thunderbolt-pr-1008.preview.thunderbolt.io
App https://app-pr-1008.preview.thunderbolt.io
API https://api-pr-1008.preview.thunderbolt.io
Keycloak https://auth-pr-1008.preview.thunderbolt.io
PowerSync https://powersync-pr-1008.preview.thunderbolt.io

Stack: preview-pr-1008 · Commit: 191cfadbb53529b250e25227482b7af1fbd5ffb0

Auto-destroys on PR close/merge. Login via the bundled Keycloak realm — demo@thunderbolt.io / demo by default.

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown

PR Metrics

Metric Value
Lines changed (prod code) +326 / -54
JS bundle size (gzipped) 🟢 682.3 KB → 682.2 KB (-64 B, -0.0%)
Test coverage 🟢 78.09% → 78.15% (+0.1%)
Performance (preview) Preview not ready — Render deploy may have timed out
Accessibility
Best Practices
SEO

Updated Fri, 19 Jun 2026 12:59:33 GMT · run #1969

Comment thread src/settings/mcp-servers.tsx
Comment thread src/settings/mcp-servers.tsx Outdated
@raivieiraadriano92 raivieiraadriano92 changed the title feat: support editing MCP servers in settings feat(THU-618): support editing MCP servers in settings Jun 19, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread src/lib/mcp-provider.tsx
}

if (connectsInFlight.current.has(server.id) && existing.url === server.url && existing.type === server.type) {
return

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 191cfad. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant