RabbitMQ MCP Server
RabbitMQ MCP server enables AI models to interact with RabbitMQ message brokers, providing capabilities for queue management, message operations, system monitoring, and broker administration through the RabbitMQ HTTP Management API.
Overview
The RabbitMQ MCP Server bridges AI agents with RabbitMQ's management capabilities through natural language interactions. It exposes the RabbitMQ HTTP Management API as MCP tools, enabling programmatic queue management, message operations, and system monitoring.
Created by:
Developed by Kyle Mitchell
Management Plugin Required:
This server requires the RabbitMQ management plugin to be enabled on your broker. It uses the HTTP API, not direct AMQP connections.
Key Features
Queue Monitoring
Monitor message counts, queue health metrics, and consumer status in real-time
Message Operations
Transfer messages between queues and manage deadletter operations programmatically
System Alarms
Check system alarms, vhost status, and broker health conditions
TLS/HTTPS Support
Secure connections with optional TLS certificate validation and custom CA support
Available Tools
Quick Reference
| Tool | Purpose | Category |
|---|---|---|
get_queue_info | Get message count and queue details | Monitoring |
move_messages | Transfer messages between queues | Operations |
purge_queue | Remove all messages from a queue | Management |
list_queues | List all queues in a vhost | Discovery |
check_alarms | Check system alarms and health | Monitoring |
get_vhost_status | Get virtual host status | Monitoring |
Detailed Usage
get_queue_info▶
Retrieve detailed information about a specific queue including message count, consumer count, and memory usage.
use_mcp_tool({
server_name: "rabbitmq",
tool_name: "get_queue_info",
arguments: {
queue_name: "orders",
vhost: "/"
}
});
Returns message counts (ready, unacknowledged, total), consumer information, and queue state.
move_messages▶
Transfer a specified number of messages from one queue to another within the same vhost.
use_mcp_tool({
server_name: "rabbitmq",
tool_name: "move_messages",
arguments: {
source_queue: "orders",
destination_queue: "orders-priority",
message_count: 500,
vhost: "/"
}
});
Useful for load balancing, queue reorganization, and deadletter recovery.
purge_queue▶
Remove all messages from a queue. This operation is irreversible.
use_mcp_tool({
server_name: "rabbitmq",
tool_name: "purge_queue",
arguments: {
queue_name: "test-queue",
vhost: "/"
}
});
Destructive Operation:
This permanently deletes all messages in the queue. Use with caution in production environments.
list_queues▶
List all queues in a virtual host with summary statistics.
use_mcp_tool({
server_name: "rabbitmq",
tool_name: "list_queues",
arguments: {
vhost: "/"
}
});
Returns queue names, message counts, and consumer information.
check_alarms▶
Check for triggered system alarms such as memory or disk space warnings.
use_mcp_tool({
server_name: "rabbitmq",
tool_name: "check_alarms",
arguments: {}
});
Returns active alarms for monitoring broker health and preventing service degradation.
get_vhost_status▶
Get the operational status of a virtual host.
use_mcp_tool({
server_name: "rabbitmq",
tool_name: "get_vhost_status",
arguments: {
vhost: "/"
}
});
Useful for verifying vhost availability and configuration.
Installation
Prerequisites
- RabbitMQ with management plugin enabled
- Node.js installed (for npx)
Configuration
Edit your MCP client configuration file:
Basic HTTP Configuration:
{
"mcpServers": {
"rabbitmq": {
"type": "stdio",
"command": "npx",
"args": ["-y", "rabbitmq-mcp"],
"env": {
"RABBITMQ_HOST": "localhost",
"RABBITMQ_USERNAME": "guest",
"RABBITMQ_PASSWORD": "guest",
"RABBITMQ_MANAGEMENT_PORT": "15672",
"RABBITMQ_PROTOCOL": "http"
}
}
}
}
HTTPS Configuration with TLS:
{
"mcpServers": {
"rabbitmq": {
"type": "stdio",
"command": "npx",
"args": ["-y", "rabbitmq-mcp"],
"env": {
"RABBITMQ_HOST": "rabbitmq.example.com",
"RABBITMQ_USERNAME": "admin",
"RABBITMQ_PASSWORD": "your-password",
"RABBITMQ_MANAGEMENT_PORT": "15671",
"RABBITMQ_PROTOCOL": "https",
"RABBITMQ_CA_PATH": "/path/to/ca-certificate.crt"
}
}
}
}
Configuration Reference
Required Environment Variables
| Variable | Description | Example |
|---|---|---|
RABBITMQ_HOST | RabbitMQ server hostname | localhost, rabbitmq.example.com |
RABBITMQ_USERNAME | Authentication username | admin, guest |
RABBITMQ_PASSWORD | Authentication password | your-password |
RABBITMQ_MANAGEMENT_PORT | Management API port | 15672 (HTTP), 15671 (HTTPS) |
RABBITMQ_PROTOCOL | Connection protocol | http, https |
Optional TLS/HTTPS Variables
Configure TLS for secure connections (inline or file-based):
Inline PEM Strings:
| Variable | Description |
|---|---|
RABBITMQ_CA | CA certificate (PEM string) |
RABBITMQ_CERT | Client certificate (PEM string) |
RABBITMQ_KEY | Client private key (PEM string) |
File Paths:
| Variable | Description |
|---|---|
RABBITMQ_CA_PATH | Path to CA certificate file |
RABBITMQ_CERT_PATH | Path to client certificate file |
RABBITMQ_KEY_PATH | Path to client private key file |
Additional Options:
| Variable | Description | Default |
|---|---|---|
RABBITMQ_REJECT_UNAUTHORIZED | Validate TLS certificates | true |
Development Only:
Set RABBITMQ_REJECT_UNAUTHORIZED to false only for debugging with self-signed certificates. Never use in production.
Enable RabbitMQ Management Plugin
The management plugin must be enabled on your RabbitMQ broker:
# Enable the management plugin
rabbitmq-plugins enable rabbitmq_management
# Verify it's running
curl -u guest:guest http://localhost:15672/api/overview
Common Use Cases
Conditional Queue Operations
Handle queue thresholds automatically:
"Get the message count in the orders queue. If it exceeds 10,000 messages,
move half of them to the orders-overflow queue"
Production Monitoring
Check system health before deployments:
"Check for any triggered alarms in the production RabbitMQ cluster"
Queue Maintenance
Reorganize queues during maintenance windows:
"List all queues in the / vhost and show me which ones have more than
1,000 unacknowledged messages"
Deadletter Recovery
Recover messages from deadletter queues:
"Move 100 messages from the orders.dlq deadletter queue back to the
orders queue for reprocessing"
Best Practices
Security
- Use HTTPS in production with
RABBITMQ_PROTOCOL="https" - Never commit credentials to version control
- Use environment variables or secure secret management
- Create dedicated RabbitMQ users with minimal required permissions
- Enable TLS certificate validation (
RABBITMQ_REJECT_UNAUTHORIZED="true")
Monitoring
- Check alarms regularly with
check_alarms - Monitor queue depths to prevent memory issues
- Track unacknowledged message counts
- Set up alerting for abnormal queue growth
Queue Management
- Use descriptive queue names with environment prefixes
- Implement deadletter queues for failed messages
- Test
purge_queueoperations in non-production first - Document queue purposes and message schemas
Performance
- Move messages in batches to avoid API rate limits
- Monitor management API response times
- Consider using AMQP directly for high-throughput publishing
- Use the HTTP API (MCP) for monitoring and management operations
Troubleshooting
Connection Refused
If you can't connect to RabbitMQ:
- Verify the management plugin is enabled:
rabbitmq-plugins list - Check the management port: default is
15672(HTTP) or15671(HTTPS) - Test connectivity:
curl http://localhost:15672/api/overview - Verify firewall rules allow access to the management port
Authentication Failed
If authentication fails:
- Verify credentials with curl:
curl -u username:password http://localhost:15672/api/overview - Check user permissions in RabbitMQ management UI
- Ensure the user has the
monitoringtag for read operations - Ensure the user has the
administratortag for write operations
TLS Certificate Errors
If you encounter TLS certificate errors:
- Verify certificate paths are absolute, not relative
- Check certificate validity:
openssl x509 -in cert.crt -text -noout - Ensure CA certificate matches the server certificate chain
- For self-signed certificates in development, set
RABBITMQ_REJECT_UNAUTHORIZED="false"
Command Not Found
If npx or rabbitmq-mcp command is not found:
- Verify Node.js is installed:
node --version - Try absolute paths in configuration:
{ "command": "/usr/local/bin/node", "args": ["/usr/local/bin/rabbitmq-mcp"] } - For Claude Desktop on macOS, use full paths:
/usr/local/bin/npx
Sources
Related Articles
Docker Integration MCP Servers
Docker MCP servers provide interfaces for LLMs to interact with Docker containers and services. These servers enable AI models to manage containers, handle image operations, and assist with Docker infrastructure tasks.
Vectara MCP Server
Vectara MCP servers enable AI models to interact with Vectara's RAG platform, providing capabilities for fast and reliable Retrieval-Augmented Generation, semantic search, and hallucination correction.
S3 MCP Server
S3 MCP servers enable AI models to interact with Amazon S3 object storage, providing capabilities for file operations, metadata management, and versioning in a secure and scalable environment.