-
Notifications
You must be signed in to change notification settings - Fork 187
Description
Before opening, please confirm:
Operating System
macOS
Kiro Version
kiro-cli 1.28.2
Bug Description
kiro-cli should log spawned MCP server command/args at trace level
Summary
When an MCP server fails to initialize, kiro-cli provides no information about what command it actually spawned, even at KIRO_LOG_LEVEL=trace. The only error is:
ErrorCode(-32002), "connection closed: initialize response"
from chat_cli::cli::chat::tool_manager (line 1959).
This made a simple misconfiguration (wrong Node version) take ~30 minutes to diagnose.
Steps to Reproduce
- Configure an MCP server in
~/.kiro/settings/mcp.jsonwith correct settings - Have a custom agent in
~/.kiro/agents/with its ownmcpServersblock pointing to a wrong Node version - Set
chat.defaultAgentto that agent in~/.kiro/settings/cli.json - Run
KIRO_LOG_LEVEL=trace kiro-cli chat - MCP server fails with
-32002: connection closed: initialize response
Expected Behavior
Expected Behavior
At trace level, kiro-cli should log:
- The exact command, args, and env used to spawn each MCP server
- Which config file the MCP server definition came from (agent config vs mcp.json)
- Any stderr output from the spawned process before it dies
Actual Behavior
Trace logs show zero information about the spawned command. No way to tell which config was used or what binary was invoked.
Conversation ID
No response
Additional Context
Root Cause of what I was trying to diagnose for context (this is not the root cause for your bug report!)
The agent config (~/.kiro/agents/*.json) overrides ~/.kiro/settings/mcp.json when an agent is active. The agent config had the wrong Node path (v20 instead of v22), causing the MCP server to exit immediately with a version check error. Without spawn logging, this was invisible.
Environment
- kiro-cli (latest as of 2026-03-27)
- macOS
- Node v22.22.2
- aws-outlook-mcp v0.3.1