Skip to main content
Glama
yanggf8

Amazon Q CLI MCP Server

by yanggf8

Amazon Q CLI MCP Server

A Model Context Protocol (MCP) server that wraps the Amazon Q CLI, enabling MCP hosts (Claude Desktop, VS Code, Rovo Dev CLI, etc.) to interact with Amazon Q's AI capabilities.

Features

  • ask_q / take_q: Chat with Amazon Q CLI for AI assistance

  • q_translate: Convert natural language to shell commands

  • q_status: Check Amazon Q CLI installation and configuration

  • fetch_chunk: Fetch byte ranges from HTTP URLs

  • Session Management: Automatic session persistence with conversation history

  • Error Recovery: Intelligent retry logic with exponential backoff

  • Security: Input validation, command whitelisting, and resource limits

Related MCP server: AWS MCP Infrastructure

Prerequisites

  • Amazon Q CLI: Install from AWS documentation

  • AWS Credentials: Configure via aws configure or environment variables

  • Node.js: Version 18 or higher

Installation

From npm

npm install -g amazon-q-cli-mcp-server

From source

git clone <repository>
cd amazon-q-cli-mcp-server
npm install
npm run build
npm install -g .

Usage

Claude Desktop

Add to claude_desktop_config.json:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json Linux: ~/.config/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "amazon-q-cli": {
      "command": "amazon-q-mcp-server",
      "args": []
    }
  }
}

Rovo Dev CLI

Add to ~/.rovodev/mcp.json:

{
  "mcpServers": {
    "amazon-q-cli": {
      "command": "amazon-q-mcp-server",
      "args": [],
      "transport": "stdio"
    }
  }
}

Note: If you encounter GLIBC version conflicts with Rovo Dev CLI, create a wrapper script:

#!/bin/bash
# Clear LD_LIBRARY_PATH to avoid conflicts
unset LD_LIBRARY_PATH
exec amazon-q-mcp-server "$@"

Then use the wrapper script path in your configuration.

Claude Code CLI

claude mcp add -s user amazon-q-cli amazon-q-mcp-server

Available Tools

ask_q / take_q

Chat with Amazon Q CLI for AI assistance.

Parameters:

  • prompt (required): Question or prompt for Amazon Q

  • model (optional): Model to use

  • agent (optional): Agent/context profile

q_translate

Convert natural language to shell commands.

Parameters:

  • task (required): Natural language description

q_status

Check Amazon Q CLI installation and configuration.

Parameters: None

fetch_chunk

Fetch byte ranges from HTTP URLs.

Parameters:

  • url (required): HTTP/HTTPS URL

  • start (optional): Start byte offset (default: 0)

  • length (optional): Bytes to fetch (default: 65536, max: 10MB)

  • headers (optional): Request headers

Troubleshooting

Normal Startup Messages

[Amazon Q MCP] init Amazon Q CLI MCP Server
[Amazon Q MCP] Amazon Q CLI MCP Server listening on stdio

Common Issues

Q CLI not found:

which q
q --version

AWS credentials:

aws configure
# or set environment variables
export AWS_ACCESS_KEY_ID=your-key
export AWS_SECRET_ACCESS_KEY=your-secret
export AWS_DEFAULT_REGION=us-west-2

GLIBC version conflicts (Rovo Dev CLI): Create a wrapper script that clears LD_LIBRARY_PATH before executing the server.

MCP server not starting:

  • Check that the command path is correct

  • Verify Node.js is accessible

  • Ensure proper permissions on executable files

Development

npm run build    # Build TypeScript
npm run dev      # Watch mode
npm test         # Run tests

Architecture

MCP Host (Claude Desktop, Rovo Dev CLI, etc.)
    ↓ (MCP Protocol)
Amazon Q CLI MCP Server
    ↓ (Process execution with security)
Amazon Q CLI (`q` command)
    ↓ (AWS API calls)
Amazon Q Service

License

Apache License 2.0 - see LICENSE file for details.

Available Tools

5 tools
ask_qB

Execute Amazon Q CLI with a prompt to get AI assistance

ParametersJSON Schema
NameRequiredDescriptionDefault
agentNoAgent/context profile to use (optional)
modelNoModel to use (optional)
promptYesThe question or prompt to send to Amazon Q

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description carries the full burden for behavioral disclosure. It only mentions executing a CLI command to get AI assistance, without stating whether the operation is read-only, has side effects, requires authentication, or how long it may take.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is one tight sentence with no filler, and it leads with the action and resource before the purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple prompt-passing tool, the description covers the basic purpose. However, with no output schema and sibling tools that could overlap, it omits any note about the response format, environment requirements, or when this tool is the right choice.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, and the schema already describes all three parameters (agent, model, prompt). The description adds no extra parameter semantics, so the baseline of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Execute') and resource ('Amazon Q CLI') and the purpose ('get AI assistance'). However, it does not differentiate from siblings like q_status or take_q, which could also involve running Q commands, so it loses the top point.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use ask_q instead of q_status, take_q, q_translate, or fetch_chunk. The description gives a general action but no context, prerequisites, or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

fetch_chunkB

