Metadata-Version: 2.4
Name: ct-rabbitmq-mcp-server
Version: 0.1.1
Summary: CloudThinker thin wrapper over amq-mcp-server-rabbitmq: reads RABBITMQ_* env at startup, auto-connects to a default broker, and serves the broker's read tools (mutative tools opt-in) over stdio.
Project-URL: Homepage, https://github.com/cloudthinker/ct-rabbitmq-mcp-server
Author: CloudThinker
License: Apache-2.0
License-File: LICENSE
Keywords: cloudthinker,llm,mcp,rabbitmq
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Requires-Dist: amq-mcp-server-rabbitmq==2.2.4
Description-Content-Type: text/markdown

# ct-rabbitmq-mcp-server

A thin CloudThinker wrapper over [`amq-mcp-server-rabbitmq`](https://pypi.org/project/amq-mcp-server-rabbitmq/) (the AWS-maintained RabbitMQ MCP server). It makes that server **auto-connect from environment variables** instead of requiring a runtime `initialize_connection` tool call, so it drops into CloudThinker's env-injection connection model.

## What it does

- Reads `RABBITMQ_*` env vars at startup and connects a default broker.
- Exposes the broker **read** tools by default; **mutative** tools only when `RABBITMQ_ALLOW_MUTATIONS=true`.
- Never exposes upstream's `initialize_connection` / `get_guideline` tools.
- Talks to the **Management HTTP API** and serves over **stdio**.

## Run

```bash
uvx --from ct-rabbitmq-mcp-server@0.1.0 ct-rabbitmq-mcp-server
```

## Environment

| Var | Required | Default | Purpose |
|---|---|---|---|
| `RABBITMQ_HOST` | yes | — | broker hostname |
| `RABBITMQ_USERNAME` | yes | — | management-API user |
| `RABBITMQ_PASSWORD` | yes | — | management-API password |
| `RABBITMQ_USE_TLS` | no | `false` | `true` → HTTPS management API |
| `RABBITMQ_MANAGEMENT_PORT` | no | `15672` (`443` if TLS) | Management HTTP API port |
| `RABBITMQ_ALLOW_MUTATIONS` | no | `false` | `true` → also register mutative tools |
| `LOG_LEVEL` | no | `info` | mapped to `FASTMCP_LOG_LEVEL` |

The connecting user needs the RabbitMQ **management** or **administrator** tag, and the broker needs the **Management plugin** (`rabbitmq-plugins enable rabbitmq_management`).

## Tool surface (upstream `amq-mcp-server-rabbitmq==2.2.4`)

**Read (14, always):** `rabbitmq_broker_list_queues`, `_list_exchanges`, `_list_vhosts`, `_get_queue_info`, `_get_exchange_info`, `_list_shovels`, `_get_shovel_info`, `_get_cluster_nodes_info`, `_list_connections`, `_list_consumers`, `_list_users`, `_is_in_alarm`, `_is_quorum_critical`, `_get_broker_definition`.

**Mutative (4, opt-in):** `rabbitmq_broker_delete_queue`, `_purge_queue`, `_delete_exchange`, `_update_definition`.

## Implementation notes (read before bumping the upstream pin)

This wrapper depends on two upstream internals, frozen by the exact pin `amq-mcp-server-rabbitmq==2.2.4`:

1. **`import src.*`** — upstream ships its package under the top-level name `src`.
2. **Private registration methods** — we call `RabbitMQModule._RabbitMQModule__register_read_only_tools()` (and `__register_mutative_tools()`) to register the tool sets *without* the critical/connect tools.

Upstream's `RabbitMQAdmin` builds its base URL with **no port** (hardcoded for Amazon MQ on 443). To support self-managed brokers on `15672`, the wrapper folds the management port into the hostname (`host:port`).

When raising the upstream pin, re-verify both internals and the management-URL behavior.

## License

Apache-2.0 (matching upstream).
