Skip to content

agent: Fix disabled MCP servers disappearing from UI after restart#47758

Merged
MrSubidubi merged 4 commits intozed-industries:mainfrom
oliverbarnes:fix-disappearing-mcp-servers
Feb 8, 2026
Merged

agent: Fix disabled MCP servers disappearing from UI after restart#47758
MrSubidubi merged 4 commits intozed-industries:mainfrom
oliverbarnes:fix-disappearing-mcp-servers

Conversation

@oliverbarnes
Copy link
Contributor

Closes #42888

Release Notes:

  • Fixed disabled MCP servers disappearing from UI after restart

When an MCP server is disabled in settings, it was never added to the
`servers` HashMap on startup because `maintain_servers` only starts
enabled servers. The `server_ids()` method only returned IDs from
`servers` and the extension registry, so disabled servers configured
in settings were not shown in the Agent Configuration panel.

Include server IDs from `context_server_settings` in the `server_ids()`
result so that all configured servers appear in the UI regardless of
their enabled state.
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 27, 2026
@SomeoneToIgnore SomeoneToIgnore added the area:ai Improvement related to Agent Panel, Edit Prediction, Copilot, or other AI features label Jan 28, 2026
@oliverbarnes oliverbarnes changed the title Fix disabled MCP servers disappearing from UI after restart agent: Fix disabled MCP servers disappearing from UI after restart Jan 28, 2026
Copy link
Member

@MrSubidubi MrSubidubi left a comment

Choose a reason for hiding this comment

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

Nice find and good fix! I quickly hopped on and changed this so that we do not need to deduplicate the IDs and sort the list each frame but instead only do this one as well as some refactors I stumbled across when looking into this. DIdn't want to bother you with this after the wait here.

Aside from that, thanks a lot for adding a good test for this! Made it that much easier to repro and validate.

Thanks!

@MrSubidubi MrSubidubi self-assigned this Feb 8, 2026
@MrSubidubi MrSubidubi merged commit a96d777 into zed-industries:main Feb 8, 2026
27 checks passed
baldwindavid added a commit to baldwindavid/zed that referenced this pull request Feb 9, 2026
* main: (57 commits)
  agent: Fix disabled MCP servers disappearing from UI after restart (zed-industries#47758)
  Update Rust crate git2 to v0.20.4 [SECURITY] (zed-industries#48400)
  Update Rust crate time to v0.3.47 [SECURITY] (zed-industries#48514)
  gpui: Reset `external_files_dragged` after successful drag-drop on macOS (zed-industries#48727)
  language: Return early if no grammars are added (zed-industries#48685)
  Properly handle multi-char folds (zed-industries#48721)
  collab: Proxy `GET /extensions` to Cloud (zed-industries#48717)
  git: Fix a potential misalignment in the side-by-side diff (zed-industries#48690)
  Move extension API DTOs into `cloud_api_types` (zed-industries#48689)
  git: Add a setting for the default view mode of `SplittableEditor` (zed-industries#48440)
  Use proper settings name for semantic tokens' settings UI (zed-industries#48686)
  gpui: Fix restarting panicking due to double borrows on windows (zed-industries#48667)
  Strip broken thinking blocks from Anthropic requests (zed-industries#48548)
  keymap_editor: Add `alt-l` keybinding for cycling favorite models (zed-industries#48390)
  Only raise Windows timer resolution while blocking with timeout (zed-industries#48379)
  editor: Propagate `buffer_font_features` to signatureHelp popover (zed-industries#48653)
  Add configurable LSP timeout setting (zed-industries#44745)
  editor: Use buffer_font for folds and change foreground color (zed-industries#48652)
  lsp: Update root_path for compatibility with language servers (zed-industries#48587)
  Fix panic with LSP folds on disappearing excerpts (zed-industries#48649)
  ...
@oliverbarnes oliverbarnes deleted the fix-disappearing-mcp-servers branch February 9, 2026 10:56
@oliverbarnes
Copy link
Contributor Author

Pleasure!

I quickly hopped on and changed this so that we do not need to deduplicate the IDs and sort the list each frame but instead only do this one as well as some refactors I stumbled across when looking into this. DIdn't want to bother you with this after the wait here.

Makes sense, I completely missed that the sorting happened for every frame - I'm still internalizing the gpui rendering lifecycle (I come from backend dev). Thanks for going ahead and optimizing!

naaiyy added a commit to Glass-HQ/Glass that referenced this pull request Feb 16, 2026
Key changes:
- Side-by-side diff UX improvements (zed-industries#48821) - major diff view polish
- Display map refactoring - large cleanup of display_map.rs (~1000 line reduction)
- Split editor growth (zed-industries#48753) - significant expansion of split.rs
- Multi-char folds fix (zed-industries#48721)
- New multi workspace (zed-industries#47795, then reverted zed-industries#48776)
- Default view mode setting for SplittableEditor (zed-industries#48440)
- macOS drag-drop fix: reset external_files_dragged (zed-industries#48727)
- Windows: OS caption/buttons for custom titlebar (zed-industries#48330)
- Windows timer resolution guard (zed-industries#48379)
- Bedrock Claude Opus 4.6 model (zed-industries#48525)
- MCP servers: fix disabled servers disappearing after restart (zed-industries#47758)
- Shell command parser extracted to shared crate (zed-industries#48660)
- Format-on-save for streaming edit file tool (zed-industries#48663)
- Agent: insert images at cursor position (zed-industries#48779)
- Project panel: improved file/folder creation in folded paths (zed-industries#46750)
- Folding ranges panic fix (zed-industries#48809)
- REPL: shutdown all kernels on app quit (zed-industries#48760)
- Extension CI improvements
- Security updates: time v0.3.47, git2 v0.20.4

Conflict resolution:
- collab (Cargo.toml, extensions API, db, tests): deleted
- GPUI (8 files): deleted from Glass (handled in Obsydian-HQ/gpui)
- Cargo.lock: took upstream

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ai Improvement related to Agent Panel, Edit Prediction, Copilot, or other AI features cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Manually added MCP servers disappear after disabling them and restarting

3 participants