IoT-Edge
MCP server for Industrial IoT, SCADA and PLC systems. Unifies MQTT sensors, Modbus devices and industrial equipment into a single AI-orchestrable API. Features real-time monitoring, alarms, time-series storage and actuator control.
claude mcp add --transport stdio poly-mcp-iot-edge-mcp-server python IoT_mcp.py \
--env IOT_ENV="production or development (override as needed)" \
--env API_KEYS="JSON string of API keys, e.g. {"admin":"key"}" \
--env AUDIT_HMAC_KEY=" HMAC key for audit trail" \
--env ENCRYPTION_KEY=" Fernet key (base64-encoded)" \
--env JWT_SECRET_KEY="your-secret-key" \
--env ALLOWED_IP_RANGES="CIDR ranges allowed to access the API" \
--env MQTT_COMMAND_HMAC_KEY="HMAC key for MQTT commands"How to use
IoT-Edge is a production-grade MCP server designed for Industrial IoT and edge ecosystems. It exposes a unified tool interface over HTTP via FastAPI and integrates MQTT, Modbus, InfluxDB, and Redis to provide real-time sensing, historical queries, actuator control, and PLC interactions. Running in production enables authentication, access control, encryption, and auditable logging to ensure safe operation in industrial environments. Use the MCP HTTP API to list available tools and invoke them, then leverage PolyMCP-enabled agents to orchestrate your devices through natural language commands. The included simulation path allows you to test with virtual sensors and actuators before connecting real hardware.
How to install
Prerequisites:
- Python 3.8+ (3.9+ recommended)
- Git
- Optional: virtual environment tools (venv)
Step-by-step:
-
Clone the repository: git clone https://github.com/yourusername/iot-mcp-server.git cd iot-mcp-server
-
Create and activate a virtual environment: python -m venv venv
macOS/Linux
source venv/bin/activate
Windows
venv\Scripts\activate
-
Install dependencies: pip install -r requirements.txt
-
Configure environment variables (example): export IOT_ENV=production export JWT_SECRET_KEY=$(python -c "import secrets; print(secrets.token_urlsafe(32))") export ENCRYPTION_KEY=$(python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())") export AUDIT_HMAC_KEY=$(python -c "import secrets; print(secrets.token_urlsafe(32))") export MQTT_COMMAND_HMAC_KEY=$(python -c "import secrets; print(secrets.token_urlsafe(32))") export ALLOWED_IP_RANGES="10.0.0.0/8,192.168.0.0/16" export API_KEYS='{"admin":"your-secure-api-key"}'
-
Run the server: python IoT_mcp.py
-
Optional: verify simulation mode (no hardware): python IoT_mcp_sim.py
Notes:
- The project uses Pydantic v2 APIs; ensure compatible package versions as listed in requirements.txt.
Additional notes
Tips and common considerations:
- Production mode is optional with MQTT, InfluxDB, Redis, and Modbus devices; you can operate in simulation mode without external dependencies.
- Ensure API key authentication and JWT tokens are properly configured to enforce access control.
- Use the MCP HTTP API endpoints at /mcp/list_tools, /mcp/invoke/{tool_name}, and /health for operational checks.
- If you enable TLS for MQTT or expose the API, rotate keys regularly and monitor audit trails for tampering.
- When integrating with PolyMCP, you can pair this server with various LLM providers (OpenAI, Ollama, Claude, etc.) through the standard UnifiedPolyAgent interface.
Related MCP Servers
flyto-core
The open-source execution engine for AI agents. 412 modules, MCP-native, triggers, queue, versioning, metering.
pubmed
A Model Context Protocol (MCP) server enabling AI agents to intelligently search, retrieve, and analyze biomedical literature from PubMed via NCBI E-utilities. Includes a research agent scaffold. STDIO & HTTP
mcp-batchit
š MCP aggregator for batching multiple tool calls into a single request. Reduces overhead, saves tokens, and simplifies complex operations in AI agent workflows.
mcp-agent
Lightweight, focused utilities to manage connections and execute MCP tools with minimal integration effort. Use it to directly call tools or build simple agents within your current architecture.
openapi-to
Transform OpenAPI specifications into production-ready MCP servers with AI-powered evaluation and enhancement. Leverages LLMs to analyze, improve, and generate Model Context Protocol implementations from your existing API documentation.
cadre-ai
Your AI agent squad for Claude Code. 17 specialized agents, persistent memory, desktop automation, and a common sense engine.