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.
npx -y @MeasureSpace/measure-space-mcp-serverOverview
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:
Environment variables (set only the keys for services you will use):
| Environment Variable | Service |
|---|---|
| GEOCODING_API_KEY | City ↔ lat/lon geocoding |
| HOURLY_WEATHER_API_KEY | Hourly weather forecast |
| DAILY_WEATHER_API_KEY | Daily weather forecast |
| DAILY_CLIMATE_API_KEY | Daily climate forecast |
| AIR_QUALITY_API_KEY | Air quality forecast |
| AGRICULTURE_API_KEY | Agriculture services |
| POLLEN_API_KEY | Daily pollen forecast |
Example: export keys on macOS/Linux:
# export other keys as needed
Python implementation (quick start):
# set env vars (see table above)
# then run the server (implementation README contains exact entry point)
TypeScript implementation (quick start):
# set env vars (see table above)
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
- 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