Get the FREE Ultimate OpenClaw Setup Guide →

stamplc -io

M5 StamPLC MCP Server Integration w/ n8n Agentic AI workflow

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio rezasaadat1-stamplc-mcp-server-io docker run -i stamplc-mcp-server-io

How to use

This MCP server implements a Model Context Protocol interface for the M5 StamPLC device. It exposes an HTTP endpoint for JSON-RPC style method calls, and an SSE endpoint for real-time updates. Core capabilities include reading digital inputs, controlling relays, logging to the device console, querying system and sensor information, managing the real-time clock, reading temperature and power metrics, and monitoring IO current. The server also reports status via an RGB LED on the device, with red indicating WiFi disconnection, green indicating successful time synchronization, white for normal operation, and blue when a command is received. To interact with the device, connect to the server’s HTTP endpoint to issue JSON-RPC requests (via /mcp) and subscribe to /events for live state changes. Use /capabilities to explore available methods. The included voice assistant and sample scripts provide additional ways to control and monitor the StamPLC through natural language and auxiliary automation tasks.

How to install

Prerequisites:

  • PlatformIO installed (or Arduino IDE with ESP32 support)
  • M5 StamPLC hardware
  • USB or network access for the ESP32 device

Installation steps:

  1. Clone the repository: git clone https://github.com/rezasaadat1/stamplc-mcp-server-io.git
  2. Connect your StamPLC device to your development machine
  3. In the project, locate wifi_config.h and replace credentials as needed (rename the template wifi_config-def.h to wifi_config.h then set: const char* WIFI_SSID = "YourWiFiSSID"; const char* WIFI_PASSWORD = "YourPassword";
  4. Build and upload the firmware using PlatformIO: cd stamplc-mcp-server-io pio run --target upload
  5. After successful upload, open the serial console to find the device IP address. The device will connect to WiFi, synchronize time via NTP, and start the MCP server. You can then interact using the device IP on ports 80/443 (as configured by the firmware).

Additional notes

Tips and notes:

  • The device will display status via the onboard RGB LED: red for WiFi disconnect, green for successful NTP/time sync, white for normal operation, and blue when a command is received.
  • Security: The MCP server in this implementation does not include authentication or encryption by default. For production deployments, consider enabling HTTPS, API authentication, input validation, and rate limiting.
  • SSE endpoint at /events provides real-time state updates; use it to keep client UIs in sync with inputs, relays, and sensor data.
  • Use /capabilities to see supported methods and their parameters, and /mcp for RPC calls. Sample JSON-RPC requests are included in the README under Example API Calls.
  • The Voice Assistant features rely on additional Python dependencies; ensure Python and required libraries are installed if you intend to use voice control.
  • If you encounter WiFi or time-sync issues, verify credentials, router compatibility, and that NTP access is not blocked in your network.

Related MCP Servers

Sponsor this space

Reach thousands of developers