Describe the bug
Summary
When running single-command prompts (non-interactive / child sessions), Copilot CLI appears to execute the prompt before MCP servers have finished connecting, causing the tool schema to be empty or incomplete on the first turn.
This results in:
MCP tools not being available to the model
Immediate failures or incorrect behavior
Intermittent reproducibility (timing-dependent)
Observations / Evidence
This behavior correlates with MCP startup latency (~1–2s range observed)
CLI seems to:
Start session
Build tool schema
Send prompt
Only then finish MCP connection asynchronously
Internal observation:
Tool schema is constructed before MCP client connection completes, so the model cannot see tools on first turn [Plugin Prototyping | Teams]
Behavior is significantly more visible in:
non-interactive mode (copilot "...")
child sessions (spawned by skills / eval frameworks)
Impact
Breaks reliability of MCP-based workflows
Makes automation (evals, scripts, CI usage) flaky
Forces workarounds like:
artificial delays
warm-up prompts
re-running commands
Workarounds (temporary)
Run an initial “no-op” prompt before actual command
Add delay before issuing prompt (~2s)
Avoid spawning new sessions; reuse a warmed session
Pre-run MCP setup outside of Copilot CLI process
Additional Context
This appears related to async MCP connection lifecycle + lack of readiness barrier
CLI currently behaves as if tools exist only after MCP fully loads, with no blocking initialization step [github.com]
Similar instability in MCP connectivity has been reported in recent CLI versions (timing / connection issues) [github.com]
Suggested Fix
Introduce a synchronization / readiness barrier before prompt execution:
Block until:
MCP servers are connected, OR
a configurable timeout is reached
Alternatively:
allow "lazy tool schema refresh" after MCP connects
or expose an --await-mcp / --wait-for-tools flag
Environment
Copilot CLI version: GitHub Copilot CLI 1.0.48
OS: Windows 11
MCP server type(s): http
Repro frequency: high frequency as of 5/14/2026
Affected version
GitHub Copilot CLI 1.0.48
Steps to reproduce the behavior
Repro Steps
Configure one or more MCP servers (local or remote) in ~/.copilot/mcp-config.json
Run a single-command prompt, for example:
Shellcopilot "run "Show more lines
or trigger via:
evaluation scripts
skills that spawn a child session
Observe behavior on first execution
Expected behavior
Expected Behavior
Copilot CLI should wait until MCP servers are fully connected and tools are registered before:
building the tool schema
sending the prompt to the model
MCP tools should be consistently available on the first turn
Actual Behavior
CLI begins prompt execution before MCP initialization completes
The LLM receives a tool schema that:
contains no MCP tools or only partial set
Additional context
Subsequent runs or retries sometimes succeed (after MCP finishes connecting)
Describe the bug
Summary
When running single-command prompts (non-interactive / child sessions), Copilot CLI appears to execute the prompt before MCP servers have finished connecting, causing the tool schema to be empty or incomplete on the first turn.
This results in:
MCP tools not being available to the model
Immediate failures or incorrect behavior
Intermittent reproducibility (timing-dependent)
Observations / Evidence
This behavior correlates with MCP startup latency (~1–2s range observed)
CLI seems to:
Start session
Build tool schema
Send prompt
Only then finish MCP connection asynchronously
Internal observation:
Tool schema is constructed before MCP client connection completes, so the model cannot see tools on first turn [Plugin Prototyping | Teams]
Behavior is significantly more visible in:
non-interactive mode (copilot "...")
child sessions (spawned by skills / eval frameworks)
Impact
Breaks reliability of MCP-based workflows
Makes automation (evals, scripts, CI usage) flaky
Forces workarounds like:
artificial delays
warm-up prompts
re-running commands
Workarounds (temporary)
Run an initial “no-op” prompt before actual command
Add delay before issuing prompt (~2s)
Avoid spawning new sessions; reuse a warmed session
Pre-run MCP setup outside of Copilot CLI process
Additional Context
This appears related to async MCP connection lifecycle + lack of readiness barrier
CLI currently behaves as if tools exist only after MCP fully loads, with no blocking initialization step [github.com]
Similar instability in MCP connectivity has been reported in recent CLI versions (timing / connection issues) [github.com]
Suggested Fix
Introduce a synchronization / readiness barrier before prompt execution:
Block until:
MCP servers are connected, OR
a configurable timeout is reached
Alternatively:
allow "lazy tool schema refresh" after MCP connects
or expose an --await-mcp / --wait-for-tools flag
Environment
Copilot CLI version: GitHub Copilot CLI 1.0.48
OS: Windows 11
MCP server type(s): http
Repro frequency: high frequency as of 5/14/2026
Affected version
GitHub Copilot CLI 1.0.48
Steps to reproduce the behavior
Repro Steps
Configure one or more MCP servers (local or remote) in ~/.copilot/mcp-config.json
Run a single-command prompt, for example:
Shellcopilot "run "Show more lines
or trigger via:
evaluation scripts
skills that spawn a child session
Observe behavior on first execution
Expected behavior
Expected Behavior
Copilot CLI should wait until MCP servers are fully connected and tools are registered before:
building the tool schema
sending the prompt to the model
MCP tools should be consistently available on the first turn
Actual Behavior
CLI begins prompt execution before MCP initialization completes
The LLM receives a tool schema that:
contains no MCP tools or only partial set
Additional context
Subsequent runs or retries sometimes succeed (after MCP finishes connecting)