github / github/copilot-cli

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

Offen
#1,385 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area:mcp
Vorherrschende Sprache
Shell
Sterne
11.2k
Forks
1.9k
Ø Merge
14 Std. 16 Min.
Gemergte PRs (30 T.)
6

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.