Skip to content

[EPMTIOOPS-20511] Keep args with spaces intact in MCP Servers Args field - #61

Open
DmytroHavryshGoTo wants to merge 1 commit into
mainfrom
fix/handle-args-with-space
Open

DmytroHavryshGoTo wants to merge 1 commit into
mainfrom
fix/handle-args-with-space

Conversation

@DmytroHavryshGoTo

@DmytroHavryshGoTo DmytroHavryshGoTo commented Oct 6, 2026 •

Copy link
Copy Markdown

EPMTIOOPS-20511

Problem

Typing anything in the Args field on the MCP Servers page re-split every argument on whitespace. A saved --device "Desktop Chrome" was written back as --device Desktop Chrome. @playwright/mcp then exits with too many arguments, and the app only shows MCP error -32000: Connection closed. This affects every platform and any argument with a space (device names, paths).

Fix

  • src/renderer/lib/args.ts: splits on whitespace but keeps quoted text together, and quotes arguments that contain spaces when showing them. Backslashes stay literal, so Windows paths work.
  • McpServersPage.svelte: keeps the text you typed for each card, so the field isn't reformatted while you edit.
  • mcp-client.ts: adds the last lines of the server's stderr to connect errors, e.g. Connection closed (server stderr: error: too many arguments...).

Test

  1. Config → Emulate Device Desktop Chrome → Save.
  2. MCP Servers → delete --isolated from Args → Save → Test.
  3. config.json keeps "Desktop Chrome" as one argument, and Test passes.

Configs that are already corrupted: pick the device again on the Config page and Save.

🤖 Generated with Claude Code

Editing the Args field split every arg on whitespace, so a saved
`--device "Desktop Chrome"` became `--device Desktop Chrome` and the
server exited before the MCP handshake ("Connection closed").

- Parse the field with quote-aware splitting and quote args with spaces
  on display; backslashes stay literal for Windows paths.
- Keep the typed text per card so the field isn't re-formatted mid-edit.
- Append the stdio server's stderr tail to connect errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DmytroHavryshGoTo DmytroHavryshGoTo changed the title [NO-TICKET] Keep args with spaces intact in MCP Servers Args field [EPMTIOOPS-20511] Keep args with spaces intact in MCP Servers Args field Oct 6, 2026
@DmytroHavryshGoTo DmytroHavryshGoTo self-assigned this Oct 6, 2026
@DmytroHavryshGoTo

Copy link
Copy Markdown
Author

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants