azure-utils-mcp
v0.2.0MCP server for Azure Service Bus, Cosmos DB, and PIM role management
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
cosmosdb_list_accounts
List all Azure Cosmos DB accounts 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.
cosmosdb_list_databases
List all databases in an Azure Cosmos DB account. Returns a sorted JSON array of database names. The account can be given as a short name (e.g. my-cosmos-account) or as a full endpoint URL — the https:// prefix and .documents.azure.com suffix will be added automatically if missing. key_env_var: name of the environment variable holding the Cosmos DB account key. If the variable is set, key-based auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
account * | string | |
key_env_var | string |
cosmosdb_list_containers
List all containers in a Cosmos DB database. Returns a sorted JSON array of container names. The account can be given as a short name or full endpoint URL. key_env_var: name of the environment variable holding the Cosmos DB account key. If the variable is set, key-based auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
account * | string | |
database * | string | |
key_env_var | string |
cosmosdb_get_container_info
Get metadata for a Cosmos DB container. Returns partition key path, indexing policy, default TTL, unique key policy, and system properties (_self, _etag, _ts). The account can be given as a short name or full endpoint URL. key_env_var: name of the environment variable holding the Cosmos DB account key. If the variable is set, key-based auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
account * | string | |
container * | string | |
database * | string | |
key_env_var | string |
cosmosdb_query_items
Run a SQL query against a Cosmos DB container and return results. Uses Cosmos DB SQL API syntax, e.g.: SELECT * FROM c WHERE c.status = 'active' SELECT c.id, c.name FROM c ORDER BY c._ts DESC max_items is capped at 1000. Cross-partition queries are enabled automatically. Use cosmosdb_query_items_to_file instead if the result set may be large. key_env_var: name of the environment variable holding the Cosmos DB account key. If the variable is set, key-based auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
account * | string | |
container * | string | |
database * | string | |
query * | string | |
key_env_var | string | |
max_items | integer |
cosmosdb_query_items_to_file
Run a SQL query against a Cosmos DB container and save results to a file. Results are written to output_file as a JSON array. Only the item count is returned in context — use this variant when the result set may be large to avoid filling the context window. max_items is capped at 1000. key_env_var: name of the environment variable holding the Cosmos DB account key. If the variable is set, key-based auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
account * | string | |
container * | string | |
database * | string | |
output_file * | string | |
query * | string | |
key_env_var | string | |
max_items | integer |
cosmosdb_count_items
Count items in a Cosmos DB container, with an optional filter. where accepts a SQL WHERE clause body (without the WHERE keyword), e.g.: c.status = 'active' c.createdAt > '2025-01-01' If where is omitted, counts all items in the container. Returns a JSON object with a 'count' field. key_env_var: name of the environment variable holding the Cosmos DB account key. If the variable is set, key-based auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
account * | string | |
container * | string | |
database * | string | |
key_env_var | string | |
where |
cosmosdb_read_item
Read a single item from a Cosmos DB container by ID and partition key. Returns the full item document as JSON. Both item_id and partition_key are required — Cosmos DB requires the partition key for efficient point reads. key_env_var: name of the environment variable holding the Cosmos DB account key. If the variable is set, key-based auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
account * | string | |
container * | string | |
database * | string | |
item_id * | string | |
partition_key * | string | |
key_env_var | string |
cosmosdb_upsert_item
Insert or replace an item in a Cosmos DB container. The item must include an 'id' field. If an item with the same id and partition key already exists it will be replaced; otherwise a new item is created. Returns the stored item document (including system fields) as JSON. key_env_var: name of the environment variable holding the Cosmos DB account key. If the variable is set, key-based auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
account * | string | |
container * | string | |
database * | string | |
item * | object | |
key_env_var | string |
cosmosdb_delete_item
Delete an item from a Cosmos DB container. THIS IS DESTRUCTIVE — the item cannot be recovered after deletion. Both item_id and partition_key are required. key_env_var: name of the environment variable holding the Cosmos DB account key. If the variable is set, key-based auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
account * | string | |
container * | string | |
database * | string | |
item_id * | string | |
partition_key * | string | |
key_env_var | string |
servicebus_list_namespaces
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.
servicebus_list_queues
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. connection_string_env_var: name of the environment variable holding the Service Bus connection string. If the variable is set, connection-string auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
namespace * | string | |
connection_string_env_var | string |
servicebus_list_topics
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 or fully qualified hostname. connection_string_env_var: name of the environment variable holding the Service Bus connection string. If the variable is set, connection-string auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
namespace * | string | |
connection_string_env_var | string | |
include_subscriptions | boolean |
servicebus_send_message
Send a single message to an Azure Service Bus queue or topic. The namespace can be given as a short name or fully qualified hostname. 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. connection_string_env_var: name of the environment variable holding the Service Bus connection string. If the variable is set, connection-string auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
body * | string | |
namespace * | string | |
queue * | string | |
application_properties | ||
connection_string_env_var | string | |
correlation_id | ||
scheduled_enqueue_time | ||
session_id |
servicebus_send_batch
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. connection_string_env_var: name of the environment variable…
| Parameter | Type | Description |
|---|---|---|
messages * | array | |
namespace * | string | |
queue * | string | |
connection_string_env_var | string |
servicebus_peek_messages
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. connection_string_env_var: name of the…
| Parameter | Type | Description |
|---|---|---|
namespace * | string | |
queue * | string | |
connection_string_env_var | string | |
max_count | integer | |
session_id |
servicebus_peek_messages_to_file
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. connection_string_env_var: name of the environment variable holding the Service Bus connection string. If the variable is set, connection-string auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
namespace * | string | |
output_file * | string | |
queue * | string | |
connection_string_env_var | string | |
max_count | integer | |
session_id |
servicebus_peek_dlq
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. connection_string_env_var: name of the environment variable holding the Service Bus connection string. If the variable is set, connection-string auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
namespace * | string | |
queue * | string | |
connection_string_env_var | string | |
max_count | integer |
servicebus_peek_dlq_to_file
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. connection_string_env_var: name of the environment variable holding the Service Bus connection string. If the variable is set, connection-string auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
namespace * | string | |
output_file * | string | |
queue * | string | |
connection_string_env_var | string | |
max_count | integer |
servicebus_purge_dlq
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. connection_string_env_var: name of the environment variable holding the Service Bus connection string. If the variable is set, connection-string auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
namespace * | string | |
queue * | string | |
connection_string_env_var | string | |
max_messages | integer |
servicebus_requeue_dlq
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. connection_string_env_var: name of the environment variable holding the Service Bus connection string. If the variable is set, connection-string auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
namespace * | string | |
queue * | string | |
connection_string_env_var | string | |
max_messages | integer |
servicebus_purge_queue
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. connection_string_env_var: name of the environment variable holding the Service Bus connection string. If the variable is set, connection-string auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
namespace * | string | |
queue * | string | |
connection_string_env_var | string | |
max_messages | integer |
servicebus_peek_subscription_messages
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. Use servicebus_peek_subscription_messages_to_file instead if message bodies may be large. connection_string_env_var: name of the environment variable holding the Service Bus connection string. If the variable is set, connection-string auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
namespace * | string | |
subscription * | string | |
topic * | string | |
connection_string_env_var | string | |
max_count | integer | |
session_id |
servicebus_peek_subscription_messages_to_file
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. connection_string_env_var: name of the environment variable holding the Service Bus connection string. If the variable is set, connection-string auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
namespace * | string | |
output_file * | string | |
subscription * | string | |
topic * | string | |
connection_string_env_var | string | |
max_count | integer | |
session_id |
servicebus_peek_subscription_dlq
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. connection_string_env_var: name of the environment variable holding the Service Bus connection string. If the variable is set, connection-string auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
namespace * | string | |
subscription * | string | |
topic * | string | |
connection_string_env_var | string | |
max_count | integer |
servicebus_peek_subscription_dlq_to_file
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. connection_string_env_var: name of the environment variable holding the Service Bus connection string. If the variable is set, connection-string auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
namespace * | string | |
output_file * | string | |
subscription * | string | |
topic * | string | |
connection_string_env_var | string | |
max_count | integer |
servicebus_purge_subscription
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. connection_string_env_var: name of the environment variable holding the Service Bus connection string. If the variable is set, connection-string auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
namespace * | string | |
subscription * | string | |
topic * | string | |
connection_string_env_var | string | |
max_messages | integer |
servicebus_purge_subscription_dlq
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. connection_string_env_var: name of the environment variable holding the Service Bus connection string. If the variable is set, connection-string auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
namespace * | string | |
subscription * | string | |
topic * | string | |
connection_string_env_var | string | |
max_messages | integer |
servicebus_requeue_subscription_dlq
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. connection_string_env_var: name of the environment variable holding the Service Bus connection string. If the variable is set, connection-string auth is used; otherwise DefaultAzureCredential is used.
| Parameter | Type | Description |
|---|---|---|
namespace * | string | |
subscription * | string | |
topic * | string | |
connection_string_env_var | string | |
max_messages | integer |
authorization_list_eligible_roles
List all Azure PIM roles you are eligible to activate, across all accessible subscriptions. Returns role name, scope, eligibility status, and whether the eligibility is permanent or time-limited. Use this to discover what roles are available before calling authorization_activate_role.
authorization_activate_role
Activate an eligible Azure PIM role assignment. role: the role name exactly as returned by authorization_list_eligible_roles (e.g. 'Contributor') scope: the scope to activate on, exactly as returned by authorization_list_eligible_roles justification: reason for activation (required by Azure PIM) duration: optional ISO 8601 duration string (e.g. 'PT4H', 'PT30M'). Defaults to the maximum duration allowed by the role's policy. Capped at the policy maximum if exceeded. Returns the activation status and request ID. Status 'Provisioned' means immediately active.…
| Parameter | Type | Description |
|---|---|---|
justification * | string | |
role * | string | |
scope * | string | |
duration |