# NCEI Climate Data MCP

> NCEI Climate Data Online (NOAA Archive) gives your AI client direct access to NOAA's National Centers for Environmental Information archive. It lets you search, list, and retrieve decades of historical weather records—from temperature averages (TAVG) to precipitation totals (PRCP)—using natural language queries.

## Overview
- **Category:** government-public-data
- **Price:** Free
- **Tags:** noaa, climate-archive, meteorology, historical-weather, environmental-data

## Description

You're connecting your AI client straight into the **NOAA Climate Data Online** archive. It’s basically NOAA's National Centers for Environmental Information (NCEI) data dump, and it lets you query decades of global historical weather records using standardized structures. You don't have to manually dig through APIs; your agent handles the whole process.

To figure out what data you need, you start broad. If you want a general idea of what kind of archives NOAA keeps—like daily summaries or major global averages—you use `list_datasets` and `list_datacategories`. These tools show you all the primary groupings of climate datasets available in the archive.

If you're trying to narrow down your research focus, you can first check `list_locationcategories`. This shows you high-level ways to group areas, like 'Countries' or 'States.' To get specific geography, you run `list_locations`, which gives you a list of geopolitical entities or precise bounding coordinates needed for any query. You can also use `list_locationcategories` to filter down your search.

When it comes to the actual weather variables—you know, if you need average temperature (TAVG), precipitation totals (PRCP), or maximum temperatures (TMAX)—you don't guess. You run `list_datatypes`. This tells you the exact variable codes you need to use in your queries.

To find out which specific weather stations are even part of this network, you check `list_stations`. That tool lists every observing platform across the NOAA grid by both its ID and its name. You can also use `list_datasets` to find information on pre-packaged NCEI datasets, like the Global Summary of the Month.

When you need to search for data that fits specific parameters—say, temperature records in Florida between 1980 and 2000—you run `search_data`. This function discovers relevant climate points by matching both a date range and a geographical area. For finding datasets based on time or location alone, use `search_datasets`.

If the standard data retrieval isn't enough for what you need, you have two ways to pull numbers. First, you run `get_data`. This fetches actual climate observations—whether they’re annual averages or monthly totals—after you’ve defined the specific location, variable code, and time window. If that function falls short, `get_service_data` lets your agent access subset data in multiple formats when a standard retrieval method won't cut it.

To pinpoint exact stations globally, you run `list_stations`. To organize your search by region, you use `list_locations` or `list_locationcategories`. If you need to know what variables are available—like TAVG or PRCP—you check `list_datatypes`. You can see all the primary archives NOAA maintains using `list_datasets` and `list_datacategories`, and if you're just looking for general data points matching a time and place, run `search_data`. To find pre-packaged datasets by location or date, use `search_datasets`. When you finally have every piece of metadata—the station ID, the variable code, and the dates—you execute the final query using either `get_data` or `get_service_data` to pull those raw historical observations.

## Tools

### list_datacategories
Lists high-level groupings of available climate datasets to narrow down your research focus.

### get_data
Fetches actual climate observations (annual/monthly) after defining location, variable, and time range.

### list_datatypes
Lists the available climate variables and their codes (like TAVG or PRCP) that you can query.

### list_datasets
Finds information about specific, pre-packaged NCEI datasets (e.g., Global Summary of the Month).

### list_locationcategories
Lists groupings of geopolitical areas, such as 'Countries' or 'States', to organize your location search.

### list_locations
Provides a list of specific geopolitical entities or bounding coordinates for data retrieval.

### list_stations
Lists every weather observing platform (station) available in the NOAA network by ID and name.

### search_data
Discovers relevant climate data points based on combined temporal and spatial parameters.

### search_datasets
Finds available datasets by matching them against specific time periods or locations.

### get_service_data
Accesses subset data in multiple formats when the standard retrieval method isn't enough for your needs.

## Prompt Examples

**Prompt:** 
```
List all available climate datasets from NCEI.
```

**Response:** 
```
I've retrieved the available datasets. Key archives include 'Daily Summaries' (GHCND), 'Global Summary of the Month' (GSOM), and 'Precipitation Hourly' (PRECIP_HLY). Which one would you like to explore further?
```

**Prompt:** 
```
Find weather stations located in London, UK.
```

**Response:** 
```
Searching for stations in London... I found several platforms, including 'LONDON HEATHROW' (ID: GHCND:UKM00003772) and 'LONDON WEATHER CENTER'. Would you like to see the data types available for Heathrow?
```

**Prompt:** 
```
What are the data types available for the Daily Summaries dataset?
```

**Response:** 
```
For the Daily Summaries (GHCND) dataset, available types include PRCP (Precipitation), SNOW (Snowfall), TAVG (Average Temperature), TMAX (Maximum Temperature), and TMIN (Minimum Temperature).
```

## Capabilities

### Discover available climate datasets
Use `list_datasets` and `list_datacategories` to see all primary data archives NOAA maintains.

### Find specific weather stations globally
The agent runs `list_stations` to identify exact observing platforms worldwide, giving you the source ID needed for queries.

### Filter data by location or geography
You can use `list_locations` or `list_locationcategories` to narrow your search down to countries, states, or specific zip codes.

### Identify required climate variables
Run `list_datatypes` to confirm the exact code for measurements like precipitation (PRCP) or average temp (TAVG).

### Search across time and space
Use `search_data` to find relevant datasets by specifying both a date range and a geographical area.

