refresh_server_info(
self,
server_info: list[MCPServerInfo],
*,
pending_reconnect: bool | None | Name | Type | Description |
|---|---|---|
server_info* | list[MCPServerInfo] | Refreshed server metadata. |
pending_reconnect | bool | None | Default: NoneWhen provided, updates the footer's
reconnect hint. |
select_server | str | None | Default: None |
Replace the displayed server list; typically after server startup.
Rebuilds the modal body in place so a user who opened /mcp before
tools finished loading sees them appear without closing/reopening.
Also used by the in-place disable toggle so the cursor lands back
on the same server header after F2.
The active filter is cleared on refresh: the connecting placeholder
suppresses the filter input, so _query cannot be non-empty when
this is called. Resetting it also prevents the programmatic
Input(value=...) mount in _mount_body from triggering a
redundant Input.Changed repopulation.
This is async because body.remove_children() must complete before
_mount_body re-inserts an Input(id="mcp-filter") — Textual
defers child removal, so a non-awaited remove leaves the old
widget attached and the mount raises DuplicateIds.
When provided, after the rebuild, move the
cursor to the header row whose server.name matches.
Unmatched names are silently ignored (the rebuild keeps
the default index-0 selection).