Skip to main content
Glama
mattmarcin

AQICN MCP Server

by mattmarcin

AQICN MCP 서버

대장간 배지

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

설치

Smithery를 통해 설치

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

지엑스피1

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

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

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

Related MCP server: Weather MCP Tool

환경 설정

프로젝트 루트에 .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

Resources

Looking for Admin?

Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.

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/mattmarcin/aqicn-mcp'

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