-
Notifications
You must be signed in to change notification settings - Fork 40
fix/amazon-q mcp integration #248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Replace manual mcp.json file creation with q mcp add command - Reorder execution to run MCP configuration before post-install scripts - Remove unused mcp_json and encoded_mcp_json local variables - Ensure proper MCP server registration using official Amazon Q CLI
- Update version from 1.1.0 to 1.1.1 in README examples - Reflects patch release for MCP integration improvements
LGTM Have you tested this by chance just to make sure everything still works as expected? |
As I didn't change anything in the module except the order of the command execution it shouldn't affect the module in any way. |
I'm pretty sure you are right too. It's very likely that it would still work. I am just always paranoid about checking these before pushing. |
Missed --name parameter in the mcp addition
Installing default MCP server in the global scope
Force MCP server installation
Totally understand and you were absolutely right 😄 Setting up Amazon Q CLI configuration...
Installing Amazon Q...
Downloading Amazon Q for x86_64...
Archive: q.zip
creating: q/
inflating: q/install.sh
inflating: q/README
inflating: q/BUILD-INFO
creating: q/bin/
inflating: q/bin/q
inflating: q/bin/qterm
inflating: q/bin/qchat
Installed Amazon Q version: q 1.12.7
Extracting auth tarball...
Extracted auth tarball
Configuring Amazon Q to report tasks via Coder MCP...
To learn more about MCP safety, see https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-mcp-security.html
✓ Added MCP server 'coder' to 🌍 global
Added Coder MCP server to Amazon Q configuration
Running post-install script...
Running Amazon Q pre-install script logic...
Amazon Q CLI detected. Setting up rules...
Creating Amazon Q global context configuration...
Amazon Q global context configuration created at /home/coder/.aws/amazonq/global_context.json
📁 Created MCP config in '/home/coder/.amazonq/mcp.json'
To learn more about MCP safety, see https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-mcp-security.html
✓ Added MCP server 'github_remote' to 📄 workspace
Running Amazon Q in the background with tmux... |
Im going to review this and test it one last time today, and we can get this merged. Everything is looking good so far. Thanks for the contribution! |
Description
This PR improves the Amazon Q module's MCP (Model Context Protocol) integration by using the official q mcp add command instead of manually creating JSON configuration files.
Type of Change
Module Information
Path:
registry/coder/modules/amazon-q
New version:
v1.1.1
Breaking change: [ ] Yes [X] No
Testing & Validation
bun test
)bun run fmt
)✅ All module tests pass:
• (pass) amazon-q module > required variables
• (pass) amazon-q module > creates coder_script resource
• (pass) amazon-q module > creates coder_app resource
✅ Terraform validation: terraform validate confirms configuration is syntactically correct
✅ Code formatting: Applied terraform fmt successfully
Related Issues
None
Changes Made
Before
• Used manual JSON file creation: mkdir -p ~/.aws/amazonq and wrote to ~/.aws/amazonq/mcp.json
• Post-install script ran before MCP configuration
• Required complex JSON generation and base64 encoding
After
• Uses official Amazon Q CLI command: q mcp add coder --command "coder" --args "exp,mcp,server,--allowed-tools,coder_report_task" --env "CODER_MCP_APP_STATUS_SLUG=amazon-q"
• MCP configuration runs before post-install scripts (proper execution order)
• Removed unused mcp_json and encoded_mcp_json local variables
• Cleaner, more maintainable code