Skip to main content
Glama

MCP Climate Example Repo

This repository contains a small, deterministic example that can be called through an MCP.

Mock scientific purpose of the example

This is an example that uses mock climate data and aggregates and plots the data. Input: data/mock_climate.csv with date, temperature_c, precipitation_mm, humidity_pct values per day for one month. The output is (1) outputs/climate_summary.csv with month, avg_temperature_c, total_precipitation_mm for each month. The daily temperature values are aggregated using their mean, while the daily precipitation values are aggregated using their sum; (2) a plot of the data over time.

Related MCP server: baseline-mcp

Mock user workflow

The user workflow is the following:

  1. User obtains data from (server, weather station)

  2. User prepares the config file for the run

  3. User executes the script using data and config

  4. User verifies the data by visual inspection of the plot and the summary

This workflow currently requires the user to install the package (hurdle 1), write in a yaml file (hurdle 2), and provide relative paths (hurdle 3). It also requires the user to be in the correct relative directory when running the script (hurdle 4).

Relevant repo content

  • config/example.yaml: input parameters for the processing run

  • data/mock_climate.csv: mock climate time-series data

  • scripts/process_climate.py: processing and plotting script

  • outputs/: generated summary CSV and plot files

  • tests/: unit tests for the processing/plotting script and the MCP server

Data processing order in the script

The script does the following in the given order:

  1. Parses the command-line arguments giving the relative position of the config file: parse_args()

  2. Reads the YAML config file: load_config()

  3. Loads the mock climate CSV: run_pipeline() -> pd.read_csv()

  4. Cleans and converts the climate data: prepare_data()

  5. Aggregates the daily data to monthly and saves to outputs/: build_monthly_summary()

  6. Creates and exports a plot of the data: create_plot()

Missing data policy:

  • The config takes an optional top-level missing_policy block.

  • The four values and what each does: interpolate / zero_fill / drop / fail.

  • Defaults: interpolate for temperature_c, zero_fill for precipitation_mm

Installing and executing the script

The necessary dependencies can be installed into a Python environment using pip or uv:

pip install -r requirements.txt

The script is then executed using

python scripts/process_climate.py --config config/example.yaml

Expected outputs

The expected outputs are stored in the folder given in the config file, for the default values:

  • outputs/climate_summary.csv

  • outputs/climate_plot.png

Unit tests

Unit tests require installing dev dependencies and can then be run via

pip install -r requirements-dev.txt
python -m pytest

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI agents to operate a US power-grid data pipeline – ingest, plan, run, and monitor datasets like CAISO, ERCOT, and EIA-930 through MCP tools that mirror the CLI.
    Apache 2.0
  • A
    license
    A
    quality
    B
    maintenance
    MCP server that provides statistically rigorous weather and climate context by exposing the Baseline API as agent tools, enabling queries about climate conditions and comparisons against historical data.
    5
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables access to World Bank Climate Change Knowledge Portal data through MCP, allowing AI agents to query climate information using natural language.
    165 npm
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Wraps a climate data-processing pipeline so agents can inspect the config schema and available sample CSVs, validate an inline JSON config, and run the pipeline to return a monthly summary table plus a rendered plot, with file access sandboxed to the data and outputs directories.
    4
    MIT