Skip to content

feat(cli, mcp): Show timer while waiting on slow MCP servers - #917

Merged
JeanMertz merged 4 commits into
mainfrom
bug-845
Jul 31, 2026
Merged

feat(cli, mcp): Show timer while waiting on slow MCP servers#917
JeanMertz merged 4 commits into
mainfrom
bug-845

Conversation

@JeanMertz

Copy link
Copy Markdown
Collaborator

MCP servers boot in the background while a query starts, but a query that needs an MCP tool before startup finishes used to wait silently with no feedback. Once the wait passes 4 seconds, the CLI now prints a single updating line naming the pending servers, e.g. ⏱ Starting MCP server bookworm… 4.3s, so a slow server doesn't look like a hang. The line is cleared once every server has started or a required one fails.

The indicator is configurable under [style.mcp_startup]: show disables it, delay_secs controls how long a server can take before the line appears (default 4s, set to 0 to show immediately), and interval_ms controls the update rate.

Each MCP server also gets its own configurable startup timeout via startup_timeout_secs (default 60s), replacing the previous hardcoded 1-minute timeout. Servers that legitimately take longer, such as ones that compile from source on spawn, can now raise this per server. The resulting InitializeTimeout error reports the configured deadline and includes the captured stderr tail, which usually points at the actual problem.

Closes: #845

MCP servers boot in the background while a query starts, but a query
that needs an MCP tool before startup finishes used to wait silently
with no feedback. Once the wait passes 4 seconds, the CLI now prints a
single updating line naming the pending servers, e.g. `⏱ Starting MCP
server bookworm… 4.3s`, so a slow server doesn't look like a hang. The
line is cleared once every server has started or a required one fails.

The indicator is configurable under `[style.mcp_startup]`: `show`
disables it, `delay_secs` controls how long a server can take before
the line appears (default 4s, set to 0 to show immediately), and
`interval_ms` controls the update rate.

Each MCP server also gets its own configurable startup timeout via
`startup_timeout_secs` (default 60s), replacing the previous hardcoded
1-minute timeout. Servers that legitimately take longer, such as ones
that compile from source on spawn, can now raise this per server. The
resulting `InitializeTimeout` error reports the configured deadline
and includes the captured stderr tail, which usually points at the
actual problem.

Closes: #845
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz
JeanMertz merged commit 0966a3b into main Jul 31, 2026
16 checks passed
@JeanMertz
JeanMertz deleted the bug-845 branch July 31, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

failed session start with cryptic error / bookworm

1 participant