Skip to main content
Glama
woongaro

KMA Weather MCP Server

by woongaro
README.md
# KMA Weather MCP Server

대한민국 기상청(KMA) [단기예보 Open API](https://www.data.go.kr/data/15084084/openapi.do)를 연결하는 Model Context Protocol (MCP) 서버입니다.

## Features

### Resources (자원)

* `weather://seoul/now`: 서울(시청)의 현재 날씨 데이터를 조회합니다.
* `weather://{latitude}/{longitude}/now`: 입력한 위도/경도 위치의 현재 날씨를 조회합니다.

### Tools (도구)

* **`get_ultra_short_term_forecast`**: 향후 6시간의 초단기 예보를 조회합니다. (강수확률, 하늘상태 등)
* **`get_village_forecast`**: 오늘부터 모레까지의 단기 예보를 조회합니다.

## Configuration (설정)

### 1. API Key 발급

[공공데이터포털](https://www.data.go.kr/)에서 '기상청_단기예보 조회서비스' 활용신청을 하고 **일반 인증키(Decoding)**를 발급받으세요.

### 2. 환경 변수 설정

프로젝트 루트 `.env` 파일에 키를 저장합니다:

```bash
KMA_API_KEY_DECODED=your_decoding_key_here
```

### 3. Claude Desktop 설정 (`claude_desktop_config.json`)

Claude Desktop 앱에서 이 서버를 사용하려면 설정 파일을 수정해야 합니다.

**경로:**

* macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
* Windows: `%APPDATA%\Claude\claude_desktop_config.json`

**설정 내용:**

```json
{
  "mcpServers": {
    "kma-weather": {
      "command": "uv",
      "args": [
        "run",
        "-q",
        "--with",
        "mcp[cli]",
        "--with",
        "httpx",
        "--with",
        "fastmcp",
        "--with",
        "python-dotenv",
        "/ABSOLUTE/PATH/TO/Public API to MCP Converter Agent/kma-weather-mcp/src/server.py"
      ],
      "env": {
        "KMA_API_KEY_DECODED": "YOUR_KEY_HERE (Optional if using .env file in project dir)"
      }
    }
  }
}
```

*주의: `args`의 마지막 경로는 실제 `server.py`가 위치한 **절대 경로**로 수정해야 합니다.*

## Development

```bash
# Run server using default MCP Inspector
npx @modelcontextprotocol/inspector uv run src/server.py
```

TDQS

B3.3/5.0

Scored across 2 tools

Disambiguation5/5

The two tools have clearly distinct purposes: one provides an ultra short-term forecast for the next 6 hours, while the other offers a village forecast for up to 3 days. There is no overlap in their temporal scope or use cases, making it easy for an agent to choose the appropriate tool based on the required timeframe.

Naming Consistency5/5

Both tools follow a consistent verb_noun pattern with 'get_' prefix and descriptive names (get_ultra_short_term_forecast and get_village_forecast). The naming is predictable and readable, adhering to snake_case throughout without any deviations.

Tool Count2/5

With only 2 tools, the server feels thin for a weather forecasting domain, as it lacks coverage for common needs like current conditions, alerts, or longer-term forecasts beyond 3 days. This limited scope may hinder agents from performing comprehensive weather-related tasks.

Completeness2/5

The toolset is severely incomplete for weather forecasting, missing essential operations such as getting current weather, historical data, or severe weather alerts. While the two tools cover short-term forecasts, the absence of broader functionality creates significant gaps that could lead to agent failures in real-world scenarios.

Maintenance

ActivityInactive
ResponsivenessNo issues