IoT-Edge-MCP-Server
Verified Safeby poly-mcp
Overview
A secure, production-ready IoT/Edge server designed to expose industrial protocols (MQTT, Modbus) via a unified HTTP API, enabling AI agents to monitor and control industrial infrastructure through the PolyMCP framework.
Installation
python IoT_mcp.pyEnvironment Variables
- IOT_ENV
- JWT_SECRET_KEY
- ENCRYPTION_KEY
- AUDIT_HMAC_KEY
- MQTT_COMMAND_HMAC_KEY
- ALLOWED_IP_RANGES
- API_KEYS
- MQTT_BROKER
- MQTT_PORT
- MQTT_USE_TLS
- MQTT_USERNAME
- MQTT_PASSWORD
- INFLUX_URL
- INFLUX_TOKEN
- INFLUX_ORG
- INFLUX_BUCKET
- REDIS_USE_SENTINEL
- REDIS_HOST
- REDIS_PORT
- REDIS_DB
- REDIS_PASSWORD
- REDIS_SSL
- MAX_REQUESTS_PER_MINUTE
- MAX_COMMANDS_PER_MINUTE
- MAX_QUERY_SIZE
- MAX_PAYLOAD_SIZE
- MAX_QUERY_HOURS
- PORT
Security Notes
The project demonstrates a high level of security awareness. It employs a security-first design with comprehensive measures: - **Input Validation & Sanitization:** Extensive use of `bleach` and custom validation (`validate_sensor_id`, `sanitize_dict`, etc.) prevents common injection attacks. - **Authentication & Authorization:** API key (`X-API-Key`) and JWT bearer token authentication, coupled with IP allowlisting (CIDR) and request/command rate limiting. - **Data Protection:** Fernet encryption for sensitive configuration data (passwords, tokens), and HMAC signatures for MQTT commands and audit log chaining (tamper-evident). - **Secrets Management:** Environment variables are strictly enforced for critical secrets in production mode, with ephemeral secrets generated in development only as a warning. - **Network Security:** MQTT supports TLS/SSL with client certificates. Modbus includes allowed address configuration per device. - **Audit Trail:** A robust audit logging system uses HMAC chaining to ensure log integrity. - **Dependency Security:** Relies on well-vetted libraries like `cryptography`, `pyjwt`, `passlib`, and `bleach`. - **Code Quality:** No obvious 'eval', obfuscation, or other immediately malicious patterns found. Error handling is generally good. The score is very high due to the comprehensive and thoughtful implementation of security, including defensive programming, strong cryptographic primitives, and secure defaults. Minor deductions account for the inherent complexity of integrating multiple protocols and external systems, which always carries some residual risk if not configured perfectly by the user.
Similar Servers
bifrost
A high-performance AI gateway with a unified interface for multiple LLM providers, offering real-time monitoring and configuration.
neurolink
NeuroLink is a comprehensive AI toolkit that unifies multiple AI providers, offers advanced orchestration, real-time services, and a Human-in-the-Loop safety system, allowing modular enhancement of AI models through an extensible MCP-compliant middleware and tool ecosystem.
rulego-server
A lightweight, high-performance, and modular automation workflow platform for orchestration, iPaaS, API/AI orchestration, data processing, and IoT rule engine scenarios.
thingspanel-mcp
Serves as a Model Context Protocol (MCP) server for the ThingsPanel IoT platform, enabling natural language interaction with IoT devices for querying information, monitoring status, controlling functions, and analyzing platform data.