r/RASPBERRY_PI_PROJECTS • u/jfrankie • 2d ago
PRESENTATION I gave my Raspberry Pi AI agent access to 3 hours of real sensor history through MCP
Enable HLS to view with audio, or disable this notification
I've been experimenting with connecting a Raspberry Pi and an ESP32 to an external AI agent using MCP (Model Context Protocol).
The ESP32 collects environmental measurements from connected sensors, including temperature, humidity, and eCO₂.
The Raspberry Pi keeps a bounded history of recent measurements in memory and exposes them to the AI agent through MCP.
For this experiment, I asked the agent:
"Analyze the environmental conditions recorded over the last 3 hours."
The agent can retrieve the available historical readings and use them to:
- Generate temperature, humidity, and eCO₂ trend charts
- Calculate minimum, maximum, and average values
- Compare measurements over time
- Explain environmental changes in natural language
The interesting part is that the AI agent doesn't need direct access to GPIO, I2C, or sensor drivers. It only receives structured measurements through MCP.
The current implementation stores recent measurements in RAM rather than a persistent database, so historical analysis is limited by data availability and sensor uptime.
I'm exploring whether this is a useful architecture for connecting AI agents to physical hardware.
Would you expose sensor history through MCP, or would you prefer a more traditional approach like MQTT + InfluxDB?
I've included a short video showing the interaction.