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 摘要。