Skip to main content

A Model Context Protocol server for AmazonMQ to provision and manage your AMQ brokers

Project description

Amazon MQ MCP Server

A Model Context Protocol (MCP) server for Amazon MQ that enables generative AI models to manage RabbitMQ and ActiveMQ message brokers through MCP tools.

Features

This MCP server acts as a bridge between MCP clients and Amazon MQ, allowing generative AI models to create, configure, and manage message brokers. Furthermore, it provides tools to manage Amazon MQ for RabbitMQ brokers at the broker level. The server provides a secure way to interact with Amazon MQ resources while maintaining proper access controls and resource tagging.

graph LR
    A[Model] <--> B[MCP Client]
    B <--> C["Amazon MQ MCP Server"]
    C <--> D[Amazon MQ Service]
    D --> E[RabbitMQ Brokers]
    D --> F[ActiveMQ Brokers]

    style A fill:#f9f,stroke:#333,stroke-width:2px
    style B fill:#bbf,stroke:#333,stroke-width:2px
    style C fill:#bfb,stroke:#333,stroke-width:4px
    style D fill:#fbb,stroke:#333,stroke-width:2px
    style E fill:#fbf,stroke:#333,stroke-width:2px
    style F fill:#dff,stroke:#333,stroke-width:2px

From a security perspective, this server implements resource tagging to ensure that only resources created through the MCP server can be modified by it. This prevents unauthorized modifications to existing Amazon MQ resources that were not created by the MCP server.

Key Capabilities

  • Create and manage Amazon MQ brokers (RabbitMQ and ActiveMQ)
  • Configure broker settings and parameters
  • List and describe existing brokers
  • Reboot and update brokers
  • Create and manage broker configurations
  • Automatic resource tagging for security

Prerequisites

  1. Install uv from Astral or the GitHub README
  2. Install Python using uv python install 3.10
  3. AWS account with permissions to create and manage Amazon MQ resources

Setup

IAM Configuration

The authorization between AmazonMQ MCP server and your AWS accounts are performed with AWS profile you setup on the host. There are several ways to setup a AWS profile, however we recommend creating a new IAM role that has AmazonMQReadOnlyAccess permission following the principle of "least privilege". Note, if you want to use tools that mutate your tagged resources, you need to grant AmazonMQFullAccess. Finally, configure a AWS profile on the host that assumes the new role (for more information, check out the AWS CLI help page).

Installation

Kiro Cursor VS Code
Add to Kiro Install MCP Server Install on VS Code

Kiro

Configure the MCP server in your MCP client configuration (e.g., for Kiro, edit ~/.kiro/settings/mcp.json):

{
  "mcpServers": {
    "awslabs.amazon-mq-mcp-server": {
      "command": "uvx",
      "args": ["awslabs.amazon-mq-mcp-server@latest"],
      "env": {
        "AWS_PROFILE": "your-aws-profile",
        "AWS_REGION": "us-east-1"
      }
    }
  }
}

Windows Installation

For Windows users, the MCP server configuration format is slightly different:

{
  "mcpServers": {
    "awslabs.amazon-mq-mcp-server": {
      "disabled": false,
      "timeout": 60,
      "type": "stdio",
      "command": "uv",
      "args": [
        "tool",
        "run",
        "--from",
        "awslabs.amazon-mq-mcp-server@latest",
        "awslabs.amazon-mq-mcp-server.exe"
      ],
      "env": {
        "FASTMCP_LOG_LEVEL": "ERROR",
        "AWS_PROFILE": "your-aws-profile",
        "AWS_REGION": "us-east-1"
      }
    }
  }
}

If you would like to specify a flag (for example, to allow creation of resources), you can pass it to the args

{
  "mcpServers": {
    "awslabs.amazon-mq-mcp-server": {
      "command": "uvx",
      "args": ["awslabs.amazon-mq-mcp-server@latest", "--allow-resource-creation"],
      "env": {
        "AWS_PROFILE": "your-aws-profile",
        "AWS_REGION": "us-east-1"
      }
    }
  }
}

Docker

First build the image docker build -t awslabs/amazon-mq-mcp-server .:

# fictitious `.env` file with AWS temporary credentials
AWS_ACCESS_KEY_ID=<from the profile you set up>
AWS_SECRET_ACCESS_KEY=<from the profile you set up>
AWS_SESSION_TOKEN=<from the profile you set up>
  {
    "mcpServers": {
      "awslabs.amazon-mq-mcp-server": {
        "command": "docker",
        "args": [
          "run",
          "--rm",
          "--interactive",
          "--env-file",
          "/full/path/to/file/above/.env",
          "awslabs/amazon-mq-mcp-server:latest"
        ],
        "env": {},
        "disabled": false,
        "autoApprove": []
      }
    }
  }

