# IQAir MCP MCP

> IQAir MCP provides access to real-time air quality indices (AQI) and current weather data globally. This connector allows your agent to audit pollution levels, check atmospheric pressure, and retrieve environmental metrics for specific cities or the location nearest you. It includes tools to list all supported countries, states, and cities before running a query.

## Overview
- **Category:** data-management
- **Price:** Free
- **Tags:** air-quality, pollution-data, aqi, environmental-monitoring, weather-data, real-time-sync

## Description

You run into complex research problems—say, mapping pollutant hotspots across an entire region. Before this MCP, getting that data meant jumping between multiple geo-data portals, manually cross-referencing city names, and writing custom code for every specific API endpoint you needed to hit. Now, your agent handles the whole thing conversationally. You simply ask it: 'What's the air quality in Sao Paulo compared to Campinas?' The MCP orchestrates the complex search across thousands of data points, instantly giving you real-time AQI and weather conditions. This works regardless of whether you are a climate researcher or just checking local health risks. Since Vinkius hosts this connection, your agent can access all these environmental tools from one place. You get accurate, localized pollution readings without writing a single line of API integration code.

## Tools

### check_api_status
Confirms if the IQAir API service is currently running and available for data retrieval.

### get_city_air_quality
Retrieves real-time air quality indices and weather details for a specific, named city.

### get_nearest_city_air_quality
Gets the current AQI and weather data for the monitored city closest to your device's IP address.

### list_supported_cities
Provides a list of all cities that have monitoring coverage within a specified state and country.

### list_supported_countries
Returns a list of every country IQAir monitors for environmental data.

### list_supported_states
Lists all states that have coverage within a specific, chosen country.

## Prompt Examples

**Prompt:** 
```
What is the air quality in 'Los Angeles, California, USA' using IQAir?
```

**Response:** 
```
I've retrieved the real-time data for Los Angeles. The Air Quality Index (AQI) is currently 45, which is identified as 'Good'. The weather is 22°C with 60% humidity. Would you like the data for other cities in California?
```

**Prompt:** 
```
Check air quality for my nearest city.
```

**Response:** 
```
I've identified the nearest monitored city via your IP! The air quality is currently 'Moderate' with an AQI of 65. The main pollutant is identified as PM2.5. I can provide the full weather breakdown if you'd like.
```

**Prompt:** 
```
List all cities supported in the state of 'Sao Paulo', Brazil.
```

**Response:** 
```
I've scanned the catalog for Sao Paulo. It includes over 20 monitored cities, such as Sao Paulo city, Campinas, and Santos. I can retrieve the real-time AQI for any of these locations.
```

## Capabilities

### Audit current air quality and weather
Get real-time AQI and atmospheric metrics for either a specific city or the location nearest to your IP address.

### Scope global environmental data
List all supported countries, states, and cities in the catalog to define where you need to run a query.

### Validate API connection status
Check if the underlying IQAir service is currently operational before running expensive data queries.

## Use Cases

### Assessing immediate health risks
A public health analyst gets an alert about unusual pollution near a neighborhood. They ask their agent, 'What is the air quality right here?' The agent uses `get_nearest_city_air_quality` and reports the AQI and main pollutant (e.g., PM2.5) instantly.

### Mapping regional pollution sources
A climate researcher needs data for a whole region, not just one city. They use `list_supported_countries` to verify scope, then call `list_supported_states`, and finally query multiple cities using `get_city_air_quality` in sequence.

### Validating corporate site compliance
A sustainability lead needs to audit three factory locations across different states. They use the scoping tools (`list_supported_states`) to confirm coverage, then run `get_city_air_quality` for each location to generate a compliance report.

## Benefits

- Pinpoint local issues: Use `get_nearest_city_air_quality` to check the air quality in your immediate area without knowing the city name beforehand.
- Structure large audits: Run `list_supported_countries`, then `list_supported_states`, and finally `list_supported_cities` to build a perfect list of locations for mass querying.
- Target specific data points: Call `get_city_air_quality` when you need precise, real-time AQI readings for an exact location in the world.
- Stay operational: Always run `check_api_status` first. This confirms your environmental research workflow isn't going to fail because of a temporary API outage.
- Understand scope limitations: Use `list_supported_countries` when you need to know if IQAir even monitors the country you plan to audit.

## How It Works

The bottom line is that you get structured access to global environmental data without managing API keys or endpoints yourself.

1. Subscribe to this MCP and enter your unique IQAir API Key.
2. Connect your preferred client (Claude, Cursor, etc.) through the Vinkius platform.
3. Invoke a function—for example, using `list_supported_countries`—to define the required geographic scope.

## Frequently Asked Questions

**How do I check the air quality for my current location using get_nearest_city_air_quality?**
Simply invoke `get_nearest_city_air_quality`. It uses your IP address to identify the closest monitored city and returns both the real-time AQI and weather data, saving you from manual lookups.

**Do I need to use list_supported_countries before querying a specific place?**
No, but it’s smart practice. Running `list_supported_countries` first confirms that the nation you plan to audit is covered by IQAir at all, preventing an immediate API failure.

**What if I want data for multiple cities in one state?**
First, use `list_supported_states` to confirm coverage. Then, call `list_supported_cities` with the state name to get every city ID you need before running batch queries using `get_city_air_quality`.

**Is there a way to check if this MCP connection is working?**
Yes, run `check_api_status`. This tool verifies the entire IQAir API pipeline is operational before you start your research workflow. It's good preventative maintenance.

**What format do I need for the city name when using get_city_air_quality?**
The function requires the official, full names of both the city and the state/country. If you aren't sure which naming convention to use, always run list_supported_cities first. This confirms that your specific location inputs are valid for the IQAir catalog.

**What is the proper workflow order when listing locations using list_supported_states?**
You must start by calling list_supported_countries to get a valid country code. Then, use that code with list_supported_states. This ensures your request for states always targets an officially recognized region.

**If I run get_city_air_quality and the data is missing, what should I check first?**
First, verify that the API service is active by checking the status using check_api_status. If the service is online, the issue usually means the specified location name or date isn't supported, so double-check your inputs.

**Are there any usage limits or rate restrictions when running many queries with this MCP?**
Yes, the underlying data source has operational usage thresholds. For large data pulls, group related calls together for efficiency. If you encounter a limit error, wait a short period and then try your workflow again.

**How do I find my IQAir API Key?**
Log in to your [**IQAir dashboard**](https://www.iqair.com/dashboard/api), create a new key in the API section, and copy it. Copy and paste it below.

**Does the agent use the server's IP for nearest city?**
Yes. The `get_nearest_city_air_quality` tool automatically uses the requester's IP address to identify and audit the nearest monitored location.

**Are weather details included with air quality?**
Yes. Every city data retrieval includes current weather metadata such as temperature, humidity, and atmospheric pressure alongside the AQI.