Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ A [Model Context Protocol](https://www.anthropic.com/news/model-context-protocol
### Manage your RabbitMQ message brokers using AI agent
This MCP servers wraps admin APIs of a RabbitMQ broker as MCP tools.

### Connect to multiple brokers in one session
Supports connecting to multiple RabbitMQ brokers within a single session, allowing you to manage multiple clusters simultaneously.

### OAuth authentication support
Connect to RabbitMQ brokers using OAuth tokens for secure, token-based authentication.

### Supports streamable HTTP with FastMCP's `BearerAuthProvider`
You can start a remote RabbitMQ MCP server by configuring your own IdP and 3rd party authorization provider.

Expand Down Expand Up @@ -56,7 +62,40 @@ Use uvx directly in your MCP client config
```

### Configuration
`--allow-mutative-tools`: if specificy, it will enable tools that can mutate broker states. Default is false.
`--allow-mutative-tools`: if specified, it will enable tools that can mutate broker states. Default is false.

## Usage Examples

### Strands Agent Example

See [example/agent_strands](example/agent_strands) for a complete example of using the RabbitMQ MCP server with Strands AI agents.

```python
from mcp import stdio_client, StdioServerParameters
from strands import Agent
from strands.tools.mcp import MCPClient

stdio_mcp_client = MCPClient(lambda: stdio_client(
StdioServerParameters(
command="uvx",
args=["amq-mcp-server-rabbitmq@latest"]
)
))

with stdio_mcp_client:
tools = stdio_mcp_client.list_tools_sync()
agent = Agent(tools=tools)

while True:
user_input = input("\nYou: ").strip()
if not user_input or user_input.lower() in ["exit", "quit"]:
break
agent(user_input)
```

### Amazon Q Developer CLI Example

See [example/amazon_q_cli](example/amazon_q_cli) for configuration examples with Amazon Q Developer CLI.

## Development

Expand Down
1 change: 1 addition & 0 deletions example/agent_strands/.python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
Empty file added example/agent_strands/README.md
Empty file.
25 changes: 25 additions & 0 deletions example/agent_strands/agent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""Strands agent that uses RabbitMQ MCP server via stdio."""

from mcp import StdioServerParameters, stdio_client
from strands import Agent
from strands.tools.mcp import MCPClient

# Connect to RabbitMQ MCP server using stdio transport
stdio_mcp_client = MCPClient(
lambda: stdio_client(
StdioServerParameters(
command="/Users/qrl/.local/bin/uvx", args=["amq-mcp-server-rabbitmq@latest"]
)
)
)

# Create an agent with MCP tools
with stdio_mcp_client:
tools = stdio_mcp_client.list_tools_sync()
agent = Agent(tools=tools)
agent("what can you do?")
while True:
user_input = input("\nYou: ").strip()
if not user_input or user_input.lower() in ["exit", "quit"]:
break
agent(user_input)
9 changes: 9 additions & 0 deletions example/agent_strands/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[project]
name = "rabbitmq-strands-agent"
version = "0.1.0"
description = "Strands agent for RabbitMQ MCP server"
requires-python = ">=3.10"
dependencies = [
"strands-agents>=1.12.0",
"mcp>=1.0.0",
]
8 changes: 2 additions & 6 deletions example/amazon_q_cli/sample_agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@
"prompt": null,
"mcpServers": {
"rabbitmq": {
"command": "/Users/qrl/.local/bin/uv",
"command": "/Users/qrl/.local/bin/uvx",
"args": [
"--directory",
"/Users/qrl/amzn/personal_workspace/amazon_mq_github/mcp-server-rabbitmq",
"run",
"mcp-server-rabbitmq",
"--allow-mutative-tools"
"amq-mcp-server-rabbitmq@latest"
]
}
},
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ packages = ["src"]
[tool.uv]
dev-dependencies = ["pyright>=1.1.389", "ruff>=0.7.3", "pytest>=8.3.5"]

[tool.uv.workspace]
members = ["example/agent_strands"]

[tool.ruff]
line-length = 99
target-version = "py310"
Expand Down
Loading