Skip to content
VS Code

Sparkplug B for VS Code

io.github.nagarjunr/sparkplug-b

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

client:VS Code transport:stdio runtime:pypi

Install Sparkplug B in VS Code

.vscode/mcp.json

{
  "inputs": [
    {
      "type": "promptString",
      "id": "sparkplug-mqtt-host",
      "description": "SPARKPLUG_MQTT_HOST",
      "password": true
    },
    {
      "type": "promptString",
      "id": "sparkplug-host-id",
      "description": "SPARKPLUG_HOST_ID",
      "password": true
    },
    {
      "type": "promptString",
      "id": "sparkplug-mqtt-port",
      "description": "SPARKPLUG_MQTT_PORT",
      "password": true
    },
    {
      "type": "promptString",
      "id": "sparkplug-mqtt-username",
      "description": "SPARKPLUG_MQTT_USERNAME",
      "password": true
    },
    {
      "type": "promptString",
      "id": "sparkplug-mqtt-password",
      "description": "SPARKPLUG_MQTT_PASSWORD",
      "password": true
    },
    {
      "type": "promptString",
      "id": "sparkplug-mqtt-use-tls",
      "description": "SPARKPLUG_MQTT_USE_TLS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "sparkplug-group-id",
      "description": "SPARKPLUG_GROUP_ID",
      "password": true
    }
  ],
  "servers": {
    "sparkplug-b": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "sparkplug-b-mcp-server"
      ],
      "env": {
        "SPARKPLUG_MQTT_HOST": "${input:sparkplug-mqtt-host}",
        "SPARKPLUG_HOST_ID": "${input:sparkplug-host-id}",
        "SPARKPLUG_MQTT_PORT": "${input:sparkplug-mqtt-port}",
        "SPARKPLUG_MQTT_USERNAME": "${input:sparkplug-mqtt-username}",
        "SPARKPLUG_MQTT_PASSWORD": "${input:sparkplug-mqtt-password}",
        "SPARKPLUG_MQTT_USE_TLS": "${input:sparkplug-mqtt-use-tls}",
        "SPARKPLUG_GROUP_ID": "${input:sparkplug-group-id}"
      }
    }
  }
}

VS Code prompts for each input the first time the server starts, so no secret is written to the file. VS Code docs

Sparkplug B in other clients