Fetch a byte range from a URL (chunked HTTP fetch)

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesHTTP/HTTPS URL to fetch
startNoStart byte offset (default 0)
lengthNoNumber of bytes to fetch (default 65536)
headersNoOptional request headers

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations at all, the description carries the full burden of behavioral disclosure. It tells the agent that a range is fetched, but says nothing about HTTP method, response format, error behavior, redirects, or authentication. This is a thin behavioral picture for a network-fetching tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no filler. The core verb and object are front-loaded, and the parenthetical adds relevant clarity. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a straightforward fetch tool with fully documented parameters, the description is minimally adequate. However, without an output schema or annotation safety profile, an agent does not know what the response looks like or how failures are surfaced, leaving a notable gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the parameters url, start, length, and headers are already documented. The description's mention of 'byte range' loosely maps to start and length, but adds no detail beyond the schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a clear verb ('Fetch') and resource ('a byte range from a URL'), and the parenthetical 'chunked HTTP fetch' reinforces the operation. It does not explicitly differentiate from sibling tools, but the purpose is specific and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the description: call this when you need a specific byte range of a URL rather than the full content. However, there is no explicit guidance on when not to use it or reference to alternatives among the siblings, so the guidance remains implicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

q_statusA

Check Amazon Q CLI installation and configuration status

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of behavioral disclosure. It conveys that the operation is a read-only check of installation and configuration, but it does not describe what the status output looks like, how failures are reported, or whether any side effects occur. This is adequate for a simple status tool but leaves important behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no filler words. Every word contributes meaning, and it is appropriately sized for a no-argument status check.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool itself is simple to invoke (no parameters, no output schema), but the description does not explain what constitutes 'status' or how the returned information should be interpreted. This is a minor completeness gap given that the agent may need to know whether the result is a health summary, version info, or an error message.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has zero properties, so there are no parameters to document. Per the rubric, a zero-parameter tool receives a baseline of 4, and the description adds nothing contradictory or incomplete regarding parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Check') and names the exact object ('Amazon Q CLI installation and configuration status'), making the tool's purpose unmistakable. It is clearly distinct from its siblings (ask_q, take_q, q_translate, fetch_chunk), which describe other actions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool should be used to verify that the Amazon Q CLI is installed and configured, but it does not explicitly say when to prefer it over sibling tools or mention any prerequisites. There is no guidance on when not to use it, leaving usage largely to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

q_translateA

Convert natural language to shell commands using Amazon Q

ParametersJSON Schema
NameRequiredDescriptionDefault
taskYesNatural language description of the task (e.g., "find all Python files")

TDQS

A3.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It does not state whether the command is returned as text, printed, or executed, and it gives no information about side effects, permissions, or limitations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no wasted words. The core purpose is front-loaded and immediately understandable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the purpose and the one input, and the output type is implied by the phrase 'shell commands.' However, with no output schema and no annotations, it omits important behavioral details such as return format and whether the command is executed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already fully documents the single task parameter with an example. The description adds no additional parameter-level meaning beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action (convert), the input (natural language), and the output (shell commands) using Amazon Q. This clearly differentiates it from siblings like q_status, ask_q, and fetch_chunk.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The intended use case is clear: turn a natural language task description into a shell command. However, it does not explicitly contrast with ask_q or other siblings or state when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

take_qA

Execute Amazon Q CLI with a prompt to get AI assistance (alias for ask_q)

ParametersJSON Schema
NameRequiredDescriptionDefault
agentNoAgent/context profile to use (optional)
modelNoModel to use (optional)
promptYesThe question or prompt to send to Amazon Q

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description carries the full burden for behavioral disclosure. It mentions executing a CLI and getting AI assistance, but does not disclose side effects, permissions, network usage, output format, or any operational traits beyond the basic function.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no wasted words. The core action is front-loaded, and the alias note efficiently prevents confusion with the sibling ask_q.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with fully documented parameters, the description is adequate for basic invocation. However, it lacks behavioral details, return value expectations, and explicit guidance on choosing this alias over ask_q, leaving some contextual gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all three parameters are already documented. The description adds no meaningful detail beyond the word 'prompt', which is already represented in the schema, so the baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action ('Execute Amazon Q CLI') and resource ('Amazon Q CLI') with a prompt, and clarifies it is an alias for ask_q. It clearly conveys what the tool does, though 'AI assistance' remains somewhat generic.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

By explicitly stating 'alias for ask_q', the description gives clear context that this tool is interchangeable with the sibling ask_q. It does not provide explicit when/when-not guidance for other siblings, but the alias note makes the usage relationship unambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updatesv1.0.0
    • First observedask_q
    • First observedfetch_chunk
    • First observedq_status
    • First observedq_translate
    • First observedtake_q

TDQS

B3/5.0

Scored across 5 tools

Disambiguation1/5

ask_q and take_q are explicitly identical aliases, and q_translate also executes Amazon Q CLI with a prompt. This creates multiple tools that appear to do the same thing, with only q_status and fetch_chunk being clearly distinct.

Naming Consistency2/5

Naming is inconsistent: q_status and q_translate use a q_ prefix, ask_q and take_q use a verb_q suffix pattern, and fetch_chunk follows neither convention. The alias pair also introduces an unnecessary naming divergence.

Tool Count3/5

Five tools is numerically reasonable, but one tool is a redundant alias and fetch_chunk is unrelated to Amazon Q CLI management. The effective tool surface is smaller and less coherent than the count suggests.

Completeness3/5

The server covers status checking, general Q&A, and shell command translation, but lacks setup or configuration workflows that would complete the CLI lifecycle. fetch_chunk feels disconnected and does not fill an obvious gap in the Amazon Q domain.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers