Skip to main content
Glama
MatuZale

coldchain-mcp

by MatuZale

Cold-Chain MCP Server

PyPI version License: MIT

Analyze cold-chain sensor data with AI agents. Connect your temperature/humidity logger to Claude, Cursor, or any MCP client and ask in plain language: "did this shipment breach the cold chain?", "find the anomalies in this log", "split this file into separate journeys."

🔒 Privacy: all analysis runs locally. Your data never leaves your machine. No external APIs, no cloud. Suitable for compliance-sensitive environments.


What is this? (start here if you're new to MCP)

MCP (Model Context Protocol) is a standard way to give an AI assistant access to external tools. This project is an MCP server — a small program that runs on your computer and gives an AI agent four specialized tools for analyzing sensor time-series data.

The idea: instead of pasting thousands of temperature readings into a chat and hoping the AI does the math right, the AI calls these tools, which compute the answer deterministically (same input, same result, every time). You ask a question in plain language; the agent runs the right tool and gives you a structured report.


Related MCP server: PiQrypt MCP Server

Why use it

Language models are unreliable at statistics over large numeric series. They confuse a one-off sensor glitch with a real breach, lose track of timestamps, and produce different answers on re-runs. This server hands the agent deterministic, repeatable tools that get it right every time.


Tools

Tool

What it does

summary_stats

Summary statistics: min / max / mean / median / standard deviation, time range and duration.

detect_threshold_breaches

Detects threshold breaches (e.g. 2-8 degrees C) with minimum duration and hysteresis — separates a real breach from a momentary spike.

detect_anomalies

Flags outliers (global z-score, or deviation from a rolling mean).

segment_journey

Splits a continuous log into separate journeys based on time gaps (START/STOP).


Key distinction: a breach is not an anomaly

A sensor spiking to 40 degrees C for a single sample is an anomaly (a sensor glitch) — not a breach of the cold chain. A door left open, pushing the temperature to 12 degrees C for 20 minutes, is a breach, even though every individual reading looks plausible. This server distinguishes the two cases — exactly what a compliance audit requires.


Installation

The easiest way is with pip:

pip install coldchain-mcp

This installs the server and a command called coldchain-mcp. It's now ready to connect to any MCP client.

Alternative: from source

If you want to modify the server locally:

git clone https://github.com/matuzale/coldchain-mcp
cd coldchain-mcp
pip install -e .

Connecting to Claude Desktop

An MCP client (like Claude Desktop) needs to know how to start your server. You tell it through a small configuration file. Open Claude Desktop, go to Settings -> Developer -> Edit Config, and add a cold-chain entry.

If you installed with pip (recommended), the config is short — you just name the command:

{
  "mcpServers": {
    "cold-chain": {
      "command": "coldchain-mcp"
    }
  }
}

This works because pip install created a coldchain-mcp command that already knows where the code lives — so you don't have to point at any file.

If you're running from source instead, point at the script directly:

{
  "mcpServers": {
    "cold-chain": {
      "command": "python",
      "args": ["/full/path/to/coldchain-mcp/server.py"]
    }
  }
}

Windows note: if the short "command": "coldchain-mcp" form doesn't start the server, the install directory may not be on your system PATH. Either add Python's Scripts folder to PATH, or use the full path to coldchain-mcp.exe as the command.

After editing, fully restart Claude Desktop (quit from the system tray, not just the window). The tools appear automatically.


Data format

CSV with a header, or JSON. Column names are configurable via the ts_field and value_field parameters, and the parser recognizes common aliases (temp, temperature, time, value).

timestamp,value
2026-07-20T08:00:00,5.1
2026-07-20T08:05:00,4.9

JSON is also accepted:

[
  {"timestamp": "2026-07-20T08:00:00", "value": 5.1},
  {"timestamp": "2026-07-20T08:05:00", "value": 4.9}
]

Example (talking to the agent)

"Load sample_data.csv and check whether the shipment breached the 2-8 degrees C range. A breach only counts after 10 minutes."

The agent calls detect_threshold_breaches(min_temp=2, max_temp=8, min_duration_minutes=10) and returns a structured report of any breaches, with start time, end time, duration, and peak value.


Roadmap

  • PDF report export

  • MKT (Mean Kinetic Temperature) — pharmaceutical standard

  • Humidity support and temperature/humidity correlation

  • Multi-zone detectors for a single shipment


License

MIT — see LICENSE. You're free to use, modify, and distribute this, including commercially, as long as the copyright notice is retained.

Available Tools

4 tools
detect_anomaliesA

Wykrywa anomalie w szeregu czasowym (punkty odstające od normy).

Model językowy słabo liczy odchylenia statystyczne na tysiącach punktów — użyj tego narzędzia, by uzyskać deterministyczny, powtarzalny wynik.

Args: data: dane CSV lub JSON. method: "zscore" (globalny z-score) lub "rolling" (odchylenie od średniej kroczącej). sensitivity: próg w liczbie odchyleń standardowych (domyślnie 3.0). window: rozmiar okna dla metody "rolling" (liczba próbek). 0 = auto (~5% danych). ts_field, value_field: nazwy kolumn.

Returns: JSON z listą anomalii (czas, wartość, odchylenie) i podsumowaniem.

ParametersJSON Schema
NameRequiredDescriptionDefault
dataYes
methodNozscore
windowNo
ts_fieldNotimestamp
sensitivityNo
value_fieldNovalue

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The Returns section discloses the output shape (JSON with anomaly list and summary). It documents the deterministic nature of the tool ('deterministyczny, powtarzalny wynik'), which is a key behavioral trait. With no annotations provided, the description carries the burden and reasonably discloses the detection methods and return format, though it doesn't specify error conditions or data format constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with Args and Returns sections, front-loading the purpose and rationale before parameter details. It's compact with no wasted sentences, though the rationale sentence about LLM weaknesses, while useful, could be considered slightly extraneous to purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 6 parameters, low schema coverage, and no annotations, the description provides strong coverage: purpose, both methods, defaults, return format, and the statistical rationale. The output schema exists and is referenced. Minor gaps: exact accepted data formats (CSV/JSON shape) are only mentioned briefly, and error handling isn't discussed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It explains each parameter: data, method (with both options and what each computes), sensitivity (threshold in std deviations, default 3.0), window (with auto behavior at 0), and ts_field/value_field ('nazwy kolumn'). This adds substantial meaning beyond bare schema titles, though exact formats for data strings are only loosely implied.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool detects anomalies in time series (outlier points), uses a specific verb+resource structure, and distinguishes it from siblings (e.g., detect_threshold_breaches for a different anomaly type). The rationale for use (LLMs poorly compute statistical deviations on thousands of points) adds real purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly explains WHEN to use this tool (when deterministic, repeatable anomaly detection is needed) and contrasts it with the LLM's weakness. It doesn't explicitly name alternatives like detect_threshold_breaches to disambiguate, but sibling tools are clearly different enough. The window auto-sizing note provides practical guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

detect_threshold_breachesA

Wykrywa przekroczenia progów temperatury (naruszenia łańcucha chłodniczego).

Kluczowe dla compliance: krótkie, chwilowe skoki często NIE liczą się jako naruszenie — dopiero przekroczenie utrzymane przez min_duration_minutes. Histereza zapobiega fałszywym wielokrotnym alarmom przy wahaniach wokół progu.

Args: data: dane CSV lub JSON. min_temp: dolny próg (np. 2.0 dla produktów 2-8°C). None = brak dolnego progu. max_temp: górny próg (np. 8.0). None = brak górnego progu. min_duration_minutes: minimalny czas trwania przekroczenia, by liczyło się jako naruszenie. hysteresis: margines histerezy; przekroczenie kończy się dopiero gdy wartość wróci o hysteresis poniżej/powyżej progu. ts_field, value_field: nazwy kolumn.

Returns: JSON z listą naruszeń (typ, początek, koniec, czas trwania, wartość szczytowa) oraz podsumowaniem.

ParametersJSON Schema
NameRequiredDescriptionDefault
dataYes
max_tempNo
min_tempNo
ts_fieldNotimestamp
hysteresisNo
value_fieldNovalue
min_duration_minutesNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the behavioral burden. It does a good job explaining the behavioral nuances (duration threshold, hysteresis logic) that govern the tool's detection output. However, it doesn't disclose what happens with missing data, how the JSON vs CSV data detection works, or error cases. The core detection behavior is well disclosed, but edge cases are left undocumented.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-organized: purpose statement, key behavioral notes, Args list, and Returns section. It front-loads the critical compliance insight before diving into parameters. The Args and Returns sections are clearly structured. Slightly verbose with the compliance preamble, but every sentence adds value for a compliance-critical tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has 7 parameters with 0% schema coverage, but the description explains all of them with examples. An output schema exists, so the Returns description doesn't need full detail but still outlines what's returned (list of violations with type, start, end, duration, peak value, and summary). For a complex detection tool with nuanced semantics, the coverage is quite complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description fully compensates. Every parameter is explained: min_temp and max_temp with concrete examples (2.0 and 8.0 for 2-8°C products), None semantics for absent thresholds, min_duration_minutes meaning, hysteresis semantics, and ts_field/value_field purposes. The description adds substantial meaning beyond the bare schema field names.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it detects temperature threshold breaches (cold chain violations). It specifies the exact verb (wykrywa/detects), the resource (threshold breaches), and the domain (cold chain). It provides strong detail about what constitutes a violation (duration, hysteresis), which clearly distinguishes it from sibling tools like detect_anomalies and summary_stats.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains key compliance semantics: brief momentary spikes often do NOT count as violations, only those sustained past min_duration_minutes count, and hysteresis prevents false repeated alarms. This gives clear context for when to trust the tool's output. However, it doesn't explicitly contrast with sibling tools like detect_anomalies, so there's no direct 'use this instead of X' guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

segment_journeyA

Dzieli ciągły log na osobne "przejazdy" (journeys) na podstawie przerw czasowych.

Logger transportowy często rejestruje wiele przejazdów w jednym pliku. Przerwa dłuższa niż gap_minutes oznacza granicę między przejazdami.

Args: data: dane CSV lub JSON. gap_minutes: przerwa czasowa (w minutach) traktowana jako granica przejazdu. ts_field, value_field: nazwy kolumn.

Returns: JSON z listą segmentów (numer, start, koniec, czas trwania, liczba próbek, min/max/średnia temperatura w segmencie).

ParametersJSON Schema
NameRequiredDescriptionDefault
dataYes
ts_fieldNotimestamp
gap_minutesNo
value_fieldNovalue

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so description carries the burden. It discloses the input formats (CSV or JSON), the segmentation rule, and the output structure (segments with number, start, end, duration, sample count, temperature stats). It doesn't mention edge cases like single-sample segments, how the first/last segment boundary is handled, or data quality behavior for missing timestamps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is reasonably concise with front-loaded purpose, followed by context, parameter docs, and return format. No wasted sentences. The Polish language is consistent throughout, and the structure (purpose, context, args, returns) is logical and scannable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values don't need to be described in detail—yet the description still provides a useful summary of the output fields. No annotations, so the description reasonably covers the tool's behavior. For a 4-parameter tool with CSV/JSON input flexibility, the description is adequate, though it could mention error conditions or how the timestamp field is parsed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description compensates partially by explaining each parameter in Polish: data (CSV/JSON), gap_minutes (the time gap threshold), ts_field and value_field (column names). The names and defaults in the schema are fairly self-explanatory, and the description adds modest context about their roles but doesn't cover defaults meaning or edge cases for malformed data.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb+resource action: 'Dzieli ciągły log na osobne przejazdy' (divides continuous log into separate journeys) based on time gaps. It distinguishes this from siblings (which focus on stats, threshold detection, and anomaly detection) by specifying the segmentation logic. However, it doesn't explicitly contrast with sibling tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to use this tool: when a transport logger records multiple journeys in a single file and you need to split them. It clearly defines the triggering condition (gap longer than gap_minutes marks a boundary). It could be improved by mentioning what it's NOT for (e.g., not for computing summary stats or detecting anomalies, which siblings handle).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

summary_statsA

Zwraca statystyki podsumowujące dla szeregu czasowego z czujnika.

Użyj tego narzędzia zamiast samodzielnego liczenia statystyk na surowych danych — jest szybsze i deterministyczne dla dużych plików.

Args: data: dane CSV (z nagłówkiem) lub JSON (lista {timestamp, value}). ts_field: nazwa kolumny/pola czasu (domyślnie "timestamp"). value_field: nazwa kolumny/pola wartości (domyślnie "value").

Returns: JSON ze statystykami: liczba odczytów, min, max, średnia, mediana, odchylenie standardowe, zakres czasowy, czas trwania.

ParametersJSON Schema
NameRequiredDescriptionDefault
dataYes
ts_fieldNotimestamp
value_fieldNovalue

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It explains what return values look like ('JSON ze statystykami') and lists the computed metrics. However, it doesn't disclose edge-case behaviors like handling invalid timestamps, missing values, empty datasets, or whether the computation is exact for large files or approximate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, usage guidance, Args, Returns). Every sentence adds value and the information is front-loaded with the core purpose first. No wasteful filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has an output schema so return value structure is covered elsewhere. The description covers input formats, both optional parameters and their defaults, the purpose, and when to use it. For a relatively simple summarization tool with 3 params and an output schema, the description is reasonably complete, though it could note behavior on edge cases (empty data, non-numeric values).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. The description explains all three parameters: data accepts CSV or JSON format, ts_field defaults to 'timestamp' for the time column, and value_field defaults to 'value'. However, it doesn't detail the CSV structure beyond 'with header' or provide example formats, leaving some ambiguity for the data parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb+resource: 'Zwraca statystyki podsumowujące dla szeregu czasowego z czujnika' (returns summary statistics for a time series from a sensor). It explicitly distinguishes itself from manual computation and lists what statistics are returned (count, min, max, mean, median, stddev, time range, duration).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly instructs when to use this tool instead of manually computing statistics on raw data ('Użyj tego narzędzia zamiast samodzielnego liczenia statystyk'). It gives clear context but doesn't explicitly compare against sibling tools like detect_anomalies or detect_threshold_breaches, which are related but distinct (those detect patterns, this summarizes).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv0.1.0
    • First observeddetect_anomalies
    • First observeddetect_threshold_breaches
    • First observedsegment_journey
    • First observedsummary_stats

TDQS

A3.9/5.0

Scored across 4 tools

Disambiguation4/5

Each tool targets a distinct operation: summary_stats computes aggregate measures, detect_threshold_breaches finds compliance violations, detect_anomalies finds statistical outliers, and segment_journey splits logs into trips. The purposes are clearly differentiated by domain function, though summary_stats and detect_anomalies both operate on raw series and could theoretically be confused—but their outputs are clearly different.

Naming Consistency4/5

All tools use snake_case and follow a consistent verb_first pattern: summary_stats (slightly verb-less), detect_threshold_breaches, detect_anomalies, segment_journey. The naming is coherent and predictable, with only 'summary_stats' deviating slightly from the verb-object convention used by the others.

Tool Count5/5

Four tools is a reasonable, focused scope for a cold-chain analytics server. Each tool addresses a distinct, valuable analysis task and none feels like filler. The count is on the lean side but entirely appropriate for the narrow domain.

Completeness4/5

The set covers core cold-chain analysis workflows: summary stats, threshold breach detection (key for compliance), anomaly detection, and journey segmentation. However, there are notable gaps—no tool for loading/filtering raw data, no visualization/serialization of results, and no export or alerting tools. For a cold-chain MCP server, CRUD-style operations aren't expected, but a data-cleaning or filtering tool would be a natural addition.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers