ME

MeasureSpace MCP Server: Weather, Air Quality, Geocoding

Access global weather, climate, air quality forecasts and geocoding via the free MeasureSpace MCP server at measurespace.io.

Quick Install
npx -y @MeasureSpace/measure-space-mcp-server

Overview

MeasureSpace MCP Server exposes global weather, climate, air quality, agriculture, pollen and geocoding services as a Model Context Protocol (MCP) server. It acts as a thin connector between LLM-based agents (or other MCP-capable clients) and the MeasureSpace API ecosystem hosted at measurespace.io, providing tools the model can call to fetch forecasts, geocoding results, timezone and astronomy data.

There are two reference implementations in this repository (Python and TypeScript). Use this project to run a local or hosted MCP server that supplies structured, tool-style access to MeasureSpace services so an LLM can request forecasts, air quality indices, crop-growth metrics, or convert between city names and coordinates.

Features

  • Hourly weather forecasts (next 5 days)
  • Daily weather forecasts (next 15 days)
  • Daily climate forecasts (next 9 months)
  • Hourly and daily air quality forecasts (next 4 days)
  • Agriculture: Growing Degree Days (GDD), crop growth stage, heat and frost stress days
  • Pollen: daily pollen forecasts (next 5 days)
  • Geocoding: city name → latitude/longitude and reverse lookup (lat/lon → nearest city)
  • Timezone and astronomy data (sunrise, sunset)
  • Two implementations: Python and TypeScript

Installation / Configuration

Prerequisites: Git, Python 3.8+ or Node.js 16+ depending on the implementation you choose. Get API keys from https://measurespace.io/pricing.

Clone the repository:

git clone https://github.com/MeasureSpace/measure-space-mcp-server.git
cd measure-space-mcp-server

Environment variables (set only the keys for services you will use):

Environment VariableService
GEOCODING_API_KEYCity ↔ lat/lon geocoding
HOURLY_WEATHER_API_KEYHourly weather forecast
DAILY_WEATHER_API_KEYDaily weather forecast
DAILY_CLIMATE_API_KEYDaily climate forecast
AIR_QUALITY_API_KEYAir quality forecast
AGRICULTURE_API_KEYAgriculture services
POLLEN_API_KEYDaily pollen forecast

Example: export keys on macOS/Linux:

export GEOCODING_API_KEY="sk_abc123"
export HOURLY_WEATHER_API_KEY="sk_hourly_..."
# export other keys as needed

Python implementation (quick start):

cd python
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# set env vars (see table above)
# then run the server (implementation README contains exact entry point)
python -m mcp.server   # example; check python/README.md for the exact command

TypeScript implementation (quick start):

cd typescript
npm install
# set env vars (see table above)
npm run dev   # example; check typescript/README.md for the exact command

Note: the project includes detailed, implementation-specific README files in python/ and typescript/ with exact run commands and additional configuration options.

Available Tools / Available Resources

When running, the MCP server exposes tool-like resources that an LLM or MCP client can call. Typical resources include:

  • geocode.city_to_coords(city_name)
  • geocode.coords_to_city(latitude, longitude)
  • weather.hourly_forecast(latitude, longitude, hours=48)
  • weather.daily_forecast(latitude, longitude, days=15)
  • climate.daily_climate_forecast(latitude, longitude, months=9)
  • air_quality.hourly_or_daily_aqi(latitude, longitude, days=4)
  • agriculture.gdd_and_stress_metrics(latitude, longitude, crop_profile)
  • pollen.daily_pollen(latitude, longitude, days=5)
  • astronomy.sunrise_sunset(latitude, longitude, date)
  • timezone.lookup(latitude, longitude)

(Exact tool names and the MCP schema are described in the implementation READMEs; the server maps these high-level capabilities to MeasureSpace API endpoints.)

Use Cases

  1. LLM-driven weather assistant
    • Scenario: An agent answers user questions about next-day weather and plans outdoor activities.
    • Flow: The LLM calls weather.hourly_forecast(lat, lon, hours=24) via the MCP server, receives structured hourly condition and temperature data, then composes a human-readable recommendation (“no rain expected