# MCPDisableReconnectPromptScreen

> **Class** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/tui/widgets/mcp_reconnect/MCPDisableReconnectPromptScreen)

Modal asking whether to reconnect after `/mcp` disable/enable toggles.

Shown when the user closes the `/mcp` viewer with pending `F2`
disable-state changes but without pressing `Ctrl+R`, so the toggles
do not silently sit unapplied. Dismisses with `"reconnect"` when the
user accepts the restart and `"later"` when the user defers; Esc is
treated as "later".

## Signature

```python
MCPDisableReconnectPromptScreen(
    self,
    server_names: Sequence[str],
    *,
    on_choice: Callable[[ReconnectChoice], None] | None = None,
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `server_names` | `Sequence[str]` | Yes | Servers whose disabled state changed and are waiting on a reconnect. Must be non-empty — the caller only opens this modal when at least one toggle is pending, and the body would otherwise name no server. |
| `on_choice` | `Callable[[ReconnectChoice], None] \| None` | No | Optional callback invoked for an explicit reconnect or defer choice before the screen dismisses. This supports an atomic `switch_screen` transition from the MCP viewer, whose original result callback is removed by the switch. (default: `None`) |

## Extends

- `_ReconnectPromptScreen`

## Constructors

```python
__init__(
    self,
    server_names: Sequence[str],
    *,
    on_choice: Callable[[ReconnectChoice], None] | None = None,
) -> None
```

| Name | Type |
|------|------|
| `server_names` | `Sequence[str]` |
| `on_choice` | `Callable[[ReconnectChoice], None] \| None` |


## Methods

- [`action_reconnect()`](https://reference.langchain.com/python/deepagents-code/tui/widgets/mcp_reconnect/MCPDisableReconnectPromptScreen/action_reconnect)
- [`action_later()`](https://reference.langchain.com/python/deepagents-code/tui/widgets/mcp_reconnect/MCPDisableReconnectPromptScreen/action_later)

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/4bfa52000ef65ac623d8ada0cb67f67cbdd663ea/libs/code/deepagents_code/tui/widgets/mcp_reconnect.py#L171)