connect
Connect to a running Neovim instance via Unix socket or TCP. Auto-connects to a single instance or lists available ones for selection. Required before using other Neovim tools.
Instructions
Connect to a running Neovim instance over its Unix socket or TCP address.
Call this before any other tool if the agent is not yet connected. Connection is persistent for the session; you only need to call it once unless you want to switch instances.
Called with no arguments: auto-connects when exactly one instance is running; returns a list of instances when multiple are found.
Optional selection (provide at most one):
index: pick from the listed instances (1-based).
socket_path: connect directly to a known Unix socket or host:port.
terminal_pid: find the Neovim instance whose process tree contains this PID (useful when Neovim runs inside a specific terminal).
Returns {connected, cwd, file} on success, or {error} with details on failure (e.g. no instances found, connection timeout, bad index).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| socket_path | No | ||
| terminal_pid | No | ||
| index | No |