MCP Server 'Command to run' strips backslashes from Windows paths
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
### 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).
贡献指南
调研方向
在 Windows 上使用报告中的路径,在 MCP Servers 配置 UI 中重现该问题,然后跟踪 Command to run 值的持久化方式。当保存并重新打开 MCP server 后,输入的 Windows 路径中的每个反斜杠都能保留时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- shell
- 领域
- cli
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 58/100