Skip to main content
Glama
hlucent

airkorea-realtime-mcp

by hlucent

airkorea-realtime-mcp

This is an MCP server that queries real-time air pollution information, the Comprehensive Air-quality Index (CAI), and measurement station information from the Korea Environment Corporation's AirKorea OpenAPI.

Provided Tools (5)

Tool

Description

get_station_realtime_air_quality

Queries real-time air pollution measurement data (SO2/CO/O3/NO2/PM10/PM2.5, Comprehensive Air-quality Index) for a station by station name

get_sido_realtime_air_quality

Queries real-time measurement data for all stations in a province by province name

get_station_cai

Queries the real-time Comprehensive Air-quality Index (CAI) by station name

search_stations

Searches for a list of stations/coordinates by address or station name

get_nearby_stations

Queries nearby stations and distances by entering coordinates

Related MCP server: mcp-waqi

Data Source

  • Providing Organization: Air Quality Policy Support Division, Air Environment Bureau, Climate and Air Quality Office, Korea Environment Corporation

  • Platform: Public Data Portal (data.go.kr)

  • Service Group: Korea Environment Corporation_AirKorea_Air Pollution Information, Korea Environment Corporation_AirKorea_Measurement Station Information, Korea Environment Corporation_AirKorea_Comprehensive Air-quality Index (CAI) query service (Service group code B552584)

  • Terms of Use: Attribution-NoDerivatives (Obligation to indicate the data source (Ministry of Environment/Korea Environment Corporation) must be observed)

Measurement Units and Grade Criteria

Item

SO2

CO

O3

NO2

PM10

PM2.5

Unit

ppm

ppm

ppm

ppm

㎍/㎥

㎍/㎥

Grade values: 1=Good, 2=Moderate, 3=Unhealthy, 4=Very Unhealthy

Known Limitations (Verified Through Actual Testing)

  • Measurement station list (search_stations) coordinate axes: When called with ver=1.1 fixed, dmX=longitude and dmY=latitude were confirmed to be correct (cross-validated with 5 different stations). Based on WGS84.

  • Nearby station query (get_nearby_stations) coordinate system: It was confirmed through actual testing that entering WGS84 latitude/longitude directly produces completely incorrect results (e.g., entering Gangnam-gu, Seoul coordinates returns Jeju Island stations). TM Central Belt (EPSG:5181) coordinate conversion is absolutely required, and this server uses pyproj to automatically convert WGS84→EPSG:5181 before calling the API (users only need to enter latitude/longitude). When entering Gangnam-gu Office coordinates (37.515336, 127.049357), the Gangnam-gu station was returned at the top with a distance of 0.4km, verifying conversion accuracy.

  • CAI query (get_station_cai) response fields: Unlike the specification table (khaiValue/khaiGrade/khaiItem), the actual field names are caiValue/caiGrade/caiItem. The full fields are stationCode, stationName, mangName, dataTime, caiValue, caiGrade, caiItem (individual pollutant fields such as so2Value are not included in this operation's response).

  • Normal resultCode for CAI query: The other 4 operations return resultCode="00" on success, but only getMsrstnKhaiRltmDnsty (CAI) returns resultCode="200" and resultMsg="NORMAL_CODE" on success. The server code is designed to also treat cases where resultMsg is "NORMAL_CODE"/"NORMAL SERVICE" as successful.

  • items response structure difference: ArpltnInforInqireSvc/MsrstnInfoInqireSvc have items as an array, while RltmKhaiInfoSvc (CAI) wraps it one level deeper with items.item. The server absorbs this difference and always returns an array.

  • Missing value representation: In this round of actual testing (normal air quality data), the "-" missing case did not appear, but based on the specification examples, _safe_numeric is implemented to safely convert "-"/None/empty strings/floats all to None (it does not arbitrarily replace them with 0).

  • API server stability: It was confirmed that SERVICETIMEOUT_ERROR (error code 05, HTTP 504) occurs frequently during actual testing. The server automatically retries up to 3 times only for code 05.

  • sidoName "전남광주": Queries work normally (reflecting the launch of Jeonnam-Gwangju Metropolitan City in 2026, totalCount of 64 confirmed).

Environment Variables

Variable Name

Description

AIRKOREA_SERVICE_KEY

AirKorea service key issued from the Public Data Portal (Decoding key)

Installation and Execution (Local)

pip install -r requirements.txt --break-system-packages
cp .env.example .env   # AIRKOREA_SERVICE_KEY 값 입력
python server.py

Deployment (fly.io)

fly launch --no-deploy
# fly.toml이 [http_service] 방식인지 확인 후
fly secrets set AIRKOREA_SERVICE_KEY=발급받은키
flyctl deploy

Claude.ai Connector Connection

After deployment is complete, connect by appending /mcp to the address.

https://airkorea-realtime-mcp.fly.dev/mcp

Rate Limit Policy

Since this is a public server that can be connected with just a URL without an API key, a 3-tier rate limit based on IP is applied.

  • Returns 429 if exceeded 3 times per minute (may be effectively relaxed in proportion to the number of machines in multi-machine deployments)

  • If 429 is received 5 or more times within 1 hour, the IP is blocked for 24 hours

  • Returns 429 if the daily total (rolling 24 hours) exceeds 30 requests

Error Codes

This API uses the Public Data Portal standard error code system (different from Seoul Open Data Plaza's INFO-000/ERROR-3xx system).

Code

Meaning

00

Normal

03

No Data

10

Invalid request parameter

11

Required parameter missing

20

Service access denied (no usage application)

22

Daily traffic limit exceeded

30

Unregistered service key

31

Service key usage period expired

The AirKorea OpenAPI is large in scale, so it is being developed as 3 separate independent MCPs:

Phase

Repository

Scope of Coverage

Phase 1 (This project)

airkorea-realtime-mcp

Real-time measurement data, CAI, measurement station information

Phase 2

airkorea-forecast-alert-mcp

Air quality forecast, fine dust alerts, ozone/yellow dust advisories

Phase 3

airkorea-statistics-mcp

Provincial/station statistics (daily/monthly averages), stations with CAI of 'Unhealthy' or higher

License

MIT (code) / KOGL Type 1 (Attribution) — Data source (Ministry of Environment/Korea Environment Corporation) must be indicated

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables querying Polish air-quality data from GIOŚ stations by providing tools to list stations, get sensor readings, and retrieve the composite air-quality index.
    MIT
  • F
    license
    Not graded
    quality
    B
    maintenance
    MCP server for querying Seoul's official air quality data, including real-time and hourly measurements by district. Enables AI assistants to answer questions about fine dust and air pollution using public data from Seoul Open Data Plaza.
  • A
    license
    Not graded
    quality
    C
    maintenance
    Retrieves hourly average air quality data (PM10, PM2.5, ozone, NO2, CO, SO2) from Seoul's open data platform, filtered by station or district.
    MIT

View all related MCP servers

Related MCP Connectors

  • Air Quality MCP — wraps air-quality-api.open-meteo.com (free, no auth)

  • Find air-quality stations and read pollutant observations from government monitors via OpenAQ v3.

  • EPA AirNow MCP — official US real-time AQI + forecast (free key)

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hlucent/airkorea-realtime-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server