aws / aws/amazon-q-developer-cli
bug: MCP server processes persist after Q CLI terminal closure - orphaned Python processes accumulate
- 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
- [x] I have run `q doctor` in the affected terminal session
- [x] I have run `q restart` and replicated the issue again
### Operating system
Mac
### Expected behaviour
MCP server processes started by Q CLI continue running as background processes even after the terminal session is closed, leading to resource accumulation and potential system performance issues.
Ideally, All MCP server processes should be terminated when Q CLI exits or the terminal is closed.
### Actual behaviour
MCP server processes remain running as orphaned background processes. In the reported case, 80+ Python processes were found running from .cache/uv/archive-v0/ directories for various AWS MCP servers (cost-explorer,
bedrock, cfn, documentation, billing, terraform, etc.).
### Steps to reproduce
Steps to Reproduce:
1. Start Q CLI with MCP servers configured
2. Use various MCP tools/servers during the session
3. Close the terminal or exit Q CLI
4. Check running processes with ps aux | grep -i "python.*\.cache"
### Environment
```yaml
• OS: macOS
• Q CLI version: [current version]
• MCP servers: AWS Labs MCP servers (cost-explorer, bedrock-kb-retrieval, cfn, documentation, billing, etc.)
```
Contributor guide
Assessment
This issue has not been assessed yet.