# settings_ui: Fix MCP server toggle not updating in UI \(\#60552\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/604221dbc7581a6f7272045914e7608a2dec7931)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 604221dbc7581a6f7272045914e7608a2dec7931

Requested commit: 604221dbc7581a6f7272045914e7608a2dec7931

Commit: 604221dbc7581a6f7272045914e7608a2dec7931

Tree: 39521abe4197f1541b370b3bfbd41341a9077c6e

Author: counterfactual5

Committer: GitHub

## Message

```
settings_ui: Fix MCP server toggle not updating in UI (#60552)

Fixes an issue where toggling an MCP server on/off in Settings → AI →
MCP Servers does not update the toggle state in the UI immediately.

## Root Cause

There were two issues:

1. `ContextServerStore::update_server_state()` and `remove_server()`
emitted `ServerStatusChangedEvent` but did not call `cx.notify()`, so
Settings UI observers were not informed to re-render.

2. `render_toggle_switch()` was bound to `is_running` (runtime status)
instead of `is_enabled` (settings state).

## Solution

- Add `cx.notify()` in both methods after emitting the status event.
- Change toggle to read `settings.enabled()` and rename parameter from
`is_running` to `is_enabled`.

## Testing

- `cargo check -p settings_ui -p project` passes.
- `cargo fmt --check` passes.
- Manual verification: open Settings → AI → MCP Servers, toggle a
server, observe immediate UI update.

---

Release Notes:

- Fixed MCP server toggle not updating immediately in Settings UI.

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
```

## Parents

- [ad6773d433e0e5baff3fee7e65ab42640389c776](https://git.cafe/gitcafe/zed/commit/ad6773d433e0e5baff3fee7e65ab42640389c776?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/604221dbc7581a6f7272045914e7608a2dec7931?format=markdown)
