weather-mx-mcp-server

TonyVM/weather-mx-mcp-server

3.2

If you are the rightful owner of weather-mx-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

Weather Mexico MCP Server provides current weather and forecasts for Mexican cities using the OpenWeatherMap API.

Weather Mexico MCP Server

Servidor MCP para consultar el clima actual y el pronóstico de ciudades mexicanas usando la API de OpenWeatherMap.

🚀 Características principales

  • Consulta de clima actual por ciudad y estado
  • Pronóstico meteorológico de 5 días
  • Base de datos con más de 9,320 ciudades mexicanas
  • Normalización automática de nombres (acentos y mayúsculas/minúsculas)
  • Resolución de ambigüedades por ciudades con nombres repetidos

📦 Instalación rápida

  1. Clona el repositorio:

    git clone <repo-url>
    cd weather_mx
    
  2. Instala las dependencias:

    pip install -r requirements.txt
    # O si usas pyproject.toml:
    pip install pandas httpx python-dotenv fastmcp
    
  3. Configura tu API Key:

    • Regístrate en OpenWeatherMap y copia tu API key en el archivo .env:
      OPENWEATHER_API_KEY=tu_api_key_aqui
      

🛠️ Uso básico

Ejecuta el servidor MCP:

python main.py

Funciones principales

  • get_weather_mexico(city, state)
    Clima actual para una ciudad y estado.
  • get_forecast_mexico(city)
    Pronóstico de 5 días para una ciudad.

Ejemplo de consulta:

get_weather_mexico("merida", "yucatan")
get_weather_mexico("guadalupe", "zacatecas")

Ejemplos en lenguaje natural:

  • "Dame el clima de la ciudad de Guadalupe en Zacatecas"
  • "Dame el clima en Monterrey"
  • "¿Cómo está el clima en Ciudad de México?"
  • "¿Cuál es el pronóstico en Mérida?"

📊 Base de datos

  • Archivo: cities.json
  • Campos: name, latitude, longitude, state_name
  • Formato: JSON

🔧 Archivos esenciales del proyecto

weather_mx/
├── main.py         # Servidor MCP principal
├── cities.json     # Base de datos de ciudades mexicanas
├── pyproject.toml  # Configuración de dependencias
├── .env            # Variables de entorno (API key)
└── README.md       # Documentación

📝 Licencia

MIT

🙏 Créditos


Weather Mexico MCP Server (English)

A MCP server to get current weather and forecast for Mexican cities using the OpenWeatherMap API.

🚀 Main Features

  • Get current weather by city and state
  • 5-day weather forecast
  • Database with over 9,320 Mexican cities
  • Automatic normalization of names (accents and case)
  • Resolves ambiguities for cities with repeated names

📦 Quick Installation

  1. Clone the repository:

    git clone <repo-url>
    cd weather_mx
    
  2. Install dependencies:

    pip install -r requirements.txt
    # Or if you use pyproject.toml:
    pip install pandas httpx python-dotenv fastmcp
    
  3. Configure your API Key:

    • Register at OpenWeatherMap and copy your API key into the .env file:
      OPENWEATHER_API_KEY=your_api_key_here
      

🛠️ Basic Usage

Run the MCP server:

python main.py

Main Functions

  • get_weather_mexico(city, state)
    Get current weather for a city and state.
  • get_forecast_mexico(city)
    Get 5-day forecast for a city.

Example queries:

get_weather_mexico("merida", "yucatan")
get_weather_mexico("guadalupe", "zacatecas")

Natural language examples:

  • "Give me the weather in Guadalupe, Zacatecas"
  • "What's the weather like in Monterrey?"
  • "How's the weather in Mexico City?"
  • "What's the forecast in Mérida?"

📊 Database

  • File: cities.json
  • Fields: name, latitude, longitude, state_name
  • Format: JSON

🔧 Essential Project Files

weather_mx/
├── main.py         # Main MCP server
├── cities.json     # Mexican cities database
├── pyproject.toml  # Dependency configuration
├── .env            # Environment variables (API key)
└── README.md       # Documentation

📝 License

MIT

🙏 Credits