| Name | Type | Description |
|---|---|---|
server_info* | list[MCPServerInfo] | List of MCP server metadata to display. |
connecting | bool | Default: FalseWhen |
pending_reconnect | bool | Default: False
|
on_toggle_disable | Callable[[str], Awaitable[None]] | None | Default: None |
on_close | Callable[[], bool] | None | Default: None |
Modal viewer for active MCP servers and their tools.
Displays servers grouped by name with transport type and tool count. Navigate with arrow keys, Enter to expand/collapse tool descriptions, start in-app OAuth login or re-authentication, or inspect a failed server. Ctrl+R requests a reconnect, F2 on a server header toggles its disabled state, and Escape closes the modal.
Dismisses with None when closed without action, the server name to
drive in-TUI OAuth when the user activates a login-capable server header,
or MCP_VIEWER_RECONNECT_REQUEST for a reconnect. The disable/enable
toggle (F2) is handled in-place via the on_toggle_disable callback so
the screen never tears down — see the constructor.
Async callback invoked with the selected
server's name when the user presses F2 on a header row.
The callback persists the new disabled state and is
expected to call refresh_server_info on this screen so
the user sees the updated status without a screen swap.
When None, F2 is a no-op.
Callback invoked before Escape dismisses the viewer.
Return True when the callback replaced the viewer with a
follow-up screen and dismissal should be skipped. None
keeps the normal close behavior.