This project demonstrates a Sparkplug B (SPB) implementation featuring a chat-based interface for industrial IoT monitoring and control. It combines a Sparkplug MCP server with a web application that allows users to query device data, analyze historical metrics, and monitor device status through natural language interactions. The system supports both real-time monitoring and historical analysis of device metrics, making it ideal for industrial automation and IoT applications.
Follow the steps below to set up and run the application:
- Clone the Repository
git clone https://github.com/emqx/uns-demo/
cd uns-demo-
The project use
uvto manage libs and project, please install uv before getting start. -
Some dependencies need to be compiled through cmake, please install cmake before getting start.
-
Install Dependencies and Activate Virtual Environment
uv sync
uv venvPlease refer to software preparation.
Steps
- Copy
.env.exampleto.envand modify the values accordingly. - Run sparkplug mcp server
uv run spb_server.py- Run biz mcp server
uv run biz_app.py- Run main application
uv run main.py- Open http://localhost:8000/ in browser.
- Type questions in the chatbox.
Refer to doc for detailed demo scenarios.