# MCPServerHeaderItem

> **Class** in `deepagents_code`

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

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 read the full status / error text on
the line. Not expandable: `Enter` and `Ctrl+E` are no-ops here.

## Signature

```python
MCPServerHeaderItem(
    self,
    server: MCPServerInfo,
    indicator_glyph: str,
    indicator_color: str,
    visible_tools: tuple[MCPToolInfo, ...],
    glyphs: Glyphs,
    index: int,
    *,
    classes: str = '',
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `server` | `MCPServerInfo` | Yes | Server metadata used to re-render content on selection state changes. |
| `indicator_glyph` | `str` | Yes | Pre-computed status glyph character. |
| `indicator_color` | `str` | Yes | Pre-computed status hex color string. |
| `visible_tools` | `tuple[MCPToolInfo, ...]` | Yes | Filtered tool tuple — used for the count label. |
| `glyphs` | `Glyphs` | Yes | Active glyph table. |
| `index` | `int` | Yes | Flat row index inside `MCPViewerScreen._row_widgets`. |
| `classes` | `str` | No | CSS classes — should include `mcp-server-header`, and optionally `mcp-header-selected` for the initial selection. (default: `''`) |

## Extends

- `Static`

## Constructors

```python
__init__(
    self,
    server: MCPServerInfo,
    indicator_glyph: str,
    indicator_color: str,
    visible_tools: tuple[MCPToolInfo, ...],
    glyphs: Glyphs,
    index: int,
    *,
    classes: str = '',
) -> None
```

| Name | Type |
|------|------|
| `server` | `MCPServerInfo` |
| `indicator_glyph` | `str` |
| `indicator_color` | `str` |
| `visible_tools` | `tuple[MCPToolInfo, ...]` |
| `glyphs` | `Glyphs` |
| `index` | `int` |
| `classes` | `str` |


## Properties

- `index`
- `server`

## Methods

- [`set_selected()`](https://reference.langchain.com/python/deepagents-code/widgets/mcp_viewer/MCPServerHeaderItem/set_selected)
- [`refresh_from_server()`](https://reference.langchain.com/python/deepagents-code/widgets/mcp_viewer/MCPServerHeaderItem/refresh_from_server)
- [`on_click()`](https://reference.langchain.com/python/deepagents-code/widgets/mcp_viewer/MCPServerHeaderItem/on_click)

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/0412009c5441bef8d75a427e1da8909e33ab5b56/libs/code/deepagents_code/widgets/mcp_viewer.py#L619)