Back to Home
poly-mcp icon

IoT-Edge-MCP-Server

Verified Safe

by 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

Run Command
python IoT_mcp.py

Environment 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

Stats

Interest Score42
Security Score9
Cost ClassLow
Avg Tokens750
Stars13
Forks5
Last Update2026-01-09

Tags

Industrial IoTEdge ComputingSCADAFastAPIAI Agents