Read-only MCP server and tool viewer modal.
Sentinel returned by MCPViewerScreen.dismiss to request a reconnect.
The null-byte prefix makes the value un-collidable with any valid MCP
server name returned by MCPServerInfo.name, so callers can branch on
this exact string without weakening the existing server-name dispatch.
Textual Binding key for the in-viewer reconnect action.
Kept as a module constant so the footer hint and the help-text rendered in server headers stay in sync with the bound chord.
Display label for MCP_RECONNECT_KEY.
Shown in the footer hint chip and inline header prompts so the user sees the same chord text the binding will fire on.
Copy text to the system clipboard.
Neutralize control characters and deceptive Unicode in untrusted text.
Untrusted strings (MCP server errors, config-file contents, tool output)
can carry ANSI escape sequences, other control characters, or invisible
Unicode that corrupts the terminal, breaks out of a layout, or injects fake
lines into logs and prompts. This first removes the invisible/bidi code
points flagged by strip_dangerous_unicode, then replaces every remaining
Unicode "Other" (control/format) character with a space.
A selectable tool item in the MCP viewer.
Read-only modal for a failed MCP server's error details.
A selectable server-header row in the MCP viewer.
Cursor-selectable so users can navigate to every server — even those
in unauthenticated or error states which have no tool rows by the
MCPServerInfo invariant — and activate login, re-authentication, or
error details. Server headers are not expandable.
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.