aws / aws/amazon-q-developer-cli

Add support for passing "args" to MCP configuration when using "q mcp add"

Open
#2,025 3 comments 2 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2k
Forks
439
PR merge metrics
No merged PRs in 30d

Description

### Checks

- [x] I have searched [github.com/aws/amazon-q-developer-cli/issues](https://github.com/aws/amazon-q-developer-cli/issues?q=) and there are no duplicates of my issue

### Operating system

macOS 15.5.0 (24F74)

### Expected behaviour

The "q mcp add" command should support passing arguments to MCP server configurations, similar to how other MCP clients allow specifying server arguments during setup.

Example:
```qchat mcp add --name awslabs.eks-mcp-server --command uvx --args 'awslabs.eks-mcp-server,--allow-write,--allow-sensitive-data-access'```

Should result in the following configuration seen in the mcp.json:
```
{
"mcpServers": {
"awslabs.eks-mcp-server": {
"command": "uvx",
"args": [
"awslabs.eks-mcp-server",
"--allow-write",
"--allow-sensitive-data-access"
]
}
}
}
```

### Actual behaviour

Currently, the "q mcp add" command does not provide a way to pass arguments to MCP server configurations, limiting the ability to configure servers that require specific parameters.

The command currently only supports the following options:
```
Options:
--name Name for the server
--command The command used to launch the server
--scope Where to add the server to [possible values: workspace, global]
--env Environment variables to use when launching the server
--timeout Server launch timeout, in milliseconds
--force Overwrite an existing server with the same name
-v, --verbose... Increase logging verbosity
-h, --help Print help
```

Using the command below:

```qchat mcp add --name awslabs.eks-mcp-server --command 'uvx awslabs.eks-mcp-server --allow-write --allow-sensitive-data-access'```

results in an invalid MCP configuration, as seen below:

```
{
"mcpServers": {
"awslabs.eks-mcp-server": {
"command": "uvx awslabs.eks-mcp-server --allow-write --allow-sensitive-data-access",
"args": [],
"env": {},
"timeout": 120000
}
}
}
```

Launching Q CLI with the configuration above leads to the following error:
```
✗ awslabseks_mcp_server has failed to load after 0.00 s
- No such file or directory (os error 2)
- run with Q_LOG_LEVEL=trace and see $TMPDIR/qchat for detail
✗ 0 of 1 mcp servers initialized.

```

### Steps to reproduce

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.