-
Notifications
You must be signed in to change notification settings - Fork 1.4k
MCP Server 'Command to run' strips backslashes from Windows paths #2786
Copy link
Copy link
Open
Labels
area:configurationConfig files, instruction files, settings, and environment variablesConfig files, instruction files, settings, and environment variablesarea:mcpMCP server configuration, discovery, connectivity, OAuth, policy, and registryMCP server configuration, discovery, connectivity, OAuth, policy, and registryarea:platform-windowsWindows-specific: PowerShell, cmd, Git Bash, WSL, Windows TerminalWindows-specific: PowerShell, cmd, Git Bash, WSL, Windows Terminal
Metadata
Metadata
Assignees
Labels
area:configurationConfig files, instruction files, settings, and environment variablesConfig files, instruction files, settings, and environment variablesarea:mcpMCP server configuration, discovery, connectivity, OAuth, policy, and registryMCP server configuration, discovery, connectivity, OAuth, policy, and registryarea:platform-windowsWindows-specific: PowerShell, cmd, Git Bash, WSL, Windows TerminalWindows-specific: PowerShell, cmd, Git Bash, WSL, Windows Terminal
Type
Fields
Give feedbackNo fields configured for Bug.
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
C:\src\external\gitrepo\mcpserver\bin\mcpserver.exeActual behavior
The saved value strips the backslashes, e.g. it becomes:
C:srcexternalgitrepomcpserverbinmcpserver.exeExpected behavior
The saved command should preserve the Windows path exactly as entered (including backslashes), e.g.:
C:\src\external\gitrepo\mcpserver\bin\mcpserver.exeEnvironment
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:
\\if that’s required (but ideally it shouldn’t be).