github / github/copilot-cli

MCP Server 'Command to run' strips backslashes from Windows paths

Aperta
#2,786 0 commenti 1 reazione 0 assegnatari Vedi su GitHub
area:configuration area:mcp area:platform-windows
Lingua principale
Shell
Stelle
11.2k
Fork
1.9k
Merge medio
14h 16m
PR unite (30g)
6

Descrizione

### Describe the bug

When adding an MCP server in Copilot CLI, the **Command to run** field incorrectly processes Windows-style paths containing backslashes (`\`). The backslashes are stripped, causing the saved command path to become invalid.

This is a common scenario when pointing Copilot CLI at a locally built MCP server executable.

### Steps to reproduce

1. Open Copilot CLI settings/config UI for **MCP Servers**
2. Add a new MCP server (or edit an existing one)
3. In **Command to run**, enter a Windows path with backslashes, e.g.:
`C:\src\external\gitrepo\mcpserver\bin\mcpserver.exe`
4. Save

### Actual behavior

The saved value strips the backslashes, e.g. it becomes:
`C:srcexternalgitrepomcpserverbinmcpserver.exe`

### Expected behavior

The saved command should preserve the Windows path exactly as entered (including backslashes), e.g.:
`C:\src\external\gitrepo\mcpserver\bin\mcpserver.exe`

### Environment

- OS: Windows
- Scenario: locally built MCP server executable path entered into “Command to run”

### Additional context / notes

This looks like an escaping/serialization issue (e.g., treating backslashes as escape characters) when persisting the MCP server config. The UI should either:
- properly escape backslashes when storing, or
- treat the field as a raw string, or
- clearly document/accept `\\` if that’s required (but ideally it shouldn’t be).

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Reproduce the issue in the MCP Servers configuration UI on Windows using the path from the report, then trace how the Command to run value is persisted. Done means saving and reopening the MCP server preserves every backslash in the entered Windows path.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
shell
Ambito
cli
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
58/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.