Skip to content

fix: do not truncate MCP paths containing spaces#4409

Open
Diarica wants to merge 1 commit into
esengine:main-v2from
Diarica:fix/mcp-spaces-in-path
Open

fix: do not truncate MCP paths containing spaces#4409
Diarica wants to merge 1 commit into
esengine:main-v2from
Diarica:fix/mcp-spaces-in-path

Conversation

@Diarica

@Diarica Diarica commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Two code paths were splitting MCP server commands on whitespace without the shouldSplitPluginCommand guard, which truncated any command path with spaces.

Bug 1 - Frontend forms

AddServerForm and EditServerForm in CapabilitiesPanel.tsx used command.trim().split(/\s+/) before sending to the Go backend. A path like C:\Program Files\MyApp\server.exe became command=C:\Program with args [Files\MyApp\server.exe].

Bug 2 - Legacy config.json parser

parseLegacyMCPSpec in mcpjson.go always split the command body on spaces via splitPluginCommandLine. The v0.x config.json format uses name=command args... lines. For a path with spaces like ida=C:\PersonalData\Software\Learn\IDA Pro\ida_bridge.bat, this truncated the executable to C:\PersonalData\Software\Learn\IDA.

Fix

  • Frontend: pass the full command string through; the Go side NormalizePluginCommandLine already has a quote-aware tokenizer and shouldSplitPluginCommand guard.
  • parseLegacyMCPSpec: only split when shouldSplitPluginCommand returns true; otherwise preserve the full body as the command.

Files

  • desktop/frontend/src/components/CapabilitiesPanel.tsx (+2/-2)
  • internal/config/mcpjson.go (+6/-5)

Two code paths were splitting MCP server commands on whitespace
without the shouldSplitPluginCommand guard that NormalizePluginCommandLine
has, which truncated any command path with spaces.

1. Frontend AddServerForm / EditServerForm (CapabilitiesPanel.tsx):
   split(/\s+/) on the command field before sending to the Go backend.
   A path like "C:\Program Files\MyApp\server.exe" became command
   "C:\Program" with args ["Files\MyApp\server.exe"].

2. Legacy config parser (mcpjson.go parseLegacyMCPSpec):
   Always split the body on spaces.  The v0.x config.json format uses
   "name=command args..." lines; for paths with spaces like
   "ida=C:\PersonalData\Software\Learn\IDA Pro\ida_bridge.bat", this
   truncated the command to "C:\PersonalData\Software\Learn\IDA".

Fix: in the frontend, pass the full command string through and let
NormalizePluginCommandLine handle the split on the Go side.  In
parseLegacyMCPSpec, only split when shouldSplitPluginCommand returns
true (known runner like npx/node, or quoted command), otherwise keep
the full body as the command.

Fixes e.g. IDA Pro MCP server configuration where the binary path
contains spaces.
@github-actions github-actions Bot added desktop Wails desktop app (desktop/**) config Configuration & setup (internal/config) v2 Go rewrite (1.x) — main-v2 branch, active development labels Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration & setup (internal/config) desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant