mcp-server-rabbitmq

July 24, 2026 · View on GitHub

A Model Context Protocol (MCP) server for RabbitMQ broker management and operations. It lets AI agents manage RabbitMQ brokers conversationally: multi-broker connections, blue-green migration, health checks, and full observability.

Package: amq-mcp-server-rabbitmq on PyPI · Stack: Python, FastMCP, uv

Features

  • 31 tools in v4 (enum-based dispatchers), or 61 tools in v3 (one tool per operation) for broker management - connections, queues, exchanges, health checks, observability, and blue-green migration
  • 16 composable skills - topology visualization, dead letter analysis, capacity planning, and more
  • Multi-broker support - connect multiple brokers simultaneously, switch between them by alias
  • Mutative tools gated behind --allow-mutative-tools flag (off by default for safety)
  • Tool groups - load only the tools you need with --tool-groups
  • Security hardened - SSRF protection, credential stripping, TLS warnings, JWKS HTTPS enforcement

Versions

The server ships two tool layouts so you can choose your upgrade path:

VersionLayoutUpgrade impactChoose it when
v3 (3.x)61 tools, one per operation (e.g. rabbitmq_broker_list_queues). All v2.x tool names preserved.Non-breaking - a drop-in upgrade from v2.x.You have existing prompts/integrations bound to v2/v3 tool names and want zero churn.
v4 (4.x)31 enum-based dispatchers (e.g. queues(action="list")), selectable via --tool-groups.Breaking - tool names change (opt in with --v4). --v1-compat re-registers v3 aliases to ease migration.You want ~60% fewer tool-description tokens per turn, faster startup, and per-group tool loading (see Why opt in to v4).

Both are published from this repo. v4 defaults to v3 behavior unless you pass --v4, so installing the latest package never breaks an existing setup on its own. See v4 Mode for the full mapping and the CHANGELOG for the v3 → v4 tool-name table.

Quick Start

Install via PyPI

pip install amq-mcp-server-rabbitmq
# or
uv pip install amq-mcp-server-rabbitmq
{
  "mcpServers": {
    "rabbitmq": {
      "command": "uvx",
      "args": [
        "amq-mcp-server-rabbitmq@latest",
        "--v4",
        "--allow-mutative-tools"
      ]
    }
  }
}

Configure in Claude Desktop (v3 mode - legacy, 61 tools)

{
  "mcpServers": {
    "rabbitmq": {
      "command": "uvx",
      "args": [
        "amq-mcp-server-rabbitmq@latest",
        "--allow-mutative-tools"
      ]
    }
  }
}

Basic Usage

Once configured, the agent can connect to your broker and manage it conversationally:

You: Connect to my RabbitMQ broker at rabbitmq.example.com with user admin
You: List all queues and show me which ones have messages backing up
You: Create a dead letter exchange and bind it to the orders queue

v4 Mode

v4 consolidates the 61 individual v3 tools into 31 enum-based dispatchers (29 consolidated groups plus the 2 standalone mutative tools below), reducing context window pressure while preserving full functionality. Each consolidated tool accepts an action parameter to select the operation.

Why opt in to v4

  • Fewer tokens. Every tool's name and description is sent to the model on every request, whether or not it's used. v4 roughly halves the tool count (61 → 31) and cuts that idle tool-description text by about 60% - from ~2,300 tokens to ~900 tokens (name + docstrings). That is context budget returned to the actual conversation on every single turn, and a smaller tool list also makes the model faster and more accurate at picking the right tool.
  • Faster startup. Fewer tools means less to register and advertise during the MCP handshake, so the server connects and the client finishes tool discovery sooner. With --tool-groups you can trim further - e.g. load only read/health for a monitoring agent - registering just the tools that session needs.

Numbers above are measured against this repo's tool definitions; exact token counts vary by client and model tokenizer.

Key Differences from v3

Aspectv3v4
Tool count6131 (29 dispatchers + 2 standalone mutative)
Namingrabbitmq_broker_list_queuesqueues(action="list")
LoadingAll or nothingSelectable via --tool-groups
CompatN/A--v1-compat registers v3 aliases

Standalone Mutative Tools

Two tools remain standalone because they are high-impact operations that benefit from explicit invocation and additional confirmation:

  • close_connection - Close a specific connection by name
  • rebalance_queues - Rebalance queue leaders across cluster nodes

These require the mutative tool group to be loaded.

Configuration

CLI Arguments

ArgumentDescription
--v4Enable v4 consolidated tool mode (31 tools instead of 61)
--tool-groupsSelect which tool groups to load (space-separated). Options: core, read, mutative, migration, observability, health
--v1-compatRegister v3 tool name aliases alongside v4 tools (for migration)
--allow-mutative-toolsEnable tools that can create, modify, or delete resources (default: off)
--management-portRabbitMQ Management API port (default: 443 for TLS, 15672 for non-TLS)
--httpUse Streamable HTTP transport instead of stdio
--server-portPort to run the MCP server on (default: 8888)
--http-auth-jwks-uriJWKS URI for Bearer Auth Provider
--http-auth-issuerIssuer for Bearer Auth Provider
--http-auth-audienceAudience for Bearer Auth Provider
--http-auth-required-scopesRequired scopes for Bearer Auth Provider

Tool Groups (v4)

GroupToolsGate
coreconnect, connect_oauth, broker, get_skill, get_guidelineAlways loaded
readqueues, exchanges, connections, cluster, entities, overview, policies, shovels, authAlways loaded
mutativemanage_queue, manage_exchange, manage_binding, manage_policy, manage_vhost, publish, close_connection, rebalance_queuesRequires --allow-mutative-tools
migrationdefinitions_export, definitions_import, definitions_compare, definitions_migrate, migration_readiness, federation_setupRequires --allow-mutative-tools
observabilityfind_queuesAlways loaded
healthhealthAlways loaded

Environment Variables

VariableDescription
FASTMCP_LOG_LEVELLog level: DEBUG, INFO, WARNING (default), ERROR

Tools (v3 layout)

The following table shows the v3 tool names. In v4 mode, these are consolidated into 31 enum-based dispatchers (see the v4 Mode section above). Use --v1-compat to register these names alongside v4 tools.

Connection and Session (6 tools)

ToolDescription
rabbitmq_broker_initialize_connectionConnect to a broker with username/password (SIMPLE auth)
rabbitmq_broker_initialize_connection_with_oauthConnect to a broker using an OAuth token
rabbitmq_broker_selectSwitch the active broker by alias
rabbitmq_broker_list_registered_brokersList all registered broker connections and which is active
rabbitmq_broker_get_guidelineGet best-practice guidelines for RabbitMQ deployment and sizing
rabbitmq_broker_get_skillGet a composable workflow recipe (see Skills section below)

Read-Only: Queues and Exchanges (7 tools)

ToolDescription
rabbitmq_broker_list_queuesList all queues in the broker
rabbitmq_broker_list_exchangesList all exchanges in the broker
rabbitmq_broker_list_vhostsList all virtual hosts
rabbitmq_broker_get_queue_infoGet detailed information about a specific queue
rabbitmq_broker_get_exchange_infoGet detailed information about a specific exchange
rabbitmq_broker_get_bindingsGet bindings, optionally filtered by queue or exchange
rabbitmq_broker_get_messagesPeek at messages in a queue without consuming them

Read-Only: Connections and Consumers (4 tools)

ToolDescription
rabbitmq_broker_list_connectionsList all connections on the broker
rabbitmq_broker_list_consumersList all consumers on the broker
rabbitmq_broker_list_channelsList all open channels on the broker
rabbitmq_broker_list_usersList all users on the broker

Read-Only: Cluster and Nodes (2 tools)

ToolDescription
rabbitmq_broker_get_cluster_nodes_infoGet the list of nodes and their info in the cluster
rabbitmq_broker_get_node_informationGet detailed node info including memory, disk, uptime

Read-Only: Policies and Shovels (4 tools)

ToolDescription
rabbitmq_broker_list_policiesList all policies in a virtual host
rabbitmq_broker_get_policyGet a specific policy by name
rabbitmq_broker_list_shovelsList all shovels on the broker
rabbitmq_broker_get_shovel_infoGet detailed information about a specific shovel

Read-Only: Permissions and Identity (2 tools)

ToolDescription
rabbitmq_broker_get_permissionsGet permissions for a user in a virtual host
rabbitmq_broker_whoamiGet the current authenticated user

Read-Only: Definitions and Migration (3 tools)

ToolDescription
rabbitmq_broker_get_broker_definitionGet full broker definitions (exchanges, queues, bindings, users, etc.)
rabbitmq_broker_compare_definitionsCompare definitions between two connected brokers
rabbitmq_broker_check_migration_readinessPre-flight check for blue-green migration

Read-Only: Observability (3 tools)

ToolDescription
rabbitmq_broker_get_overviewGet cluster-wide stats: version, node count, message rates, object totals
rabbitmq_broker_find_queues_by_thresholdFind queues by criteria: depth, idle time, no consumers, unacked messages
rabbitmq_broker_get_connection_churnGet connection/channel open and close rates

Health Checks (8 tools)

ToolDescription
rabbitmq_broker_is_in_alarmCheck if the broker is in alarm
rabbitmq_broker_is_quorum_criticalCheck if quorum queues have minimum online quorum
rabbitmq_broker_check_local_alarmsCheck for local alarms on the active broker
rabbitmq_broker_check_certificate_expirationCheck if TLS certificates expire within a timeframe
rabbitmq_broker_check_protocol_listenerCheck if a protocol listener is active
rabbitmq_broker_check_virtual_hostsCheck health of all virtual hosts
rabbitmq_broker_list_feature_flagsList all feature flags and their status
rabbitmq_broker_list_deprecated_featuresList deprecated features currently in use

Mutative: CRUD (16 tools)

ToolDescription
rabbitmq_broker_create_queueCreate a queue (quorum, classic, or stream)
rabbitmq_broker_delete_queueDelete a specific queue
rabbitmq_broker_purge_queueRemove all messages from a queue
rabbitmq_broker_create_exchangeCreate an exchange (direct, fanout, topic, headers)
rabbitmq_broker_delete_exchangeDelete a specific exchange
rabbitmq_broker_create_bindingCreate a binding from an exchange to a queue
rabbitmq_broker_delete_bindingDelete a binding
rabbitmq_broker_create_policyCreate or update a policy
rabbitmq_broker_delete_policyDelete a policy
rabbitmq_broker_create_vhostCreate a virtual host
rabbitmq_broker_delete_vhostDelete a virtual host and all its resources
rabbitmq_broker_set_permissionsSet permissions for a user in a virtual host
rabbitmq_broker_close_connectionClose a specific connection by name
rabbitmq_broker_update_definitionUpdate server definitions
rabbitmq_broker_export_definitionsExport definitions with optional transformations
rabbitmq_broker_import_definitionsImport definitions to the active broker

Mutative: Migration (4 tools)

ToolDescription
rabbitmq_broker_migrate_definitionsExport, transform, and import definitions between brokers
rabbitmq_broker_setup_federationSet up federation upstream and policy for message draining
rabbitmq_broker_rebalance_queuesRebalance queue leaders across cluster nodes
rabbitmq_broker_publish_messagePublish a message via HTTP Management API (diagnostics)

Mutative: AMQP (2 tools)

ToolDescription
rabbitmq_broker_enqueuePublish a message to a specific queue via AMQP
rabbitmq_broker_fanoutPublish a message to a fanout exchange via AMQP

Skills

Skills are composable workflows accessed via rabbitmq_broker_get_skill. They guide the agent through multi-step operations by orchestrating existing tools - no additional code required.

SkillWhat it doesTools it composes
pre_flight_migration_checkCheck alarms on both brokers + compare definitions for go/no-gois_in_alarm, compare_definitions
migrate_definitionsExport from source with transforms, import to targetexport_definitions, import_definitions
setup_federationVerify federation plugin, create upstream and policyget_broker_overview, import_definitions
queue_metrics_analysisInterpret publish/deliver rates and backlog trendsget_queue_info
node_resource_analysisCalculate memory %, disk headroom, FD usage per nodeget_node_information, get_cluster_nodes_info
export_topology_graphGenerate Mermaid diagram of exchange-binding-queue graphlist_exchanges, list_queues, get_bindings
trace_message_routePredict which queues receive a message given exchange + routing keyget_exchange_info, get_bindings
find_orphaned_queuesFind queues with no bindings and no consumerslist_queues, get_bindings, list_consumers
find_unbound_exchangesFind exchanges with no outbound bindings (excluding amq.*)list_exchanges, get_bindings
trace_dead_letter_chainWalk x-dead-letter-exchange arguments to map the full DLX chainget_queue_info, get_bindings
inspect_dead_lettersPeek at DLQ messages and extract x-death headers (source, reason)get_messages
dlq_summaryAggregate dead letters by source queue and rejection reasonlist_queues, get_queue_info, get_messages
broker_recommendationsCompare live broker state against best-practice guidelinesget_broker_overview, get_cluster_nodes_info, list_queues, get_guideline
queue_health_assessmentAssess queue type, consumers, depth, and policy coverageget_queue_info, get_guideline
resource_headroom_checkCompute resource utilization % vs watermarks, project time-to-alarmget_cluster_nodes_info
policy_conflict_detectionFind overlapping policy patterns and report priority winnerslist_policies

Documentation

In-depth guides live in docs/:

  • Multi-Broker — register and switch between brokers by alias
  • Authentication — broker auth (SIMPLE/OAuth) and HTTP JWT/JWKS Bearer auth
  • Skills — the 16 composable workflow recipes
  • Migration — blue-green migration, definition transforms, federation draining
  • CHANGELOG — version history and the full v3 → v4 tool-name mapping

Development

Prerequisites

  • Python 3.10+
  • uv package manager

Running Locally

git clone https://github.com/amazon-mq/mcp-server-rabbitmq.git
cd mcp-server-rabbitmq
uv run amq-mcp-server-rabbitmq

Testing

uv run pytest

Linting

uv run ruff check . && uv run ruff format .

Docker (Local RabbitMQ)

docker-compose up

This starts RabbitMQ 4 with the management plugin on localhost:5672 (AMQP) and localhost:15672 (Management UI). Default credentials: guest / guest.

Security

  • Mutative tools disabled by default - pass --allow-mutative-tools to opt in
  • Mutative action gating - high-impact operations (close_connection, rebalance_queues, set_permissions) require the mutative tool group to be loaded
  • TLS by default - connections use use_tls=True and port 5671 unless overridden
  • TLS warnings - non-TLS connections emit a warning in the response so agents can inform users
  • SSRF protection - hostname validation blocks connections to private/reserved IP ranges and localhost
  • Credential stripping - definition exports automatically strip passwords and sensitive keys before returning to the agent
  • URL encoding - all user-supplied names (queues, exchanges, vhosts) are URL-encoded before API calls to prevent injection
  • JWKS HTTPS enforcement - the --http-auth-jwks-uri flag rejects non-HTTPS URIs to prevent token validation bypass
  • OAuth support - connect with access tokens instead of username/password
  • HTTP transport with JWKS auth - run as a remote server with Bearer token validation via configurable IdP

License

Apache-2.0 - see LICENSE for details.