# 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
```