### Pull raw historical observations
The agent executes `get_data` using all the metadata gathered (station ID, data type, dates) to fetch the final numbers.

## Use Cases

### Assessing historical drought risk in the Midwest
A farmer needs to know if 2018 was historically dry. They ask their agent: 'What was the average precipitation (PRCP) for Iowa between 2015 and 2020?' The agent runs `list_datatypes` to confirm PRCP, then uses `list_locations` for Iowa's coordinates, and finally calls `get_data` with all three pieces of info. Result: A clean time series showing the rainfall totals.

### Validating a site’s historical operational parameters
An environmental consultant needs to verify that a construction site near Heathrow airport has historically high levels of frost damage. They use `list_stations` to find the official station ID, then run `search_data` for 'TMIN' (Minimum Temperature) over 30 years. The agent returns all records, allowing them to confirm the historical freeze/thaw cycles.

### Comparing regional temperature shifts across decades
A climate scientist wants to compare average temperatures between two distinct regions (e.g., Miami vs. Seattle). The agent uses `list_locations` twice, gets both location IDs, and then runs a single `get_data` call that compares TAVG for the same time period across both locations. Problem solved in minutes.

### Checking available data types for an obscure region
A developer needs to know if NOAA tracks snow depth (SNOW) for a small, remote mountain town. Instead of reading the docs, they use `list_datatypes` first and then cross-reference that list with `search_datasets` using the town's location ID. The agent confirms availability or flags it as missing.

## Benefits

- Stop manually building API calls. Instead of figuring out which endpoints handle location vs. variable data, let your AI client use `list_locations` and `list_datatypes` to collect all the necessary metadata first. It handles the complex pre-work for you.
- Get specific climate metrics instantly. When you need average temperature (TAVG) or precipitation (PRCP), your agent doesn't guess; it uses `get_data` with confirmed NOAA codes, guaranteeing you pull accurate observations.
- Filter massive datasets efficiently. If you only care about the 1980s in Florida, use `search_data`. This tool combines time and space parameters to cut out years of irrelevant data immediately.
- Track down exact physical sources. Need to know *which* weather station recorded a reading? Run `list_stations` to get the platform's official ID before you even try to pull the data with `get_data`. It gives you source accountability.
- Avoid dataset confusion. Instead of sifting through NOAA documentation, use `list_datasets` to see clear examples like 'Daily Summaries (GHCND)' and pick exactly what you need for your analysis.

## How It Works

The bottom line is: Your AI client takes your natural language request and converts it into a precise multi-step sequence of API calls to pull NOAA's raw data.

1. Subscribe to this server and get a free API Token from the NOAA NCEI portal. You must provide this token to your AI client.
2. Instruct your agent on the task (e.g., 'Find precipitation data for Miami in 2015'). The agent will first use `list_datatypes` and `list_locations` to gather necessary codes.
3. The agent then passes all collected parameters—the location ID, the variable code, and the date range—to `get_data`. You get back structured climate observations.

## Frequently Asked Questions

**How do I find all available data types using list_datatypes?**
You run the `list_datatypes` tool. This returns a comprehensive list of NOAA variable codes and their descriptions, like TAVG (Average Temperature) or PRCP (Precipitation). It's your starting point for defining metrics.

**What is the difference between search_data and get_data?**
`search_data` finds *if* data exists by matching general parameters (time/space). `get_data` retrieves the actual, structured observations once you've confirmed that the necessary metadata and dataset are in place.

**Do I need to use list_stations before running get_data?**
Yes. To ensure data accuracy and accountability, you should run `list_stations` first. This confirms the specific platform ID (e.g., GHCND:UKM00003772) that recorded the numbers you want.

**Can I find climate data for a location not listed?**
If your exact area isn't in NOAA’s primary list, use `list_locations` to see if it falls under a general bounding box or region. If so, you can use that broader ID instead.

**How do I get started with this server? What token do I need before using tools like `get_data`?**
You must request a free API Token from the NOAA NCEI portal. This token authorizes your AI client to access and query the historical data stream, so you'll need it for every call.

**If I don't know if a location is a Country or State, how do I use `list_locationcategories`?**
The tool returns groupings of similar locations, like 'Countries' or 'States'. Run this first to understand the data hierarchy before using `list_locations` to pinpoint specific geopolitical entities.

**What are the maximum time ranges I can retrieve when running `get_data`?**
The limits depend on the dataset. Annual or monthly data usually restricts you to a 10-year range, while other climate observation types might be limited to just one year.

**How can I use `get_service_data` to ensure the output is in multiple formats?**
This tool lets your agent access subset data and specify various output formats. It pulls the same information structured for different downstream applications, which is really useful.

**How do I find the specific ID for a weather station in a certain city?**
You can use the `list_stations` tool and provide a `locationid`. To find the correct location ID first, use the `list_locations` tool to search by city or state name.

**What is the difference between a Data Category and a Data Type?**
Data Categories (retrieved via `list_datacategories`) are broad groups like 'Temperature' or 'Precipitation'. Data Types (retrieved via `list_datatypes`) are specific codes like 'TMAX' (Maximum temperature) or 'PRCP' (Precipitation amount).

**Can I see what datasets are available for a specific date range?**
Yes, the `list_datasets` tool accepts `startdate` and `enddate` parameters. This allows you to filter the archive for datasets that have coverage during your period of interest.