Sparkplug B

Registre officiel Autres

MCP server for Sparkplug B: node/device discovery, metrics, commands, host state over MQTT.

Installation

Ajoutez ceci à la configuration MCP de votre client (Claude Desktop : claude_desktop_config.json ; Cursor : .cursor/mcp.json ; VS Code et les autres utilisent la même forme « mcpServers »).

PYPI package sparkplug-b-mcp-server
Claude Code
claude mcp add sparkplug-b -e 'SPARKPLUG_MQTT_HOST=<SPARKPLUG_MQTT_HOST>' -e 'SPARKPLUG_HOST_ID=<SPARKPLUG_HOST_ID>' -e 'SPARKPLUG_MQTT_PORT=<SPARKPLUG_MQTT_PORT>' -e 'SPARKPLUG_MQTT_USERNAME=<SPARKPLUG_MQTT_USERNAME>' -e 'SPARKPLUG_MQTT_PASSWORD=<your sparkplug_mqtt_password>' -e 'SPARKPLUG_MQTT_USE_TLS=<SPARKPLUG_MQTT_USE_TLS>' -e 'SPARKPLUG_GROUP_ID=<SPARKPLUG_GROUP_ID>' -- uvx sparkplug-b-mcp-server==0.1.0
Configuration JSON (Claude Desktop, Cursor, VS Code)
{
    "mcpServers": {
        "sparkplug-b": {
            "command": "uvx",
            "args": [
                "sparkplug-b-mcp-server==0.1.0"
            ],
            "env": {
                "SPARKPLUG_MQTT_HOST": "<SPARKPLUG_MQTT_HOST>",
                "SPARKPLUG_HOST_ID": "<SPARKPLUG_HOST_ID>",
                "SPARKPLUG_MQTT_PORT": "<SPARKPLUG_MQTT_PORT>",
                "SPARKPLUG_MQTT_USERNAME": "<SPARKPLUG_MQTT_USERNAME>",
                "SPARKPLUG_MQTT_PASSWORD": "<your sparkplug_mqtt_password>",
                "SPARKPLUG_MQTT_USE_TLS": "<SPARKPLUG_MQTT_USE_TLS>",
                "SPARKPLUG_GROUP_ID": "<SPARKPLUG_GROUP_ID>"
            }
        }
    }
}

Variables d'environnement

  • SPARKPLUG_MQTT_HOST obligatoire MQTT broker hostname or IP.
  • SPARKPLUG_HOST_ID obligatoire This connector's Sparkplug Host Application ID (used in the spBv1.0/STATE/{id} topic).
  • SPARKPLUG_MQTT_PORT MQTT broker port, default 1883
  • SPARKPLUG_MQTT_USERNAME Broker username, if required
  • SPARKPLUG_MQTT_PASSWORD secret Broker password, if required
  • SPARKPLUG_MQTT_USE_TLS true/false, default false
  • SPARKPLUG_GROUP_ID Restrict discovery/watching to a single Sparkplug Group ID; omit to subscribe to every group

Documentation

Tirée du README du projet sur GitHub, actualisée chaque semaine. Les liens ouvrent GitHub.

Sommaire
  1. IoT MCP Servers
  2. Servers
  3. Structure
  4. Requirements
  5. Quick start
  6. Using with an MCP client
  7. Design principles
  8. Contributing
  9. License

IoT MCP Servers

MCP (Model Context Protocol) servers for IoT platforms — giving AI agents full read/write access to device registries, digital twins, and telemetry.

Servers

ServerPlatformToolsPackage
eclipse-dittoEclipse Ditto digital twins (open source; also compatible with Bosch IoT Things and other Ditto-based deployments)48
mqttMQTT 5.0 — the standard IoT pub/sub protocol (any broker: Mosquitto, EMQX, HiveMQ, AWS IoT Core, etc.)7
aws-iot-coreAWS IoT Core — device registry, shadows, jobs, rules, messaging48
azure-iot-hubAzure IoT Hub — device registry, twins, direct methods, jobs, messaging25
sparkplug-bSparkplug B — MQTT + protobuf convention for industrial/SCADA data (birth/death, sequenced metrics, commands)13

Each row links to that server's README for its full tool list, required environment variables, and setup/testing notes.

Structure

Each server is a standalone directory under this repo — its own pyproject.toml, uv.lock, Dockerfile, and mcp.json example config. No shared library layer: every server is independently runnable and dockerizable.

<server-name>/
├── <server-name>mcpserver.py   # FastMCP server (single file)
├── pyproject.toml              # own dependencies
├── uv.lock
├── Dockerfile
├── mcp.json                    # example MCP client config
└── README.md                   # tools, env vars, setup for this server

