Skip to main content
Glama

Herramienta meteorológica MCP (enfocada en India)

Un servidor MCP (Protocolo de contexto de modelo) que utiliza la API de OpenWeatherMap para proporcionar:

  • Condiciones meteorológicas en tiempo real

  • Pronósticos meteorológicos de 5 días

  • Datos de calidad del aire

  • Búsqueda de ubicación


🚀 Configuración

  1. Se requiere Python 3.10+ .

  2. Instalar dependencias:

    pip install -r requirements.txt
  3. Obtenga una clave API de OpenWeatherMap .

  4. Cree un archivo en la carpeta raíz:

    OPENWEATHER_API_KEY=your_api_key_here

🛠 Herramientas disponibles

get_current_weather(location: str)

Devuelve el clima actual para una ubicación determinada.

get_weather_forecast(location: str, days: int = 5)

Devuelve un pronóstico del tiempo (hasta 5 días) para la ubicación.

get_air_quality(location: str)

Devuelve métricas de calidad del aire y el nivel de AQI.

search_location(query: str)

Devuelve hasta 5 coincidencias de ubicación según la consulta.


Ejemplo de salida (India)

Clima actual (Delhi)

{ "location": { "name": "Delhi", "country": "IN", "lat": 28.6139, "lon": 77.2090 }, "temperature": { "current": 32.4, "feels_like": 35.1, "min": 30.0, "max": 36.2 }, "weather_condition": { "main": "Haze", "description": "smoky haze", "icon": "50d" }, "wind": { "speed": 4.1, "deg": 135 }, "clouds": 20, "humidity": 58, "pressure": 1005, "visibility": 5000, "sunrise": "2025-03-16T06:20:00", "sunset": "2025-03-16T18:40:00", "timestamp": "2025-03-16T14:30:00" }

Pronóstico del tiempo (Bombay)

{ "location": { "name": "Mumbai", "country": "IN", "lat": 19.0760, "lon": 72.8777 }, "forecast": [ { "datetime": "2025-03-16T12:00:00", "temperature": { "temp": 33.2, "feels_like": 37.8, "min": 31.5, "max": 34.0 }, "weather_condition": { "main": "Clouds", "description": "scattered clouds", "icon": "03d" }, "wind": { "speed": 3.9, "deg": 200 }, "clouds": 40, "humidity": 70, "pressure": 1008, "visibility": 10000, "pop": 0.1 } ], "days": 5 }

Calidad del aire (Bangalore)

{ "location": { "name": "Bengaluru", "country": "IN", "lat": 12.9716, "lon": 77.5946 }, "air_quality_index": 2, "air_quality_level": "Fair", "components": { "co": 102.4, "no": 0.0, "no2": 12.6, "o3": 30.5, "so2": 3.8, "pm2_5": 45.1, "pm10": 60.2, "nh3": 1.5 }, "timestamp": "2025-03-16T14:30:00" }

Búsqueda de ubicación

{ "results": [ { "name": "Kolkata", "state": "West Bengal", "country": "IN", "lat": 22.5726, "lon": 88.3639 }, { "name": "Kolkata", "state": "", "country": "IN", "lat": 22.5675, "lon": 88.3700 } ] }

🧰 Manejo de errores

Todas las herramientas devuelven mensajes de error claros:

{ "error": "Location 'XYZ' not found" }

📌 Notas

  • Asegúrese de que el archivo .env esté configurado correctamente.

  • Las claves API pueden tardar un tiempo en activarse.

  • Nivel gratuito de OpenWeatherMap: 60 llamadas API por minuto.


🧑‍💻 Ejecutar el servidor

mcp dev main.py

Una vez en funcionamiento, puede utilizar este servidor con clientes compatibles con MCP como Claude Desktop u otras herramientas de automatización.


-
security - not tested
F
license - not found
-
quality - not tested

Related MCP Servers

  • A
    security
    A
    license
    A
    quality
    An MCP server that provides real-time weather information including temperature, humidity, wind speed, and sunrise/sunset times through the OpenWeatherMap API.
    Last updated -
    1
    2
    MIT License
    • Linux
    • Apple
  • -
    security
    F
    license
    -
    quality
    An MCP server implementation that allows users to fetch and display weather information for specified cities, including temperature, humidity, wind speed, and weather descriptions.
    Last updated -
    1
    • Linux
    • Apple
  • -
    security
    -
    license
    -
    quality
    An MCP server that connects to OpenWeatherMap's API to provide current weather data and multi-day forecasts for locations worldwide in different measurement units.
  • -
    security
    F
    license
    -
    quality
    An MCP server that provides weather information like forecasts and alerts for US locations using the National Weather Service API.
    Last updated -
    5

View all related MCP servers

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jalaj-pandey/Weather-MCP-Tool'

If you have feedback or need assistance with the MCP directory API, please join our Discord server