Rediger

Azure MCP Server tools for Azure IoT Hub

The Azure Model Context Protocol (MCP) Server lets you inspect Azure IoT Hub resources with natural language prompts. You can list registered devices, inspect a device identity, retrieve registry statistics, read a device twin, and get details about an IoT hub.

Azure IoT Hub enables secure, bidirectional communication between IoT devices and cloud backends. For more information, see Azure IoT Hub documentation.

Note

Tool parameters: The Azure MCP Server tools define parameters for data they need to complete tasks. Some of these parameters are specific to each tool and are documented here. Other parameters are global and shared by all tools. For more information, see Tool parameters.

Device: List

Lists device identity metadata in an Azure IoT Hub device registry without returning authentication keys. Use the max count parameter to limit results. The default and maximum value is 100; larger values return an error. If more devices exist, the response sets truncated=true. Hub names and IDs are case-sensitive and must match exactly.

Example CLI command

azmcp iothub device list \
  --hub-name <hub-name> \
  --resource-group <resource-group> \
  [--max-count <max-count>]
Parameter Type Required Description
hub-name string Yes The name of the IoT Hub.
resource-group string Yes The Azure resource group name.
max-count string No The maximum number of items to return per page. Defaults to 100 when not specified. Values greater than 100 are rejected with an error.

Tool annotation hints:

Destructive Idempotent Open World Read Only Secret Local Required
❌ ❌ ❌ ✅ ❌ ❌

Device: Show

Retrieves identity metadata for one device in an IoT Hub device registry without returning authentication secrets. Device names and IDs are case-sensitive and must match exactly. A registered or enabled identity doesn't prove that the device is connected.

Example CLI command

azmcp iothub device show \
  --hub-name <hub-name> \
  --resource-group <resource-group> \
  --device-id <device-id>
Parameter Type Required Description
hub-name string Yes The name of the IoT Hub.
resource-group string Yes The Azure resource group name.
device-id string Yes The device identifier in the IoT Hub device registry.

Tool annotation hints:

Destructive Idempotent Open World Read Only Secret Local Required
❌ ❌ ❌ ✅ ❌ ❌

Device: Statistics

Retrieves aggregate device counts from an IoT Hub identity registry: disabledDeviceCount, enabledDeviceCount, and totalDeviceCount. Enabled devices aren't necessarily connected. Hub names and IDs are case-sensitive and must match exactly.

Example CLI command

azmcp iothub device stats \
  --hub-name <hub-name> \
  --resource-group <resource-group>
Parameter Type Required Description
hub-name string Yes The name of the IoT Hub.
resource-group string Yes The Azure resource group name.

Tool annotation hints:

Destructive Idempotent Open World Read Only Secret Local Required
❌ ❌ ❌ ✅ ❌ ❌

Device twin: Get

Retrieves the device twin document from an IoT Hub device registry, including tags and desired and reported properties. Device names and IDs are case-sensitive and must match exactly. This operation reads a snapshot; it doesn't subscribe to twin changes or prove current connectivity or telemetry delivery.

Example CLI command

azmcp iothub device twin get \
  --hub-name <hub-name> \
  --resource-group <resource-group> \
  --device-id <device-id>
Parameter Type Required Description
hub-name string Yes The name of the IoT Hub.
resource-group string Yes The Azure resource group name.
device-id string Yes The device identifier in the IoT Hub device registry.

Tool annotation hints:

Destructive Idempotent Open World Read Only Secret Local Required
❌ ❌ ❌ ✅ ❌ ❌

These device tools inspect IoT Hub device-registry records, not Azure Device Registry device records.

Hub: Get

Retrieves details for an Azure IoT Hub by name in a resource group and subscription. Returns the IoT hub's id, name, location, resourceGroup, subscriptionId, sku, capacity, state, and hostName.

Example CLI command

azmcp iothub hub get \
  --hub-name <hub-name> \
  --resource-group <resource-group>
Parameter Type Required Description
hub-name string Yes The name of the IoT Hub.
resource-group string Yes The Azure resource group name.

Tool annotation hints:

Destructive Idempotent Open World Read Only Secret Local Required
❌ ✅ ❌ ✅ ❌ ❌