github / github/copilot-cli

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

未關閉
#1,385 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
area:mcp
主要語言
Shell
星號
11.2k
分支
1.9k
平均合併
14 小時 16 分鐘
30 天內合併 PR
6

描述

#### 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

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。