You can also pull the public ECR image at public.ecr.aws/awslabs-mcp/awslabs/amazon-mq-mcp-server:latest

Kiro

At the project level .kiro/settings/mcp.json

{
  "mcpServers": {
    "awslabs.amazon-mq-mcp-server": {
      "command": "uvx",
      "args": ["awslabs.amazon-mq-mcp-server@latest"],
      "env": {
        "AWS_PROFILE": "your-aws-profile",
        "AWS_REGION": "us-east-1"
      }
    }
  }
}

Claude Desktop

{
  "mcpServers": {
    "awslabs.amazon-mq-mcp-server": {
      "command": "uvx",
      "args": ["awslabs.amazon-mq-mcp-server@latest"],
      "env": {
        "AWS_PROFILE": "your-aws-profile",
        "AWS_REGION": "us-east-1"
      }
    }
  }
}

Server Configuration Options

The Amazon MQ MCP Server supports several command-line arguments that can be used to configure its behavior:

--allow-resource-creation

Allow tools that create resources in the user's AWS account. When this flag is enabled, the create_broker and create_configuration tools will be created for the MCP client, preventing the creation of new Amazon MQ resources. Default is False.

This flag is particularly useful for:

  • Testing environments where resource creation should be restricted
  • Limiting the scope of actions available to the AI model

Example:

uv run awslabs.amazon-mq-mcp-server --allow-resource-creation

Security Features

The MCP server implements a security mechanism that only allows modification of resources that were created by the MCP server itself. This is achieved by:

  1. Automatically tagging all created resources with a mcp_server_version tag
  2. Validating this tag before allowing any mutative actions (update, delete, reboot)
  3. Rejecting operations on resources that don't have the appropriate tag

Best Practices

  • Use descriptive broker names to easily identify resources
  • Follow the principle of least privilege when setting up IAM permissions
  • Use separate AWS profiles for different environments (dev, test, prod)
  • Monitor broker metrics and logs for performance and issues
  • Implement proper error handling in your client applications

Security Considerations

When using this MCP server, consider:

  • The MCP server needs permissions to create and manage Amazon MQ resources
  • Only resources created by the MCP server can be modified by it
  • Ensure proper network security for your brokers (use publicly_accessible: false when possible)
  • Implement strong authentication for broker users
  • Review and rotate credentials regularly

Troubleshooting

  • If you encounter permission errors, verify your IAM user has the correct policies attached
  • For connection issues, check network configurations and security groups
  • If resource modification fails with a tag validation error, it means the resource was not created by the MCP server
  • For general Amazon MQ issues, consult the Amazon MQ documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

awslabs_amazon_mq_mcp_server-2.0.20.tar.gz (120.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

awslabs_amazon_mq_mcp_server-2.0.20-py3-none-any.whl (38.5 kB view details)

Uploaded Python 3

File details

Details for the file awslabs_amazon_mq_mcp_server-2.0.20.tar.gz.

File metadata

File hashes

Hashes for awslabs_amazon_mq_mcp_server-2.0.20.tar.gz
Algorithm Hash digest
SHA256 bb0669da7f3d6fd68821e3233005327be03d4a95f0b6f2324dbc3bd7091886dd
MD5 5e867f78bfb4bca00016d0856597c034
BLAKE2b-256 7a96384d83ccc455d2452b8f4989bf0a4252f5cbc95ef3c42bf3dfc7d34943f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for awslabs_amazon_mq_mcp_server-2.0.20.tar.gz:

Publisher: release.yml on awslabs/mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file awslabs_amazon_mq_mcp_server-2.0.20-py3-none-any.whl.

File metadata

File hashes

Hashes for awslabs_amazon_mq_mcp_server-2.0.20-py3-none-any.whl
Algorithm Hash digest
SHA256 0d1285d23190598d91360767d0e9f55b2c9d75a1145a6f35192bc27ebf433004
MD5 8b207be7c5fc2f2d34d5dfd50a536a37
BLAKE2b-256 a3312bc1ad934effb7702b86f6ef555ea0c0b6496808554194eefcc4f3917051

See more details on using hashes here.

Provenance

The following attestation bundles were made for awslabs_amazon_mq_mcp_server-2.0.20-py3-none-any.whl:

Publisher: release.yml on awslabs/mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page