#12680·Cline

cline-hub: editing an MCP server drops metadata, oauth, and other non-dialog fields

Author: minh2416294Created Jul 29, 2026Updated Sep 29, 2026
LabelsstaleCLIbeta

Cline Surface

CLI

Cline Version

3.0.47

Beta version

  • I am using a beta version of Cline

What happened?

Cline Surface

CLI

Cline Version

main (912c4678)

What happened?

Editing an MCP server in the cline-hub UI silently deletes any field the edit dialog does not own. upsertMcpServer in apps/cline-hub/src/server/mcp.ts rebuilds the entry from dialog fields and replaces the whole record:

servers[name] = next

so a server stored with metadata, oauth or autoApprove comes back without them. The oauth block holds the client registration and tokens, so losing it silently de-authenticates a server the user already signed into, and metadata is read back by readMcpServersResponse, so it is not dead data either.

The same file already has the right pattern: setMcpServerDisabled merges instead of replacing (servers[name] = { ...current, disabled }). upsertMcpServer just does not.

@dominiccooney flagged this in #12546:

Known pre-existing limitation (not introduced here): the cline-hub upsertMcpServer dialog rebuilds server entries from dialog fields, so editing a server there drops non-dialog fields including timeout same as metadata/oauth today. Worth a separate issue.

Filing separately as suggested. It also means the per-server timeout from #12546 will be wiped by a hub edit once that lands.

Two related things I hit while confirming this:

  • Entries written by the VS Code extension are flat (addRemoteServer writes {url, type, disabled, autoApprove} with no nested transport). readMcpServersResponse falls back per field, so a naive merge would leave the old flat command/args/env next to the new nested transport and the dialog would write those stale values back on the following save.
  • input.metadata is never read by upsertMcpServer, so the dialog's Metadata box is a no-op.

Steps to reproduce

  1. Add an MCP server, then hand-edit cline_mcp_settings.json to give it a metadata object (an OAuth server will also have an oauth block).
  2. Open the server in the cline-hub UI, change the command, save.
  3. Re-read cline_mcp_settings.json: metadata and oauth are gone.

Expected behavior

An edit should update only the fields the dialog owns and leave everything else intact.

Steps to reproduce

  1. Add an MCP server, then hand-edit cline_mcp_settings.json to give it a metadata object. An OAuth server will also have an oauth block.
  2. Open that server in the cline-hub UI, change the command, and save.
  3. Re-read cline_mcp_settings.json. metadata and oauth are gone.

Provider/Model

N/A - not model dependent

IDE / CLI Diagnostics and System Information

N/A - code-level defect, confirmed against main @ 912c4678

One note on the banner: the "must be reproducible using Claude Sonnet 4.5" rule targets model-behaviour bugs. This one never reaches a model, which is why I put an explicit "this is model independent" line in the body, it pre-empts a triage bot or maintainer bouncing it for a missing model repro.