AQICN MCP Server
This is a Model Context Protocol (MCP) server that provides air quality data tools from the World Air Quality Index (AQICN) project. It allows LLMs to fetch real-time air quality data for cities and coordinates worldwide.
Installation
Installing via Smithery
To install AQICN MCP Server for Claude Desktop automatically via Smithery:
Installing via recommended uv (manual)
We recommend using uv to manage your Python environment:
Related MCP server: Weather MCP Tool
Environment Setup
Create a .env file in the project root (you can copy from .env.example):
Alternatively, you can set the environment variable directly:
Running the Server
Development Mode
The fastest way to test and debug your server is with the MCP Inspector:
Claude Desktop Integration
Once your server is ready, install it in Claude Desktop:
Direct Execution
For testing or custom deployments:
Available Tools
1. city_aqi
Get air quality data for a specific city.
Input:
city: Name of the city to get air quality data for
Output: AQIData with:
aqi: Air Quality Index valuestation: Station namedominant_pollutant: Main pollutant (if available)time: Timestamp of the measurementcoordinates: Latitude and longitude of the station
2. geo_aqi
Get air quality data for a specific location using coordinates.
Input:
latitude: Latitude of the locationlongitude: Longitude of the location
Output: Same as city_aqi
3. search_station
Search for air quality monitoring stations by keyword.
Input:
keyword: Keyword to search for stations (city name, station name, etc.)
Output: List of StationInfo with:
name: Station namestation_id: Unique station identifiercoordinates: Latitude and longitude of the station
Example Usage
Using the MCP Python client:
Contributing
Feel free to open issues and pull requests. Please ensure your changes include appropriate tests and documentation.
License
This project is licensed under the MIT License.