aws / aws/amazon-q-developer-cli

Q CLI MCP Integration Missing Resources and Prompts Support

Aperta
#2,541 0 commenti 3 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
2k
Fork
439
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### 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.6.0 (24G84)

### Expected behaviour

Q CLI should provide commands to list and access MCP resources and prompts, similar to how it exposes MCP tools. Expected commands like:
- `q mcp resources list` - List available resources
- `q mcp resources read ` - Read a specific resource
- `q mcp prompts list` - List available prompts
- `q mcp prompts get ` - Get a specific prompt

### Actual behaviour

Q CLI only exposes MCP tools as functions but doesn't provide access to MCP resources and prompts, even though the connected MCP servers properly implement and expose these capabilities.

```
[chat-transcript]
Great!

[Tool uses: fs_read]

[Tool uses: fs_read]

[Tool uses: fs_read]

[Tool uses: fs_read]

Perfect! I can see that the server code does have resources and prompts handlers registered. Let me check if the server is built and examine the resources and prompts implementations:
[Tool uses: fs_read]

Great! I can see the built files exist, including the resources and prompts directories. Let me check what resources and prompts are available:
[Tool uses: fs_read]

[Tool uses: fs_read]

Now let me examine the actual resources and prompts implementations to see what they provide:
[Tool uses: fs_read]

[Tool uses: fs_read]

Now let me test if the MCP server is actually running and responding to resource/prompt requests. Let me try to manually test the server:
[Tool uses: execute_bash]

[Tool uses: execute_bash]

The server seems to be starting up fine. Let me check if there's an issue with the Q CLI's MCP integration. Let me look at the current MCP server status more carefully:
[Tool uses: execute_bash]

The issue might be that the Q CLI's MCP integration is primarily focused on exposing **tools** rather than resources and prompts. Let me check if there are any Q CLI configuration files or logs that might give us more insight:
[Tool uses: execute_bash]

[Tool uses: execute_bash]

[Tool uses: execute_bash]

[Tool uses: fs_read]

[Tool uses: fs_read]

I notice there's a discrepancy! The Q CLI is configured to use a different MCP server configuration than what's currently active. Let me check what's actually being used:
[Tool uses: execute_bash]

Now I understand the issue! The Q CLI is using the `mcp-wrapper.sh` script, but there might be an issue with how the MCP protocol is being handled. Let me create a simple test to verify if the server is properly exposing resources and prompts:
[Tool uses: fs_write]

> t

[Tool uses: execute_bash]

Excellent! The test shows that the MCP server **IS** properly exposing resources and prompts:

- **10 Resources** available (including SumoLogic queries, documentation, schema info, etc.)
- **8 Prompts** available (including PNR analysis, error investigation, performance analysis, etc.)
- **37 Tools** available

The issue is that the **Q CLI's MCP integration is not exposing the resources and prompts functionality** to the user interface. The Q CLI appears to be designed primarily to surface MCP **tools** as functions, but doesn't provide direct access to resources and prompts.

## Root Cause Analysis:

1. **MCP Server is Working Correctly**: The server properly implements and exposes resources and prompts
2. **Q CLI Limitation**: The Q CLI's MCP integration focuses on tools and doesn't provide commands to list/access resources and prompts
3. **Protocol Support**: The MCP protocol supports all three capabilities, but Q CLI only surfaces tools

## Potential Solutions:

### Option 1: Request Q CLI Enhancement
The most proper solution would be to request AWS to enhance the Q CLI to support MCP resources and prompts. You could:
[Tool uses: report_issue]

(...truncated)
```

### Steps to reproduce

1. Connect an MCP server that implements resources and prompts (like the sumologic-server)
2. Run `q mcp list` - only shows servers
3. Run `q mcp status --name ` - shows server status but no resource/prompt info
4. Try to find commands to access resources/prompts - none exist
5. Verify server supports resources/prompts by testing directly with JSON-RPC calls

### Environment

```yaml

[q-details]
version = "1.13.2"
hash = "36e70d1cad4465a9ea479bb7f10d7973b717b4f7"
date = "2025-08-08T20:16:09.268082Z (2d ago)"

[system-info]
os = "macOS 15.6.0 (24G84)"
chip = "Apple M2 Max"
total-cores = 12
memory = "32.00 GB"

[environment]
cwd = "/Users/USER"
cli-path = "/Users/USER"
install-method = "unknown"

[env-vars]
PATH = "/Users/USER/bin:/Users/USER/.bun/bin:/Users/USER/local/bin:/Users/USER/.jbang/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Applications/CyberArk EPM.app/Contents/Helpers:/usr/local/sbin:/usr/local/go/bin:/Users/USER/.cargo/bin:/Users/USER/.local/bin"
QTERM_SESSION_ID = "1fe3d535a9e14cdaada82b9f784d8cd8"
Q_SET_PARENT_CHECK = "1"
Q_TERM = "1.13.2"
SHELL = "/bin/zsh"
TERM = "xterm-256color"
__CFBundleIdentifier = "com.apple.Terminal"

[chat-settings]

[chat-trusted_tools]
fs_read=trusted
execute_bash=trusted
fs_write=trusted

[chat-failed_request_ids]
none

[chat-context]
current_profile=q_cli_default
profile_context=
AmazonQ.md
README.md
.amazonq/rules/**/*.md

files=none
```

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Begin with the `q mcp list` and `q mcp status --name ` entry points, then compare them with the direct JSON-RPC checks described in the report. Done means users can list and access MCP resources and prompts through documented CLI commands, alongside the existing tool support.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust
Ambito
api, cli
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.