MCPViewerScreen(
self,
server_info: list[MCPServerInfo],
*,
connecting: bool = FalseModalScreen[str | None]| 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 |
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 for an unauthenticated server, 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 an in-TUI OAuth login when the user activates an
unauthenticated 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.
True when a deferred MCP login is queued
and a restart will pick it up. Surfaces the Ctrl+R
reconnect hint in the footer; the keybind itself is a
no-op when this is False.
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.