goose icon indicating copy to clipboard operation
goose copied to clipboard

command line with quotes in a custom extension is not parsed correctly

Open emicklei opened this issue 7 months ago • 0 comments

Describe the bug

Unable to add extension with command line that uses quotes in flags.

To Reproduce Steps to reproduce the behavior:

  1. Go to Settings
  2. Add custom extension
  3. Enter command
  4. See error

Expected behavior Correct parsing of command line arguments

Screenshots

Command line entered

/Users/ernestmicklei/go/bin/mcp-log-proxy -command "/Users/ernestmicklei/go/bin/melrose-mcp -log test.log" -log /Users/ernestmicklei/Library/Logs/goose-melrose.log -port 9001 -title “Melrose MCP”

Erorr received

Error: Error activating extension: Failed to add extension configuration, error:
 Initialization(Stdio { name: "test", 
 cmd: "/Users/ernestmicklei/go/bin/mcp-log-proxy", 
 args: ["-command", "\"/Users/ernestmicklei/go/bin/melrose-mcp", "-log", "test.log\"",
  "-log", "/Users/ernestmicklei/Library/Logs/goose-melrose.log", 
  "-port", "9001", 
  "-title", "“Melrose", "MCP”"], 
  envs: Envs { map: {} }, env_keys: [], timeout: Some(300), description: None, bundled: None }, McpServerError { method: "initialize", server: "", source: ServerBoxError(StdioProcessError("Process ended unexpectedly")) })

Additional context As you can see, this command line cannot have quotes " to handle white spaces in arguments

Proposed solution Allow the user to (optionally) specify the command in JSON (like many other MCP clients do), for example:

"melrose-mcp": {
  "command": "/Users/SOME-USER/go/bin/mcp-log-proxy",
  "args": [
    "-command",
    "/Users/ernestmicklei/go/bin/melrose-mcp -log test.log",
    "-log",
    "/Users/SOME-USER/Library/Logs/goose-melrose.log",
    "-port",
    "9001",
    "-title",
    "Melrose MCP"
  ]
}

emicklei avatar May 13 '25 10:05 emicklei