neovim vim_* tools fail to register when Claude Code launches before the bridge upstream is ready
#2
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Claude Code attaches MCP servers once, at launch, and does not retry a failed handshake. The plugin's
neovimMCP server points at themcp-session-pool, which can only answerinitializeafter it has pinned its upstream session tonvim-mcp-bridge.If Claude Code launches in the few-second window after a nvim restart but before
nvim-mcp-bridge.servicereachesactive, the pool returns 502 for the handshake and thevim_*tools never register for that session. Only a full Claude Code restart recovers it.Observed timeline (one occurrence): nvim restart 14:33:02 → Claude Code session launch 14:33:05 →
nvim-mcp-bridge.serviceactive 14:33:09. The session attached MCP ~4s before the upstream finished coming up.Proposed fix (lands in
mcp-session-pool, theservers/emmettrepo, not this plugin's code): on a clientinitialize, the pool should bounded-retry establishing its upstream session (~20s) before giving up, instead of failing fast — so a launch a few seconds ahead of the bridge still registers cleanly. Other request types keep failing fast (so a genuinely-down nvim does not reintroduce hung tool calls).Fixed in
mcp-session-pool(servers/emmett repo) — deployed 2026-05-21.A client
initializenow blocks-with-retry up toPROXY_INIT_PIN_TIMEOUT(default 20s) waiting for the upstream session to become establishable, instead of failing fast with a 502. A Claude Code launch a few seconds ahead of thenvim-mcp-bridgeupstream now still registers thevim_*tools cleanly. All other request types still fail fast, so a genuinely-down nvim does not reintroduce hung tool calls.Implementation:
_ensure_pinned_blocking()inmcp_session_pool.py, used on theis_initpath ofdo_POST.