github / github/copilot-cli

Tool selection failure with certain MCP servers going from shell -> MCP -> shell -> MCP

Đang mở
#3,113 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:mcp area:tools
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

### Describe the bug

I'm getting into a loop when CLI switches between shell and tool commands with certain MCP servers. CLI seems to be unable to "find" the MCP call it is looking for and reverts back to shell and is unable to proceed. It keeps trying useless shell commands and eventually gives up without actually doing what it was asked.

### Affected version

GitHub Copilot CLI 1.0.41-0

### Steps to reproduce the behavior

1. Set up MCP server (either the Unity official one, or an open source Unity MCP, OR the official Atlassian MCP server (https://mcp.atlassian.com/v1/mcp)
2. Issue the following prompt: "can you try a test with a simple shell command followed a test Confluence request and then back to shell again? repeat this sequence exactly twice"
3. You may have to issue this prompt twice in a row to get the resulting behavior

Another repro is to attempt to use one of these MCP servers with a workflow where it naturally has to switch back and forth between MCP and shell commands.

### Expected behavior

For this prompt, it should issue a shell command (such as Write-Output), followed by a successful MCP call, followed by another similar shell command. It should do this consistently and without extra shell commands.

### Additional context

This:
1) Only seems to happen in Copilot CLI (not VSCode)
2) Only seems to happen with certain (kinds of?) MCP servers (I have tried several different Unity MCP servers as well as the official Atlassian server)
3) Only seems to be an issue when it switches back and forth between shell (aka Powerhsell) commands and unity MCP tool calls.

A possible clue is when it sometimes fails with "I couldn’t get the Unity console output in this turn because the Unity console tool isn’t visible in my callable tool schema right now, even though it appeared in the prior tools-changed notice."

I don't know what's different about certain servers, (maybe a latency thing?) but most of them do not seem to lead to this issue.

Possibly coincidentally, this seemed to start happening around the time of the change to use .mcp.json instead of mcp.json.

I can attach log files if that would be helpful.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start by reproducing the shell-to-MCP-to-shell sequence in Copilot CLI 1.0.41-0 with the Unity or Atlassian MCP server described in the issue. Inspect the CLI's tool-selection and callable-tool schema handling, especially around the transition to .mcp.json; use logs if provided. Done means the requested sequence completes consistently without unnecessary shell commands or missing MCP tools.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
powershell, shell
Lĩnh vực
cli, tooling
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
38/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.