An MCP server for my Aranet4 CO2 sensor

The device
only stores
a week

but I
wanted the
full
history

The device only stores a week, but I wanted the full history.

I recently bought an Aranet4 CO2 sensor to monitor the CO2 concentration in my home. There are studies showing that high CO2 concentration decreases cognitive performance significantly (I recommend to start your research with this video from DHH).

The Aranet4 seems to be (one of) the only devices with a dedicated co2 sensors, and is for sure the gold standard. Unfortunately, even though it is quite expensive (I spent 220 euros in italy), you cannot store historical data on the mobile app, which is limited to the 7 days stored in the device itself.

That's why I built these :

aranet4-archiver

github link - Some simple python scripts to fetch new data and store it in a sqlite database, and a few tools to visualize the data.

This has three basic features:

aranet4.py fetch to fetch the data from the aranet4 device and update a local sqlite db.

aranet4.py print to quickly print recent measurements.

aranet4.py plot to plot measurements in the last days. You can also specify a timerange.

aranet4-mcp-server

github link- Basically the same logic wrapped into an mcp server, to allow mcp clients, such as Claude, to fetch new data and ask about past measurements.

You can ask for example:

  • "Show me last 100 co2 measurements."
  • "Was the co2 yesterday at noon high? I was in a restaurant and I was sleepy."
  • "Plot aranet4 september co2 and temperature" to get an actual plot!

You can manage the configured aranet4:

  • "init aranet4" to start a guided configuration!
  • "Get configuration of aranet4" to just see the configuration.
  • "Scan aranet4 devices" to check if you have any aranet4 devices nearby.
  • "Fetch new aranet4 data" to fetch new data from embedded device memory and save to a local sqlite db.

Do I have to manually fetch data from the device?

Since the device only stored 7 days, I'm currently running fetch every 3 hours with a macos launchagent. You can find it in both repos.