copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

Copilot CLI Does Not Respect MCP Timeouts

Open Cobular opened this issue 1 year ago • 10 comments

Describe the bug

I'm writing an MCP server that has a very long wait in its runtime, and this is intended. However, copilot cli always times out:

 ● <some stuff>
 ✗ codebase-analyzer
   MCP error -32001: Request timed out

The mcp-config.json timeout field is not respected:

{
  "mcpServers": {
    "<thing>": {
      "type": "local",
      "command": "node",
      "tools": [
        "*"
      ],
      "args": [
        "C:/Users/juliecover/Code/<whatever>.js"
      ],
      "timeout": 600000
    }
  }
}

I haven't quite timed it but it seems to timeout after about 2 minutes or so.

Affected version

0.0.332 Commit: ace227c

Steps to reproduce the behavior

  1. Setup an STDIO MCP server that takes a long time to return - upwards of 5 minutes.
  2. Configure it in copilot CLI
  3. Have the model call the MCP server

It will time out, even with an extended timeout in the mcp-config.json

Expected behavior

The extended timeout in the mcp-config.json should be respected.

Additional context

This is really messing me up - my 1p builds take way longer than the timeout time, so this is really limiting the usefulness of the CLI for me. Please fix soon! Thanks.

Cobular avatar Oct 02 '25 00:10 Cobular

+1

sewall2025 avatar Oct 11 '25 07:10 sewall2025

I'm working on a fix for this and we should ship it in the next few days. I did want to make you aware in the interm that if you send progress messages from your MCP server while your tool is running, we'll reset our timeout on each progress message we get get, so that's one avenue for a workaround while we work on supporting the timeout parameter here.

ellismg avatar Oct 16 '25 19:10 ellismg

hi @ellismg could you please clarify if something was implemented to fix this, and if yes, what? E.g. we noticed that our tool calls which were allowed to run long (we already re-send progress updates every 30 seconds) are now timing out after 360 s (6 min), was some setting introduced to control this? I didn't find anything in the release notes or docs.

lopuhin avatar Nov 24 '25 15:11 lopuhin

Hi team getting this with Work IQ MCP @ellismg

Image

garrettlondon1 avatar Jan 29 '26 19:01 garrettlondon1

Mind sharing the relevant part of your MCP configuration json file for the workiq server, @garrettlondon1? I assume you're setting an explicit timeout setting in there?

ellismg avatar Jan 29 '26 19:01 ellismg

I assume you're setting an explicit timeout setting in there?

There is a bug where timeout is not respected when the MCP server sends tools/list_changed.

utapyngo avatar Feb 10 '26 04:02 utapyngo

We're hitting the same issue. We have an MCP server with tools that run long-running commands (2-5+ minutes) and consistently get -32001 timeouts in Copilot CLI. The same MCP server works fine in VS Code Copilot Chat, no timeouts. So this appears to be CLI-specific.

Setting "timeout": 600000 in the config doesn't help, as others have reported.

cc @JoshLove-msft

radhgupta avatar Mar 24 '26 22:03 radhgupta

Any news regarding this? It's still the issue. Few weeks ago it worked fine then again it stopped working. In my mcp-config.json i have set "timeout" for one of my mcps that takes longer to execute but it's still not respected.

EDIT: I've figured out i had the same mcp in the global config of mcp-config.json and locally in .vscode/mcp.json and i had to add "timeout" to the mcp.json as well since it's picking that one up instead of the global one as a primary mcp configuration

josippapez avatar Mar 27 '26 06:03 josippapez

The timeout config field for MCP servers is now supported. One common reason it may not take effect is config precedence: if the same server is defined in both a global MCP config and a workspace .vscode/mcp.json, the workspace config takes precedence -- if the active config does not include timeout, the global value won't apply. Setting timeout in whichever config file is actually active for that server should cover the standard case. If you're still seeing timeout issues after verifying your config, please feel free to reopen.

examon avatar Apr 06 '26 20:04 examon

Still hitting this issue with plugins and the latest version of GHCP CLI (1.0.55).

  • I started a session without a workspace, so no mcp.json at workspace level
  • The MCP server is configured to with a 300000ms timeout in the .mcp.json
  • Copilot CLI times out consistently after 60s
Image

The .mcp.json file of my MCP server Image

MauriRojas avatar May 29 '26 20:05 MauriRojas