Skip to main content
Glama
Python MCP Korea Weather Service

Python MCP Korea Weather Service

by jikime

Korea Weather MCP Server

Version License

This MCP (Multi-platform Communication Protocol) server provides access to Korea Meteorological Administration (KMA) APIs, allowing AI agents to retrieve weather forecast information for locations in South Korea.

Overview

  • Retrieve precise grid coordinates for Korean administrative regions

  • Get detailed short-term weather forecasts for any location in Korea

  • Support for all Korean administrative divisions (city, district, neighborhood)

  • Structured text responses optimized for LLM consumption

  • Comprehensive weather data including temperature, precipitation, sky condition, humidity, wind direction, and wind speed

Related MCP server: MCP Weather Server

Table of Contents

Setup

Prerequisites

  • Python 3.12+

  • Korea Meteorological Administration API credentials

  • You can obtain the API credentials by signing up at the Public Data Portal and requesting access to the "기상청_단기예보 ((구)_동네예보) 조회서비스" API.

Installation

  1. Clone the repository:

git clone https://github.com/jikime/py-mcp-ko-weather.git
cd py-mcp-ko-weather
  1. uv installation

curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Create a virtual environment and install dependencies:

uv venv -p 3.12
source .venv/bin/activate
uv pip install -r requirements.txt
  1. Create a .env file with your KMA API credentials:

cp env.example .env
vi .env

KO_WEATHER_API_KEY=your_api_key_here
  1. Migrate the grid coordinates data from Excel to SQLite:

uv run src/migrate.py

Using Docker

  1. Build the Docker image:

docker build -t py-mcp-ko-weather .
  1. Run the container:

docker run py-mcp-ko-weather

Using Local

  1. Run the server:

mcp run src/server.py
  1. Run the MCP Inspector

mcp dev server.py

Configure MCP Settings

Add the server configuration to your MCP settings file:

Claude desktop app

  1. To install automatically via Smithery:

npx -y @smithery/cli install @jikime/py-mcp-ko-weather --client claude
  1. To install manually open ~/Library/Application Support/Claude/claude_desktop_config.json

Add this to the mcpServers object:

{
  "mcpServers": {
    "Google Toolbox": {
      "command": "/path/to/bin/uv",
      "args": [
        "--directory",
        "/path/to/py-mcp-ko-weather",
        "run",
        "src/server.py"
      ]
    }
  }
}

Cursor IDE

open ~/.cursor/mcp.json

Add this to the mcpServers object:

{
  "mcpServers": {
    "Google Toolbox": {
      "command": "/path/to/bin/uv",
      "args": [
        "--directory",
        "/path/to/py-mcp-ko-weather",
        "run",
        "src/server.py"
      ]
    }
  }
}

for Docker

{
  "mcpServers": {
    "Google Toolbox": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "py-mcp-ko-weather"
      ]
    }
  }
}

Using with Claude

Once configured, you can ask Claude questions like:

  • "서울특별시 서초구 양재1동의 날씨는?"

  • "부산광역시 해운대구 우동의 날씨 예보를 알려줘"

  • "경기도 성남시 분당구의 현재 기온은?"

API Reference

Tools

Get Grid Location

get_grid_location(city: str, gu: str, dong: str) -> dict

Retrieves the grid coordinates (nx, ny) used by the Korea Meteorological Administration API for the specified location. This tool searches the database for the exact coordinates based on city/province, district/county, and neighborhood/town information.

Get Forecast

get_forecast(city: str, gu: str, dong: str, nx: int, ny: int) -> str

Calls the KMA's ultra-short-term forecast API to provide weather forecast information for a specific location. Returns comprehensive weather data including temperature, precipitation, sky condition, humidity, wind direction, and wind speed.

Resources

Weather Instructions

GET weather://instructions

Provides detailed documentation on how to use the Korea Weather MCP server, including tool workflows and response formats.

Prompts

Weather Query

The server includes a structured prompt template for guiding conversations about weather queries, ensuring efficient information gathering and clear presentation of forecast data.

Response Format

Weather forecast responses are provided in structured text format, optimized for LLM processing:

Weather forecast for 서울특별시 서초구 양재1동 (coordinates: nx=61, ny=125)
Date: 2025-05-01
Time: 15:00

Current conditions:
Temperature: 22.3°C
Sky condition: Mostly clear
Precipitation type: None
Precipitation probability: 0%
Humidity: 45%
Wind direction: Northwest
Wind speed: 2.3 m/s

Hourly forecast:
16:00 - Temperature: 21.8°C, Sky: Clear, Precipitation: None
17:00 - Temperature: 20.5°C, Sky: Clear, Precipitation: None
18:00 - Temperature: 19.2°C, Sky: Clear, Precipitation: None
...

Acknowledgements

License

This project is licensed under the MIT License - see the LICENSE file for details.

Available Tools

2 tools
get_forecastC

한국 기상청의 초단기예보 API를 호출하여 특정 지역의 날씨 예보 정보를 제공합니다. 사용자가 입력한 지역 정보와 격자 좌표를 바탕으로 현재 시점에서의 기상 정보를 조회합니다. 이 도구는 온도, 강수량, 하늘상태, 습도, 풍향, 풍속 등 상세한 기상 정보를 포함하며, 6시간 이내의 단기 예보를 제공합니다.

Inputs: city (required), gu (required), dong (required), nx (required), +1 more. Returns: result

get_grid_locationA

한국 기상청 API에 사용되는 격자 좌표(nx, ny)를 조회합니다. 사용자가 입력한 시/도, 구/군, 동/읍/면 정보를 바탕으로 해당 지역의 기상청 격자 좌표를 데이터베이스에서 검색하여 반환합니다. 이 도구는 기상청 API 호출에 필요한 정확한 좌표값을 얻기 위해 필수적으로 사용됩니다.

Inputs: city (required), gu (required), dong (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools have clearly distinct purposes: get_forecast retrieves weather forecast data, while get_grid_location provides grid coordinates needed for API calls. There is no overlap in functionality, and an agent can easily tell them apart based on their descriptions.

    Naming Consistency5/5

    Both tools follow a consistent verb_noun naming pattern (get_forecast, get_grid_location). The naming is predictable and readable, with no deviations or mixed conventions.

    Tool Count2/5

    With only two tools, the server feels thin for a weather service domain. While the tools cover forecast retrieval and coordinate lookup, there are likely gaps in functionality (e.g., historical data, alerts, or broader regional coverage) that could limit agent workflows.

    Completeness2/5

    The tool set is severely incomplete for a weather service. It lacks essential operations such as historical weather data, severe weather alerts, multi-day forecasts, or location search beyond grid coordinates. Agents will face dead ends when trying to perform common weather-related tasks.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      C
      quality
      D
      maintenance
      An MCP server that provides access to current weather data and 5-day forecasts via the Open Weather13 API. It enables users to retrieve weather information using city names or geographic coordinates across various languages.
      3
      -
    • F
      license
      A
      quality
      D
      maintenance
      An MCP server that provides Korean weather information from the Korea Meteorological Administration's short-term forecast API, enabling natural language queries about weather conditions such as current weather, rain forecasts, and suitability for outdoor activities.
      3
      12
      -