Skip to main content
Glama
mcp-weather

mcp-weather

by Kaushik2105

🌤️ Kaushik's Weather MCP Server

TypeScript Model Context Protocol Node.js Tests Claude Verified License: ISC

Un servidor Model Context Protocol (MCP) listo para producción, construido en TypeScript, que conecta LLMs (como Claude Desktop, Cursor y agentes de IA personalizados) con datos meteorológicos en tiempo real del National Weather Service (NWS / NOAA).


🔗 Prueba de integración en vivo

🚀 Verificado funcionando con Claude Desktop: Echa un vistazo a la sesión de chat en vivo que demuestra la recuperación de pronósticos en tiempo real, alertas y diagnósticos de salud:
👉 Ver prueba de chat en vivo de Claude AI


Related MCP server: mcp-weather

✨ Aspectos destacados de la arquitectura

  • 🏗️ Arquitectura limpia y modular: Desacoplada en capas de servicio dedicadas (CacheService, RateLimiterService, NwsClient, Logger, Formatter).

  • 📡 Boletines meteorológicos oficiales: Informes meteorológicos estructurados con metadatos estandarizados y atribución al proveedor.

  • ⚡ Caché en memoria (TTL de 5 minutos): Caché en memoria segura para subprocesos que reduce el tráfico de API ascendente hasta en un 80%.

  • 🛡️ Capa de seguridad Zero-Vibe: Saneamiento estricto de entradas, escape de entidades XSS y limitación de velocidad aislada por cliente (100 req/min).

  • 🔁 Resiliencia y tolerancia a fallos: Reintentos automáticos con retroceso exponencial para errores HTTP 5xx / 429 y protecciones de tiempo de espera de solicitudes.

  • 🩺 Observabilidad y diagnósticos: Herramientas integradas health_check, get_metrics y clear_cache con registro JSON estructurado.


📁 Estructura del proyecto

weather/
├── src/
│   ├── config/          # Central configuration & runtime constants
│   ├── services/        # Core business logic (Cache, RateLimiter, NwsClient, Formatter, Logger)
│   ├── tools/           # MCP Tool handlers (alerts, forecast, diagnostics)
│   ├── types/           # Strongly typed TypeScript interfaces
│   ├── utils/           # Input sanitization and security helpers
│   └── index.ts         # Server bootstrap, transport initialization & graceful shutdown
├── tests/
│   ├── unit/            # Unit test suites (utils, sanitizer, cache)
│   ├── integration/     # Upstream NWS API integration & retry tests
│   ├── performance/     # Cache throughput & rate-limiting load tests
│   ├── security/        # XSS, injection prevention & boundary tests
│   └── basic.test.ts    # Comprehensive test runner
├── build/               # Compiled ES module JavaScript distribution
├── package.json
└── tsconfig.json

🛠️ Herramientas MCP

Herramienta

Parámetros

Descripción

get_forecast

latitude (number), longitude (number)

Recupera pronósticos por períodos en tiempo real (temperaturas, vientos, condiciones) para coordenadas de EE. UU.

get_alerts

state (código de 2 letras de EE. UU., p. ej. CA, NY, TX)

Obtiene alertas meteorológicas severas activas, avisos y advertencias meteorológicas.

health_check

Ninguno

Devuelve el estado de salud del runtime, tiempo de actividad, uso de memoria heap, tamaño de caché y estado de conexión con la API.

get_metrics

Ninguno

Genera diagnósticos de rendimiento y cubos de clientes con limitación de velocidad activa.

clear_cache

Ninguno

Vacía la caché en memoria y devuelve el número de entradas purgadas.


🚀 Comenzando

1. Clonar e instalar

git clone https://github.com/Kaushik2105/mcp-weather.git
cd mcp-weather
npm install

2. Compilar

npm run build

3. Ejecutar la suite de pruebas

npm test

🔌 Conexión con Claude Desktop

Añade esta configuración a tu archivo de configuración de Claude Desktop:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "kaushik-weather": {
      "command": "node",
      "args": [
        "c:/Workholic/LawSikho/POCs/weather/weather/build/index.js"
      ]
    }
  }
}

Nota: Reinicia Claude Desktop después de guardar la configuración.


💬 Ejemplos de indicaciones para Claude

  • "Muéstrame el boletín oficial de pronóstico de la herramienta meteorológica de Kaushik para Los Ángeles (Lat: 34.0522, Lon: -118.2437)"

  • "¿Hay alguna alerta meteorológica activa para Florida (FL)?"

  • "Ejecuta un diagnóstico de verificación de salud en el servidor MCP meteorológico de Kaushik."


👨💻 Autor

Kaushik Karmakar

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      B
      quality
      D
      maintenance
      Provides real-time US weather alerts and forecasts by integrating with the National Weather Service API. It enables AI assistants to fetch state-specific alerts and detailed local forecasts using geographic coordinates.
      2
      1
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides real-time weather alerts and forecasts from the National Weather Service for US locations, integrating with AI assistants via the Model Control Protocol.
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides real-time weather alerts and forecasts for US locations by integrating with the National Weather Service API. Supports both server and client interactions with optional LLM summarization.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides weather forecasts and alerts for US locations via the National Weather Service API, enabling AI assistants to deliver real-time weather information.
      28 npm
      ISC