AQICN MCP Server

by mattmarcin
MIT License
  • Linux
  • Apple

AQICN MCP 서버

이는 세계 대기 질 지수(AQICN) 프로젝트의 대기 질 데이터 도구를 제공하는 모델 컨텍스트 프로토콜(MCP) 서버입니다. LLM은 이를 통해 전 세계 도시 및 좌표의 실시간 대기 질 데이터를 가져올 수 있습니다.

설치

Smithery를 통해 설치

Smithery를 통해 Claude Desktop에 AQICN MCP 서버를 자동으로 설치하려면:

지엑스피1

권장 UV를 통한 설치(수동)

Python 환경을 관리하려면 uv를 사용하는 것이 좋습니다.

# Install the package and dependencies uv pip install -e .

환경 설정

프로젝트 루트에 .env 파일을 만듭니다( .env.example 에서 복사할 수 있습니다).

# .env AQICN_API_KEY=your_api_key_here

또는 환경 변수를 직접 설정할 수 있습니다.

# Linux/macOS export AQICN_API_KEY=your_api_key_here # Windows set AQICN_API_KEY=your_api_key_here

서버 실행

개발 모드

서버를 테스트하고 디버깅하는 가장 빠른 방법은 MCP Inspector를 사용하는 것입니다.

mcp dev aqicn_server.py

Claude 데스크톱 통합

서버가 준비되면 Claude Desktop에 설치하세요.

mcp install aqicn_server.py

직접 실행

테스트 또는 사용자 정의 배포의 경우:

python aqicn_server.py

사용 가능한 도구

1. 시티_아키

특정 도시의 대기 질 데이터를 받아보세요.

@mcp.tool() def city_aqi(city: str) -> AQIData: """Get air quality data for a specific city."""

입력:

  • city : 대기 질 데이터를 얻을 도시 이름

출력: AQIData 포함:

  • aqi : 대기질 지수 값
  • station : 역 이름
  • dominant_pollutant : 주요 오염 물질(사용 가능한 경우)
  • time : 측정의 타임스탬프
  • coordinates : 관측소의 위도와 경도

2. 지오_아키

좌표를 사용하여 특정 위치의 대기 질 데이터를 가져옵니다.

@mcp.tool() def geo_aqi(latitude: float, longitude: float) -> AQIData: """Get air quality data for a specific location using coordinates."""

입력:

  • latitude : 위치의 위도
  • longitude : 위치의 경도

출력: city_aqi 와 동일

3. 검색 스테이션

키워드로 대기질 측정소를 검색하세요.

@mcp.tool() def search_station(keyword: str) -> list[StationInfo]: """Search for air quality monitoring stations by keyword."""

입력:

  • keyword : 역을 검색하기 위한 키워드(도시 이름, 역 이름 등)

출력: StationInfo 목록:

  • name : 역 이름
  • station_id : 고유 역 식별자
  • coordinates : 관측소의 위도와 경도

사용 예

MCP Python 클라이언트 사용:

from mcp import Client async with Client() as client: # Get air quality data for Beijing beijing_data = await client.city_aqi(city="beijing") print(f"Beijing AQI: {beijing_data.aqi}") # Get air quality data by coordinates (Tokyo) geo_data = await client.geo_aqi(latitude=35.6762, longitude=139.6503) print(f"Tokyo AQI: {geo_data.aqi}") # Search for stations stations = await client.search_station(keyword="london") for station in stations: print(f"Station: {station.name} ({station.coordinates})")

기여하다

이슈를 공개하고 풀 리퀘스트를 자유롭게 진행하세요. 변경 사항에는 적절한 테스트와 문서가 포함되어 있는지 확인해 주세요.

특허

이 프로젝트는 MIT 라이선스에 따라 라이선스가 부여되었습니다.

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

모델 컨텍스트 프로토콜(MCP)을 통해 전 세계 도시와 좌표의 실시간 대기 질 데이터를 가져오기 위해 세계 대기 질 지수와 상호 작용할 수 있습니다.

  1. Installation
    1. Installing via Smithery
    2. Installing via recommended uv (manual)
  2. Environment Setup
    1. Running the Server
      1. Development Mode
      2. Claude Desktop Integration
      3. Direct Execution
    2. Available Tools
      1. 1. city_aqi
      2. 2. geo_aqi
      3. 3. search_station
    3. Example Usage
      1. Contributing
        1. License

          Related MCP Servers

          • -
            security
            A
            license
            -
            quality
            A Model Context Protocol server that retrieves current weather information for specified cities using the Open-Meteo API, requiring no API key.
            Last updated -
            Python
            Apache 2.0
            • Linux
            • Apple
          • -
            security
            F
            license
            -
            quality
            Provides current weather and air quality data for any city using WeatherAPI, easily integrating with MCP clients like n8n and Claude Desktop App.
            Last updated -
            214
            JavaScript
          • -
            security
            -
            license
            -
            quality
            Provides a Model Context Protocol server that enables large language models to query and retrieve real-time weather forecasts for cities and regions across China.
            Last updated -
            Python
          • A
            security
            A
            license
            A
            quality
            Model Context Protocol (MCP) server that provides weather forecast, warnings, water level associated with flood, and earthquake reports from Malaysia Government's Open API.
            Last updated -
            4
            Python
            MIT License

          View all related MCP servers

          ID: pi3py17y7w