aws / aws/amazon-q-developer-cli

Q CLI doesn't reconnect to failed MCP servers, making them unusable for session duration

Open
#2,708 0 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
- [x] I have run `q doctor` in the affected terminal session
- [x] I have run `q restart` and replicated the issue again

### Operating system

macOS 15.3.0 (24D60)

### Expected behaviour

When an MCP server (like IntelliJ MCP server) fails or times out, Q CLI should either:
1. Detect the connection failure and automatically attempt to reconnect
2. Temporarily disable the failed MCP server and retry periodically
3. Provide a command to manually reset/reconnect to MCP servers
4. Show clear status of MCP server connections

### Actual behaviour

When the IntelliJ MCP server errors out (which happens fairly regularly), Q CLI maintains the stale connection and continues trying to use the non-functional MCP server. This makes all IntelliJ-related tools unusable for the entire session duration. The only workaround is to manually tell Amazon Q to "forget about the IntelliJ MCP server" but this is temporary and gets forgotten in longer conversations.

```
[chat-transcript]
> help me create an issue about yourself: i have Intellij MCP server setup and is working great until it stops working. i fairly certain what happens is the Intellij MCP server starts to error out and a new MCP server is started. but, q cli is keeps the existing connection and not trying to reconnect so this MCP server is useless for the duration of the session. i usually tell you to forget about the Intellij MCP server, and that works for a while until you forget what i tell you and we go back. Is there any way for the CLI to detect that the MCP server is timing out, terminate that connection and try to reconnect? OR just disable the use of the MCP server for a while

I'll help you create a GitHub issue to report this MCP server connection problem. This is a legitimate issue with the Q CLI's MCP server connection management that should be addressed.
[Tool uses: report_issue]

Let me create this issue with the appropriate details:
[Tool uses: report_issue]
```

### Steps to reproduce

1. Set up IntelliJ MCP server with Q CLI
2. Use IntelliJ MCP tools successfully for a while
3. Wait for IntelliJ MCP server to error out/timeout (happens naturally during usage)
4. Try to use IntelliJ MCP tools - they will fail but Q CLI keeps trying to use them
5. Session becomes degraded until manual intervention or restart

### Environment

```yaml

```

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.