aws / aws/amazon-q-developer-cli
mcp.json: Comments causing parsing errors when processing configuration
- 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
Linux 6.12.10-76061203-generic - Pop!_OS 22.04 LTS
### Expected behaviour
Removing the comments solve the WARNING and MCPs work.
### Actual behaviour
## Description
Comments in the mcp.json file are being processed instead of being ignored, which is causing parsing errors. The file contains commented-out configuration (using // style comments) which is not valid in standard JSON format.
## Current Behavior
- The mcp.json file contains JavaScript-style comments (// style)
- These comments are being included in the parsing process
- This results in JSON parsing errors
- Error shown:
~/q chat
WARNING: Error reading global mcp config: trailing characters at line 37 column 5
Please check to make sure config is correct. Discarding.
## Example Configuration
```json
{
"mcpServers": {
"github": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "[REDACTED]"
}
},
"awslabs.aws-documentation-mcp-server": {
"command": "docker",
"args": [
"run",
"--rm",
"--interactive",
"--env",
"FASTMCP_LOG_LEVEL=ERROR",
"--env",
"AWS_DOCUMENTATION_PARTITION=aws",
"mcp/aws-documentation:latest"
],
"env": {},
"disabled": false,
"autoApprove": []
}
}
}
// Problem area - commented configuration:
// "Perplexity": {
// "type": "stdio",
// "command": "npx",
// "args": ["-y", "server-perplexity-ask"],
// "env": {
// "PERPLEXITY_API_KEY": "[REDACTED]"
// }
// }
### Steps to reproduce
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.