Azure Service Bus MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Azure Service Bus MCP Server Send a test message to queue 'alerts' in namespace 'my-namespace'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Azure Service Bus MCP Server
An MCP (Model Context Protocol) server for Azure Service Bus. Compatible with any MCP client — Claude Code, Claude Desktop, Cursor, and others.
Exposes tools for sending messages, inspecting queue and subscription contents, and purging test data. The built-in Azure MCP server that ships with Claude Code only supports read operations (queue details, message counts, etc.) and cannot send messages — this project fills that gap.
Authentication uses DefaultAzureCredential, which picks up an active az login session automatically. Alternatively, a connection string can be provided via the AZURE_SERVICEBUS_CONNECTION_STRING environment variable. No secrets or connection strings are ever passed as tool arguments.
Requirements
Azure CLI with an active
az loginsession, orAZURE_SERVICEBUS_CONNECTION_STRINGset in your environmentYour identity must have the Azure Service Bus Data Owner or Azure Service Bus Data Receiver/Sender roles on the target namespace
Related MCP server: Azure DevOps MCP Server
Installation
Install uv if you don't have it:
macOS
brew install uv azure-cliLinux
curl -LsSf https://astral.sh/uv/install.sh | sh
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash # Debian/UbuntuFor other Linux distributions see the Azure CLI install docs.
Windows
winget install --id=astral-sh.uv
winget install --id=Microsoft.AzureCLIConfiguration
Claude Code users:
claude mcp add --scope user azure-service-bus -- uvx servicebus-mcpFor other MCP clients, add the following to your server configuration:
{
"mcpServers": {
"azure-service-bus": {
"command": "uvx",
"args": ["servicebus-mcp"]
}
}
}Restart your MCP client after adding the server. No environment variables are required if you are authenticated with az login. Optional env vars:
AZURE_SUBSCRIPTION_ID— used byservicebus_list_namespacesif setAZURE_SERVICEBUS_CONNECTION_STRING— use instead ofaz loginfor data plane operations (send, peek, purge)
Installing from source
If you prefer to run from a local clone:
git clone https://github.com/BrianDeacon/servicebus-mcp
cd servicebus-mcp
uv sync
az loginThen configure with the cloned path:
{
"mcpServers": {
"azure-service-bus": {
"command": "uv",
"args": ["run", "--directory", "/path/to/servicebus-mcp", "servicebus-mcp"]
}
}
}Restart your MCP client after adding the server.
Tools
The namespace parameter accepts either a short name (my-namespace) or a fully qualified hostname (my-namespace.servicebus.windows.net). The .servicebus.windows.net suffix is appended automatically if absent.
servicebus_list_namespaces
List all Service Bus namespaces in the current Azure subscription. The subscription is resolved automatically — first from the AZURE_SUBSCRIPTION_ID environment variable, then from the active az login session.
servicebus_list_queues
List all queues in a Service Bus namespace.
Parameter | Type | Required | Description |
| string | yes | Service Bus namespace |
Returns a sorted JSON array of queue names.
servicebus_list_topics
List all topics in a Service Bus namespace.
Parameter | Type | Required | Description |
| string | yes | Service Bus namespace |
| boolean | no | If true, returns a map of topic name → sorted array of subscription names (default false) |
servicebus_send_message
Send a single message to a queue or topic.
Parameter | Type | Required | Description |
| string | yes | Service Bus namespace |
| string | yes | Queue or topic name |
| string | yes | Message body (typically JSON, sent as-is) |
| string | no | Required for session-enabled queues |
| string | no | Correlation ID to set on the message |
| object | no | Key/value map of custom message properties |
| string | no | ISO 8601 datetime to enqueue the message (e.g. |
Returns a success message confirming the message was sent or scheduled.
servicebus_send_batch
Send multiple messages in a single batch. Useful for seeding test data.
Parameter | Type | Required | Description |
| string | yes | Service Bus namespace |
| string | yes | Queue or topic name |
| array | yes | Array of message objects, each with |
servicebus_peek_messages
Non-destructively peek at messages in a queue. Messages are not locked or consumed.
Parameter | Type | Required | Description |
| string | yes | Service Bus namespace |
| string | yes | Queue name |
| integer | no | Max messages to return (default 10, max 100) |
| string | no | Peek within a specific session. If omitted on a session-enabled queue, the next available session is accepted, peeked, and immediately released. The session ID is included in each returned message, so you can use it for subsequent targeted calls. |
Returns message bodies and metadata (sequence number, enqueue time, properties). Use servicebus_peek_messages_to_file instead if message bodies may be large.
servicebus_peek_messages_to_file
Same as servicebus_peek_messages but writes message bodies to a file. Only metadata is returned in context, avoiding large payloads filling the context window.
Parameter | Type | Required | Description |
| string | yes | Service Bus namespace |
| string | yes | Queue name |
| string | yes | Path to write message bodies as JSON |
| integer | no | Max messages to return (default 10, max 100) |
| string | no | Peek within a specific session. If omitted on a session-enabled queue, the next available session is accepted, peeked, and immediately released. |
servicebus_peek_dlq
Non-destructively peek at messages in a queue's dead letter queue.
Parameter | Type | Required | Description |
| string | yes | Service Bus namespace |
| string | yes | Queue name |
| integer | no | Max messages to return (default 10, max 100) |
Returns message bodies, dead letter reason, error description, and other metadata.
servicebus_peek_dlq_to_file
Same as servicebus_peek_dlq but writes message bodies to a file.
Parameter | Type | Required | Description |
| string | yes | Service Bus namespace |
| string | yes | Queue name |
| string | yes | Path to write message bodies as JSON |
| integer | no | Max messages to return (default 10, max 100) |
servicebus_purge_queue
Delete all messages from a queue. This is destructive and cannot be undone.
Parameter | Type | Required | Description |
| string | yes | Service Bus namespace |
| string | yes | Queue name |
| integer | no | Safety cap — stops and leaves remaining messages untouched if the running total exceeds this (default 1000) |
servicebus_purge_dlq
Delete all messages from a queue's dead letter queue. This is destructive and cannot be undone.
Parameter | Type | Required | Description |
| string | yes | Service Bus namespace |
| string | yes | Queue name |
| integer | no | Safety cap — stops and leaves remaining messages untouched if the running total exceeds this (default 1000) |
servicebus_requeue_dlq
Move messages from a queue's dead letter queue back to the main queue. Preserves body, session ID, correlation ID, and application properties.
Parameter | Type | Required | Description |
| string | yes | Service Bus namespace |
| string | yes | Queue name |
| integer | no | Stops if the running total would exceed this (default 100) |
servicebus_peek_subscription_messages
Non-destructively peek at messages in a topic subscription.
Parameter | Type | Required | Description |
| string | yes | Service Bus namespace |
| string | yes | Topic name |
| string | yes | Subscription name |
| integer | no | Max messages to return (default 10, max 100) |
| string | no | Peek within a specific session. If omitted on a session-enabled subscription, the next available session is accepted, peeked, and immediately released. |
servicebus_peek_subscription_messages_to_file
Same as servicebus_peek_subscription_messages but writes message bodies to a file.
Parameter | Type | Required | Description |
| string | yes | Service Bus namespace |
| string | yes | Topic name |
| string | yes | Subscription name |
| string | yes | Path to write message bodies as JSON |
| integer | no | Max messages to return (default 10, max 100) |
| string | no | Peek within a specific session. If omitted on a session-enabled subscription, the next available session is accepted, peeked, and immediately released. |
servicebus_peek_subscription_dlq
Non-destructively peek at messages in a topic subscription's dead letter queue.
Parameter | Type | Required | Description |
| string | yes | Service Bus namespace |
| string | yes | Topic name |
| string | yes | Subscription name |
| integer | no | Max messages to return (default 10, max 100) |
servicebus_peek_subscription_dlq_to_file
Same as servicebus_peek_subscription_dlq but writes message bodies to a file.
Parameter | Type | Required | Description |
| string | yes | Service Bus namespace |
| string | yes | Topic name |
| string | yes | Subscription name |
| string | yes | Path to write message bodies as JSON |
| integer | no | Max messages to return (default 10, max 100) |
servicebus_purge_subscription
Delete all messages from a topic subscription. This is destructive and cannot be undone.
Parameter | Type | Required | Description |
| string | yes | Service Bus namespace |
| string | yes | Topic name |
| string | yes | Subscription name |
| integer | no | Safety cap — stops and leaves remaining messages untouched if the running total exceeds this (default 1000) |
servicebus_purge_subscription_dlq
Delete all messages from a topic subscription's dead letter queue. This is destructive and cannot be undone.
Parameter | Type | Required | Description |
| string | yes | Service Bus namespace |
| string | yes | Topic name |
| string | yes | Subscription name |
| integer | no | Safety cap — stops and leaves remaining messages untouched if the running total exceeds this (default 1000) |
servicebus_requeue_subscription_dlq
Move messages from a topic subscription's dead letter queue back to the topic. Preserves body, session ID, correlation ID, and application properties.
Parameter | Type | Required | Description |
| string | yes | Service Bus namespace |
| string | yes | Topic name |
| string | yes | Subscription name |
| integer | no | Stops if the running total would exceed this (default 100) |
Security
This server only accepts
DefaultAzureCredential— connection strings and SAS keys are never passed as arguments, ensuring secrets do not appear in conversation history.purge_*andrequeue_*tools enforce amax_messagessafety cap to prevent accidental bulk operations on large backlogs.
Available Tools
19 toolsservicebus_list_namespacesA
List all Azure Service Bus namespaces in the current subscription.
The subscription is resolved automatically — first from the AZURE_SUBSCRIPTION_ID environment variable, then from the active 'az login' session. If neither is available, an error is returned with instructions.
Inputs: no named parameters. Returns: result
servicebus_list_queuesA
List all queues in an Azure Service Bus namespace.
Returns a sorted JSON array of queue names. The namespace can be given as a short name (e.g. shdapps-dev1-eus2-sbn) or as a fully qualified hostname — the .servicebus.windows.net suffix will be appended automatically if missing.
Inputs: namespace (required). Returns: result
servicebus_list_topicsA
List all topics in an Azure Service Bus namespace.
Returns a sorted JSON array of topic names. If include_subscriptions is true, returns a JSON object mapping each topic name to a sorted array of its subscription names. The namespace can be given as a short name (e.g. shdapps-dev1-eus2-sbn) or as a fully qualified hostname — the .servicebus.windows.net suffix will be appended automatically if missing.
Inputs: namespace (required), include_subscriptions. Returns: result
servicebus_peek_dlqA
Non-destructively peek at messages in the dead letter queue for an Azure Service Bus queue.
Messages are not locked or consumed — this is a read-only operation. Returns message bodies, dead letter reason, error description, and other metadata. max_count is capped at 100. Use servicebus_peek_dlq_to_file instead if message bodies may be large.
Inputs: namespace (required), queue (required), max_count. Returns: result
servicebus_peek_dlq_to_fileA
Non-destructively peek at messages in the dead letter queue for an Azure Service Bus queue, saving bodies to a file.
Message bodies are written to output_file as JSON (keyed by sequence number). Only metadata (dead letter reason, error description, sequence number, enqueue time) is returned in context.
Inputs: namespace (required), queue (required), output_file (required), max_count. Returns: result
servicebus_peek_messagesA
Non-destructively peek at messages in an Azure Service Bus queue.
Messages are not locked or consumed — this is a read-only operation. Returns message bodies and metadata (sequence number, enqueue time, properties). max_count is capped at 100. For session-enabled queues, provide a session_id to peek a specific session. If session_id is omitted on a session-enabled queue, the next available session is accepted, peeked, and immediately released. Use servicebus_peek_messages_to_file instead if message bodies may be large.
Inputs: namespace (required), queue (required), max_count, session_id. Returns: result
servicebus_peek_messages_to_fileA
Non-destructively peek at messages in an Azure Service Bus queue, saving bodies to a file.
Message bodies are written to output_file as JSON (keyed by sequence number). Only metadata (sequence number, enqueue time, properties) is returned in context — use this variant when message bodies may be large to avoid filling the context window. For session-enabled queues, provide a session_id to peek a specific session. If session_id is omitted on a session-enabled queue, the next available session is accepted, peeked, and immediately released.
Inputs: namespace (required), queue (required), output_file (required), max_count, +1 more. Returns: result
servicebus_peek_subscription_dlqA
Non-destructively peek at messages in the dead letter queue for a topic subscription.
Messages are not locked or consumed — this is a read-only operation. Returns message bodies, dead letter reason, error description, and other metadata. max_count is capped at 100. Use servicebus_peek_subscription_dlq_to_file instead if message bodies may be large.
Inputs: namespace (required), topic (required), subscription (required), max_count. Returns: result
servicebus_peek_subscription_dlq_to_fileA
Non-destructively peek at messages in the dead letter queue for a topic subscription, saving bodies to a file.
Message bodies are written to output_file as JSON (keyed by sequence number). Only metadata (dead letter reason, error description, sequence number, enqueue time) is returned in context.
Inputs: namespace (required), topic (required), subscription (required), output_file (required), +1 more. Returns: result
servicebus_peek_subscription_messagesA
Non-destructively peek at messages in an Azure Service Bus topic subscription.
Messages are not locked or consumed — this is a read-only operation. Returns message bodies and metadata (sequence number, enqueue time, properties). max_count is capped at 100. For session-enabled subscriptions, provide a session_id to peek a specific session. If session_id is omitted on a session-enabled subscription, the next available session is accepted, peeked, and immediately released. Use servicebus_peek_subscription_messages_to_file instead if message bodies may be large.
Inputs: namespace (required), topic (required), subscription (required), max_count, +1 more. Returns: result
servicebus_peek_subscription_messages_to_fileA
Non-destructively peek at messages in an Azure Service Bus topic subscription, saving bodies to a file.
Message bodies are written to output_file as JSON (keyed by sequence number). Only metadata (sequence number, enqueue time, properties) is returned in context — use this variant when message bodies may be large to avoid filling the context window. For session-enabled subscriptions, provide a session_id to peek a specific session. If session_id is omitted on a session-enabled subscription, the next available session is accepted, peeked, and immediately released.
Inputs: namespace (required), topic (required), subscription (required), output_file (required), +2 more. Returns: result
servicebus_purge_dlqA
Delete all messages from the dead letter queue for an Azure Service Bus queue.
THIS IS DESTRUCTIVE — messages cannot be recovered after purging. Stops and leaves remaining messages untouched if the running total exceeds max_messages.
Inputs: namespace (required), queue (required), max_messages. Returns: result
servicebus_purge_queueA
Delete all messages from an Azure Service Bus queue.
THIS IS DESTRUCTIVE — messages cannot be recovered after purging. Stops and leaves remaining messages untouched if the running total exceeds max_messages.
Inputs: namespace (required), queue (required), max_messages. Returns: result
servicebus_purge_subscriptionA
Delete all messages from an Azure Service Bus topic subscription.
THIS IS DESTRUCTIVE — messages cannot be recovered after purging. Stops and leaves remaining messages untouched if the running total exceeds max_messages.
Inputs: namespace (required), topic (required), subscription (required), max_messages. Returns: result
servicebus_purge_subscription_dlqA
Delete all messages from the dead letter queue for a topic subscription.
THIS IS DESTRUCTIVE — messages cannot be recovered after purging. Stops and leaves remaining messages untouched if the running total exceeds max_messages.
Inputs: namespace (required), topic (required), subscription (required), max_messages. Returns: result
servicebus_requeue_dlqA
Move messages from a queue's dead letter queue back to the main queue.
Each message is re-sent to the main queue preserving body, session_id, correlation_id, and application_properties, then completed (removed) from the dead letter queue. Stops if the running total would exceed max_messages.
Inputs: namespace (required), queue (required), max_messages. Returns: result
servicebus_requeue_subscription_dlqA
Move messages from a topic subscription's dead letter queue back to the topic.
Each message is re-sent to the topic preserving body, session_id, correlation_id, and application_properties, then completed (removed) from the dead letter queue. Stops if the running total would exceed max_messages.
Inputs: namespace (required), topic (required), subscription (required), max_messages. Returns: result
servicebus_send_batchA
Send multiple messages to an Azure Service Bus queue or topic in a single batch.
Each message in the 'messages' array should have:
body (string, required): the message content
session_id (string, optional)
correlation_id (string, optional)
application_properties (object, optional): key/value map of custom properties
scheduled_enqueue_time (string, optional): ISO 8601 time to enqueue the message
The entire batch is delivered in a single send operation. Useful for seeding test data.
Inputs: namespace (required), queue (required), messages (required). Returns: result
servicebus_send_messageA
Send a single message to an Azure Service Bus queue or topic.
The namespace can be given as a short name (e.g. shdapps-dev1-eus2-sbn) or as a fully qualified hostname — the .servicebus.windows.net suffix will be appended automatically if missing.
scheduled_enqueue_time accepts an ISO 8601 string (e.g. '2026-03-05T10:00:00Z'). If provided, the message will be enqueued at that time rather than immediately.
Auth uses DefaultAzureCredential. Ensure you have run 'az login' before use.
Inputs: namespace (required), queue (required), body (required), session_id, +3 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 19 tools
Every tool has a clearly distinct purpose, indicated by the combination of verb (list, peek, purge, requeue, send) and object (namespace, queue, topic, dlq, subscription). Even the file variants are explicitly differentiated for handling large payloads.
All tools follow a consistent 'servicebus_<verb>_<object>' pattern using snake_case. The verbs and objects are uniform, making the tool set predictable and easy to navigate.
With 19 tools, the server covers the essential operations for monitoring, debugging, and message remediation in Azure Service Bus. The count is well-scoped for its purpose without being excessive or overly sparse.
While the tool set is strong for message-level operations (peek, purge, requeue, send), it lacks management capabilities such as creating, deleting, or updating queues, topics, and subscriptions. This leaves a significant gap for full lifecycle management of Service Bus entities.
Maintenance
Related MCP Connectors
The MCP server for Azure DevOps, bringing the power of Azure DevOps directly to your agents.
Host any HTTP API as a standard MCP server; auto-distribute to 12+ mainstream agent platforms.
Hosted MCP messaging across owners, tools, and machines, with readable transcripts.
An MCP server that provides access to Agility CMS. See https://mcp.agilitycms.com for more details.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server for interacting with Azure. Contains some common Compute and Networking actions, and extensible to add many more.1Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Azure DevOps services including work items, repositories, pipelines, wikis, and test plans through a local MCP server that provides direct access to Azure DevOps REST APIs from your code editor.142,984 npmMIT
- AlicenseNot gradedqualityBmaintenanceThe most complete MCP server for Microsoft Dataverse.218 npm18MIT
- AlicenseAqualityDmaintenanceAn MCP server for Azure development and operations, enabling Cosmos DB queries, Service Bus messaging, and PIM role activation.3128 PyPIMIT