Requirements

  • Python 3.12+
  • uv for dependency management and running servers
  • Docker, only if you want to run a server's own test suite against a real/emulated instance (see that server's README)

Quick start

Install straight from PyPI with uv or pipx — no clone needed:

uvx eclipse-ditto-mcp-server      # or: mqtt5-mcp-server / aws-iot-core-mcp-server / azure-iot-hub-mcp-server / sparkplug-b-mcp-server

Or run from a clone of this repo:

git clone https://github.com/nagarjunr/iot-mcp-servers.git
cd iot-mcp-servers/<server-name>
uv sync
uv run <server-name>mcpserver.py

Each server reads its configuration from environment variables (connection strings, broker host, credentials, etc.) — see that server's README for the full list.

Using with an MCP client

Each server directory has an mcp.json with a ready-to-use client config example (Claude Desktop / VS Code / any MCP client). Copy the relevant block into your client's config, filling in the environment variables described in that server's README. All servers are also listed on the official MCP registry under io.github.nagarjunr/<server-name>.

Design principles

  • Read-only by default, writes explicit. Tools default to read/list operations. Any write tool is called out explicitly in that server's README. Create/replace tools default to create-only (overwrite=False) — race-free via conditional headers where the target API supports them (e.g. Ditto's If-None-Match), otherwise a documented describe-then-create check. Delete tools, where a server needs them, require an explicit confirm=True — there is no bulk/cascading delete.
  • No vendor lock-in. Connectors target the open protocol/API (e.g. Eclipse Ditto's HTTP API, the MQTT wire protocol), not a single vendor's proprietary extension of it, so they work against any compatible deployment. Exception: cloud-provider services like AWS IoT Core are inherently vendor-specific — no lock-in claim applies there, but no cross-vendor abstraction is invented either.
  • Tested against the real thing, with documented exceptions where no free real instance exists. Each server is verified against a real instance of the target platform (usually via Docker), not hand-rolled mocks. mqtt and sparkplug-b run against a real Eclipse Mosquitto broker (sparkplug-b's tests simulate the "device" side with the same real protocol library the server uses, so both ends of the wire are genuine). aws-iot-core is tested against moto (AWS IoT Core has no free local emulator; LocalStack's IoT support requires a paid plan). azure-iot-hub is tested against respx for its REST tools; its one AMQP-only tool (send_c2d_message — Azure IoT Hub's cloud-to-device send has no REST binding) is tested against a local fake AMQP endpoint built for this repo, since no moto-equivalent exists for Azure and no free Azure IoT Hub emulator exists at all. These are genuine emulators/protocol-level fakes, not naive mocks — see each server's README for specifics and caveats.

Contributing

Adding a new server? Follow the structure and design principles above, add its row to the Servers table, and make sure its test suite runs against a real or faithfully-emulated instance of the target platform (document any exception, as aws-iot-core and azure-iot-hub do). Issues and PRs welcome.

License

MIT — see LICENSE.

Questions fréquentes

Qu'est-ce que Sparkplug B ?

MCP server for Sparkplug B: node/device discovery, metrics, commands, host state over MQTT.

Comment installer Sparkplug B ?

Il s'exécute sur votre machine. Dans Claude Code : claude mcp add sparkplug-b -e 'SPARKPLUG_MQTT_HOST=<SPARKPLUG_MQTT_HOST>' -e 'SPARKPLUG_HOST_ID=<SPARKPLUG_HOST_ID>' -e 'SPARKPLUG_MQTT_PORT=<SPARKPLUG_MQTT_PORT>' -e 'SPARKPLUG_MQTT_USERNAME=<SPARKPLUG_MQTT_USERNAME>' -e 'SPARKPLUG_MQTT_PASSWORD=<your sparkplug_mqtt_password>' -e 'SPARKPLUG_MQTT_USE_TLS=<SPARKPLUG_MQTT_USE_TLS>' -e 'SPARKPLUG_GROUP_ID=<SPARKPLUG_GROUP_ID>' -- uvx sparkplug-b-mcp-server==0.1.0. Pour les autres clients, collez la configuration JSON de cette page dans leurs réglages MCP.

Faut-il une clé API pour Sparkplug B ?

Oui. Il attend SPARKPLUG_MQTT_HOST, SPARKPLUG_HOST_ID, SPARKPLUG_MQTT_PASSWORD, à renseigner dans sa configuration.

Sparkplug B est-il open source ?

Oui. Son code est sur GitHub sous licence MIT.

Qui maintient Sparkplug B ?

Il est publié par nagarjunr. AI.tn le référence sans le maintenir ni le recommander.

Issu du registre MCP officiel. Être listé n'est pas une recommandation : vérifiez le code et les permissions d'un serveur avant de lui donner accès à vos données.