Francesco Azzola published a project on Hackster.io that connects an LLM agent to real sensors using a Raspberry Pi and the Model Context Protocol, or MCP, a standard way for AI agents to call outside tools.
An ESP32 handles the hardware. It reads environmental sensors, an ENS160 air-quality sensor and an MPU6050 motion sensor , and drives a WS2812B LED ring . It’s connected to the Pi over USB and sends newline-delimited JSON messages, so the Pi keeps an up-to-date picture of the room. The code tracks whether a reading is reliable or the sensor is still warming up, so an agent doesn’t report bad air quality from a sensor that hasn’t finished starting.
The Pi runs an MCP server inside the same application that owns the hardware. It exposes semantic tools, like a request for a description of the room, rather than raw register reads, so the agent doesn’t have to know which sensors exist. MCP resources also pass along a camera JPEG from the existing vision pipeline.…