Skip to main content
Glama
README.md
# rabbitmq-mcp

Stackblaze fork of [kenliao94/mcp-server-rabbitmq](https://github.com/kenliao94/mcp-server-rabbitmq) — a [Model Context Protocol](https://modelcontextprotocol.io/) server that exposes RabbitMQ queue, exchange, and shovel management tools for LLM agents.

This fork is tailored for **Kubero chat feature MCP integration**: one long-lived Deployment serves every `RabbitmqCluster` add-on in a workload cluster. The kubero broker passes the target broker URI and access mode per request via HTTP headers.

See [FORK.md](FORK.md) for kubero-specific integration details.

## Tools

| Tool | Mode | Description |
|------|------|-------------|
| `list_queues` | read | List all queues |
| `list_queues_by_vhost` | read | List queues in a vhost |
| `list_exchanges` | read | List all exchanges |
| `list_exchanges_by_vhost` | read | List exchanges in a vhost |
| `list_vhosts` | read | List virtual hosts |
| `get_queue_info` | read | Queue details (depth, consumers, etc.) |
| `get_exchange_info` | read | Exchange details |
| `list_shovels` | read | List shovel plugins |
| `get_shovel_info` | read | Shovel details by name |
| `enqueue` | write | Publish a message to a queue |
| `fanout` | write | Publish to a fanout exchange |
| `delete_queue` | write | Delete a queue |
| `purge_queue` | write | Remove all messages from a queue |
| `delete_exchange` | write | Delete an exchange |
| `publish` | — | Not implemented (upstream stub) |
| `initialize_connection_to_new_rabbitmq_broker` | write | Legacy static rebind (disabled in connection-from-request mode) |

In Kubero chat, tools are prefixed `rmq__` (e.g. `rmq__list_queues`).

Write tools refuse on production / read-only add-ons (**restricted mode**).

## Kubero deployment

```yaml
args:
  - --transport
  - streamable-http
  - --connection-from-request
  - --streamable-http-host
  - 0.0.0.0
  - --streamable-http-port
  - "3010"
```

Per-request headers from the kubero broker:

- `X-Kubero-DB-URI`: `amqp://user:pass@host:5672/` (URL-encoded credentials)
- `X-Kubero-Access-Mode`: `restricted` or `unrestricted`

## Local development

```bash
pip install -r requirements.txt

# stdio + static broker (env vars or upstream CLI)
export RABBITMQ_HOST=localhost RABBITMQ_PORT=5672
export RABBITMQ_USERNAME=guest RABBITMQ_PASSWORD=guest
python main.py

# HTTP + connection-from-request (like the k8s Deployment)
python main.py \
  --transport streamable-http \
  --connection-from-request \
  --streamable-http-host 0.0.0.0 \
  --streamable-http-port 3010
```

## Docker

```bash
docker build -t rabbitmq-mcp .
docker run -p 3010:3010 rabbitmq-mcp \
  --transport streamable-http \
  --connection-from-request \
  --streamable-http-host 0.0.0.0 \
  --streamable-http-port 3010
```

Image: `ghcr.io/stackblaze/rabbitmq-mcp`

## License

Apache-2.0 (upstream). See [LICENSE](LICENSE).