init_viewer
Set up a napari viewer or detect available viewers, with options for window title, dimensions, and connection port.
Instructions
Create or return the napari viewer, with viewer detection.
When detect_only=True, reports available viewers (local and
external) without creating or modifying anything.
Parameters
title : str, optional Optional window title (only for local viewer). width : int, optional Optional initial canvas width (only for local viewer). height : int, optional Optional initial canvas height (only for local viewer). port : int, optional If provided, attempt to connect to an external napari-mcp bridge on this port (default is taken from NAPARI_MCP_BRIDGE_PORT or 9999). detect_only : bool, default=False If True, only detect available viewers without initialising.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | No | ||
| width | No | ||
| height | No | ||
| port | No | ||
| detect_only | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||