Skip to content

Add support for comma-separated parameters in q mcp add --args that should be passed as single argument #2753

Description

@harleylrn

Problem

Currently, the q mcp add --args command splits arguments by comma and passes them as separate parameters to the underlying MCP server. However, some MCP servers require arguments that contain commas to be passed as a single parameter.

Current Behavior

q mcp add --name server --command "tool" --args "param1,param2,--config=key1=val1,val2"

This gets passed to the MCP server as separate arguments:

  • param1
  • param2
  • --config=key1=val1
  • key2=val2

Expected Behavior

We need a way to pass comma-containing arguments as single parameters to the MCP server:

  • param1,param2
  • --config=key1=val1,val2 (as one argument)

Proposed Solutions

Option 1: Escape Mechanism

Add support for escaping commas or using a different delimiter:

q mcp add --name server --command "tool" --args "param1\,param2,--config=key1=val1\,val2"

Option 2: Alternative Separator Flag

Add a flag to specify custom argument separator:

q mcp add --name server --command "tool" --args-separator "|" --args "param1,param2|--config=
key1=val1,val2"

Option 3: JSON Array Format

Support JSON array format for complex arguments:

q mcp add --name server --command "tool" --args '["param1,param2", "--config=key1=val1,val2"]'

Use Case

This is particularly important when integrating with MCP servers that expect configuration parameters in comma-separated format, such as:

  • --allowed-tools=tool1,tool2,tool3
  • --config=setting1=value1,value2
  • --features=feature1,feature2,feature3

Impact

Without this feature, it's impossible to properly configure certain MCP servers that require comma-separated values as single arguments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions