aws / aws/amazon-q-developer-cli
bug: Q CLI fails to load MCP server if it contains only prompts without any registered tools
- 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
### Expected behaviour
When a MCP server was added to q cli configuration, it should be able to initialize the server after running q chat even if it only contains prompts
command - /prompts
output - List of prompts registered in the MCP server
### Actual behaviour
q cli isn't loading the MCP server if it doesn't contain at least one registered tool
Error:
✗ my_mcp_server has failed to load:
- Failed to retrieve result for custom tool my_mcp_server
once a dummy tool is added or the request handler is set like below then it starts working
`
server.setRequestHandler(ListToolsRequestSchema, async () => {
return {
tools: []
};
})
`
### Steps to reproduce
- Install any MCP server without registering any tools under it (only prompts)
- Configure mcp.json with the correct AWS account profile
- Start q chat
- You will see an error in the startup message that mcp server isn't loaded successfully
### Environment
```yaml
```
Contributor guide
Assessment
This issue has not been assessed yet.