MCP Weather Server

Fornece previsões meteorológicas horárias usando a API AccuWeather.

Documentação

MCP Weather Server

Um servidor MCP simples que fornece previsões meteorológicas horárias usando a API AccuWeather.

Configuração

  1. Instale as dependências usando uv:
uv venv
uv sync
  1. Crie um arquivo .env com sua chave da API AccuWeather:
ACCUWEATHER_API_KEY=your_api_key_here

Você pode obter uma chave de API registrando-se em AccuWeather API.

Executando o Servidor

{
    "mcpServers": {
        "weather": {
            "command": "uvx",
            "args": ["--from", "git+https://github.com/adhikasp/mcp-weather.git", "mcp-weather"],
            "env": {
                "ACCUWEATHER_API_KEY": "your_api_key_here"
            }
        }
    }
}

Uso da API

Obter Previsão Meteorológica Horária

Resposta:

{
    "location": "Jakarta",
    "location_key": "208971",
    "country": "Indonesia",
    "current_conditions": {
        "temperature": {
            "value": 32.2,
            "unit": "C"
        },
        "weather_text": "Partly sunny",
        "relative_humidity": 75,
        "precipitation": false,
        "observation_time": "2024-01-01T12:00:00+07:00"
    },
    "hourly_forecast": [
        {
            "relative_time": "+1 hour",
            "temperature": {
                "value": 32.2,
                "unit": "C"
            },
            "weather_text": "Partly sunny",
            "precipitation_probability": 40,
            "precipitation_type": "Rain",
            "precipitation_intensity": "Light"
        }
    ]
}

A API fornece:

  • Condições meteorológicas atuais, incluindo temperatura, descrição do tempo, umidade e status de precipitação
  • Previsão de 12 horas com dados horários, incluindo:
    • Tempo relativo ao horário atual
    • Temperatura em Celsius
    • Descrição do tempo
    • Probabilidade, tipo e intensidade de precipitação