github / github/copilot-cli

Bug: Copilot CLI ignores explicit MCP command and rewrites Python MCP to pipx

Đang mở
#1,385 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:mcp
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ả

#### Description

Copilot CLI ignores an explicitly configured MCP `command` and `args` in `mcp.json` and rewrites a Python stdio MCP server into a `pipx run` invocation.

Even though the configuration clearly specifies that the MCP server should be started using `python -m `, Copilot CLI still detects the dotted module name and applies a heuristic that treats it as a pipx-installable CLI. As a result, the CLI overrides the user’s configuration and attempts to run the MCP server using `pipx run`, which breaks local, in-repo MCP servers that are not published as pipx packages.

---

#### MCP Configuration

```json
{
"mcpServers": {
"example-mcp": {
"type": "stdio",
"command": "python",
"args": ["-m", "example_mcp_server"],
"tools": ["*"]
}
}
}
```

#### Copilot Logs
```
2026-02-10T13:32:04.318Z [ERROR] Converting Python module: example_mcp.server to pipx command
2026-02-10T13:32:04.319Z [ERROR] Starting MCP client for example_mcp with
command: pipx
args: run example_mcp.server
cwd: undefined
2026-02-10T13:32:04.319Z [ERROR] Starting MCP client for example_mcp with command: pipx and args: run example_mcp.server
2026-02-10T13:32:04.319Z [ERROR] Creating MCP client for example_mcp...
2026-02-10T13:32:04.322Z [ERROR] Connecting MCP client for example_mcp...
2026-02-10T13:32:04.344Z [INFO] No update needed, current version is 0.0.406, fetched latest release is v0.0.406
2026-02-10T13:32:04.363Z [ERROR] [mcp server example_mcp stderr] 'pipx' is not recognized as an internal or external command,
operable program or batch file.

2026-02-10T13:32:04.366Z [ERROR] MCP transport for example_mcp closed
2026-02-10T13:32:04.367Z [ERROR] Failed to start MCP client for example_mcp: McpError: MCP error -32000: Connection closed
```

### Workaround
`"command": "C:\\Python314\\python.exe"`

I have to mention the full path to python.exe

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

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

Đánh giá

Issue này chưa được đánh giá.

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.