Skip to main content

Korea Weather

Project description

Korea Weather MCP Server

smithery badge 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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iflow_mcp_jikime_py_mcp_ko_weather-0.1.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file iflow_mcp_jikime_py_mcp_ko_weather-0.1.0.tar.gz.

File metadata

  • Download URL: iflow_mcp_jikime_py_mcp_ko_weather-0.1.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_jikime_py_mcp_ko_weather-0.1.0.tar.gz
Algorithm Hash digest
SHA256 28ecb4e85d88fd420c9b2b5dee95f8f990547ba3395f1a4e7e669f5c2ee76366
MD5 b4496242f3d2c5307dd916ac0883ffaa
BLAKE2b-256 2ac9e09324fbe1e11043a62c728813ab7072e772c62140bb1e75c97c5b30860f

See more details on using hashes here.

File details

Details for the file iflow_mcp_jikime_py_mcp_ko_weather-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_jikime_py_mcp_ko_weather-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_jikime_py_mcp_ko_weather-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f31fa094bf8e95db26880e34c8f8c32ed40bf6835d11ee30ab3e4a1508c081d0
MD5 875147a57a75ae91ee82c5d4c1fdb0bd
BLAKE2b-256 745c99132f9c1e57c53aea780e74cdfcfa5ad6f626caa8d2ff61b438ee57ef62

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page