GitHub
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
作者提供的说明(英文原文)
MCP server for Azure IoT Hub: device registry, twins, methods, jobs, messaging.
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
选择你使用的 AI 应用,然后复制设置。
AZURE_IOT_HUB_CONNECTION_STRING, AZURE_IOT_HUB_AMQP_PORT, AZURE_IOT_HUB_AMQP_USE_TLS标为机密的值是你账户的钥匙。千万不要分享给别人,也不要粘贴到聊天里。
你需要
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"azure-iot-hub": {
"command": "uvx",
"args": [
"azure-iot-hub-mcp-server"
],
"env": {
"AZURE_IOT_HUB_CONNECTION_STRING": "your-value",
"AZURE_IOT_HUB_AMQP_PORT": "your-value",
"AZURE_IOT_HUB_AMQP_USE_TLS": "your-value"
}
}
}
}在终端中运行这条命令
claude mcp add azure-iot-hub --env AZURE_IOT_HUB_CONNECTION_STRING=your-value --env AZURE_IOT_HUB_AMQP_PORT=your-value --env AZURE_IOT_HUB_AMQP_USE_TLS=your-value -- uvx azure-iot-hub-mcp-server运行前请先填写空着的值。
粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"azure-iot-hub": {
"command": "uvx",
"args": [
"azure-iot-hub-mcp-server"
],
"env": {
"AZURE_IOT_HUB_CONNECTION_STRING": "your-value",
"AZURE_IOT_HUB_AMQP_PORT": "your-value",
"AZURE_IOT_HUB_AMQP_USE_TLS": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"azure-iot-hub": {
"type": "stdio",
"command": "uvx",
"args": [
"azure-iot-hub-mcp-server"
],
"env": {
"AZURE_IOT_HUB_CONNECTION_STRING": "your-value",
"AZURE_IOT_HUB_AMQP_PORT": "your-value",
"AZURE_IOT_HUB_AMQP_USE_TLS": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
AZURE_IOT_HUB_AMQP_PORT envAZURE_IOT_HUB_AMQP_USE_TLS env这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月8日
注册名称已通过 GitHub 账户 nagarjunr 验证,该账户拥有此仓库
我们还没有从 GitHub 读取这个仓库
我们还没有从 GitHub 读取这个仓库
它在你的电脑上运行,没有互联网端点
在你的电脑上运行,改用本地设置
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
你需要填写:AZURE_IOT_HUB_CONNECTION_STRING
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
GitHub 仓库最后更新于–,最新版本(0.1.0)于4个月前进入注册中心。
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Python (uv)。
同一分类中有:GitHub, Desktop Commander, Cloudflare MCP
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
MCP server for terminal commands, file operations, and process management
Cloudflare MCP servers
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
A Model Context Protocol (MCP) server for Azure IoT Hub — device registry, device twins, direct methods, jobs, and messaging.
Scoped to IoT Hub's service-side data plane (device management), not Azure Resource Manager. Microsoft's own official Azure MCP Server already covers the ARM-level "show me my IoT Hub resource" case — this server covers the actual device-management capability that Azure MCP doesn't.
Calls Azure IoT Hub's REST Service API directly via httpx with a hand-rolled SAS token generator, rather than the official azure-iot-hub PyPI package — that package hard-depends on uamqp, a C-extension that fails to build on modern Python/platforms (confirmed: it doesn't install on Python 3.12/arm64). Built with FastMCP.
| Tool | Description |
|---|---|
list_devices(max_count) | List devices. For filtering, prefer query_devices. |
query_devices(query, max_item_count, continuation_token) | IoT Hub SQL-like query over devices/twins, with pagination. |
get_device(device_id) | Fetch a device's identity (auth mechanism, status, connection state). |
create_device(device_id, auth_type, ..., overwrite=False) | Register a device. |
update_device(device_id, status, status_reason, etag) | Update a device's enabled/disabled status. |
delete_device(device_id, confirm=False, etag) | Delete a device. Irreversible. |
| Tool | Description |
|---|---|
list_modules(device_id) / get_module(device_id, module_id) | List/read module identities on a device. |
create_module(device_id, module_id, ..., overwrite=False) | Register a module. |
delete_module(device_id, module_id, confirm=False) | Delete a module. Irreversible. |
| Tool | Description |
|---|---|
get_device_twin(device_id) / get_module_twin(device_id, module_id) | Read a twin (tags, desired/reported properties). |
update_device_twin(device_id, tags, desired_properties, etag) | Merge-update tags/desired properties. |
replace_device_twin(device_id, tags, desired_properties, etag) | Full replace (not merge) of tags/desired properties. |
update_module_twin(device_id, module_id, tags, desired_properties, etag) | Merge-update a module twin. |
| Tool | Description |
|---|---|
invoke_device_method(device_id, method_name, payload, ...) | Invoke a direct method on a device (blocks until the device responds or times out). |
invoke_module_method(device_id, module_id, method_name, payload, ...) | Same, scoped to a module. |
| Tool | Description |
|---|---|
create_scheduled_job(job_id, job_type, query_condition, ...) | Schedule a twin update or direct method across many devices matching a query. |
get_scheduled_job(job_id) / query_scheduled_jobs(job_type, job_status) | Read job status/results. |
cancel_scheduled_job(job_id, confirm=False) | Cancel a job. |
| Tool | Description |
|---|---|
send_c2d_message(device_id, payload, ...) | Send a cloud-to-device message. AMQP, not REST — see caveat below. |
purge_c2d_message_queue(device_id) | Delete all pending C2D messages queued for a device. |
| Tool | Description |
|---|---|
get_device_statistics() | Total/enabled/disabled device counts. |
get_service_statistics() | Service-level stats (e.g. connected device count). |
send_c2d_message is AMQP, not REST, and has no real-instance test coverageEvery other tool in this server wraps a documented REST endpoint. Cloud-to-device message sending is the one exception: Azure IoT Hub's REST API only exposes the *feedback* side of C2D messaging (delivery receipts); sending is AMQP-protocol-only (confirmed by reading the official azure-iot-hub SDK's source — it hands off to an AMQP client, not an HTTP call).
To support it without pulling in the broken uamqp dependency, send_c2d_message implements the CBS (Claims-Based Security) auth handshake and message send directly against python-qpid-proton (the standard AMQP 1.0 library, confirmed to install cleanly on modern Python). The protocol details (CBS field names, $cbs node, /messages/devicebound target address, to property format) were confirmed from Microsoft's own pure-Python AMQP implementation in azure-eventhub/azure-servicebus, not guessed.
This tool is not covered by real-instance testing. There's no free Azure IoT Hub emulator (see Testing below), and the test suite's respx HTTP mocking can't exercise AMQP at all. Tests instead run this against a local fake AMQP endpoint (also built with qpid-proton) that implements just enough of the CBS handshake and /messages/devicebound receiver to prove the wire protocol is well-formed — it does not validate genuine Azure IoT Hub business logic. Verify against a real hub before relying on this in production.
Same as the rest of this repo: create_* defaults to overwrite=False (best-effort describe-then-create check — IoT Hub's If-Match header is for optimistic-concurrency on updates, not create-only semantics, so this isn't fully race-free like Ditto's If-None-Match). Every delete_*/cancel_* requires confirm=True.
| Env var | Required | Description |
|---|---|---|
AZURE_IOT_HUB_CONNECTION_STRING | Yes | An IoT Hub connection string with service (or iothubowner) rights, e.g. HostName=my-hub.azure-devices.net;SharedAccessKeyName=service;SharedAccessKey=.... Find this under your hub's "Shared access policies" in the Azure portal. |
AZURE_IOT_HUB_AMQP_PORT | No | Default 5671. Only relevant to send_c2d_message. |
AZURE_IOT_HUB_AMQP_USE_TLS | No | true/false, default true. Set false only for local/test endpoints. |
AZURE_IOT_HUB_AMQP_HOSTNAME_OVERRIDE | No | Override the AMQP connection target (e.g. a local test fixture) without changing the REST hostname derived from the connection string. |
uv sync
export AZURE_IOT_HUB_CONNECTION_STRING="HostName=my-hub.azure-devices.net;SharedAccessKeyName=service;SharedAccessKey=..." uv run azureiothubmcpserver.py
See mcp.json for ready-to-use client configs (stdio and Docker).
This repo's design principles call for testing against a real instance rather than mocks. Azure IoT Hub has no official local emulator and no moto-equivalent exists for it. REST endpoints are tested with respx (httpx's dedicated mocking library, using realistic Azure response shapes); send_c2d_message is tested against a local fake AMQP endpoint (see caveat above).
uv run pytest -v
No bundled deployment artifacts here (unlike eclipse-ditto/mqtt) since there's no local broker/service to run — Azure IoT Hub only exists as an Azure-hosted service.