Skip to main content
Glama
MCP Weather Server

MCP Weather Server

by aaudeon

Serveur MCP Weather

Serveur Model Context Protocol (MCP) fournissant des informations météorologiques en temps réel via l'API Open-Meteo.

✨ Fonctionnalités

  • 🌤️ Météo actuelle par nom de ville ou coordonnées

  • 📅 Prévisions jusqu'à 7 jours

  • 🌍 Support multilingue (français, anglais, espagnol, allemand, etc.)

  • 🆓 API gratuite Open-Meteo (sans clé requise)

  • 🐳 Prêt pour Docker avec configuration de production optimisée

  • 📊 TypeScript strict avec validation des paramètres

Related MCP server: Weather MCP Server

🚀 Installation et démarrage rapide

Prérequis

  • Node.js 18+

  • Docker et Docker Compose (optionnel)

Méthode 1: Démarrage local

# Installation des dépendances
npm install

# Construction
npm run build

# Démarrage
npm start

Méthode 2: Docker (recommandé pour production)

# Déploiement automatique
chmod +x deploy.sh
./deploy.sh

📋 Outils MCP disponibles

get_weather

Obtient la météo actuelle pour une ville.

{
  "city": "Paris",
  "countryCode": "FR",
  "lang": "fr"
}

get_weather_forecast

Obtient les prévisions météo (1-7 jours).

{
  "city": "London",
  "days": 5,
  "lang": "en"
}

get_weather_by_coordinates

Obtient la météo par coordonnées GPS.

{
  "latitude": 48.8566,
  "longitude": 2.3522,
  "lang": "fr"
}

⚙️ Configuration

Copiez .env.example vers .env et ajustez si nécessaire :

# Port du serveur (optionnel)
MCP_SERVER_PORT=3000

# Langue par défaut
DEFAULT_LANGUAGE=fr

# Environnement
NODE_ENV=production

🛠️ Développement

# Mode développement avec rechargement automatique
npm run dev

# Vérification du code
npm run lint
npm run typecheck

# Formatage du code
npm run format

📦 Structure du projet

src/
├── index.ts              # Point d'entrée principal
├── services/
│   └── weatherService.ts # Service API Open-Meteo
├── utils/
│   ├── formatter.ts      # Formatage des réponses
│   └── validation.ts     # Validation des paramètres
├── types/
│   └── weather.ts        # Types TypeScript
└── constants/
    └── weather.ts        # Constantes et configurations

🐳 Production avec Docker

Le projet inclut une configuration Docker optimisée avec :

  • Build multi-stage pour une image légère

  • Utilisateur non-root pour la sécurité

  • Healthchecks intégrés

  • Logs structurés

# Construction manuelle
docker build -t mcp-weather-server .

# Ou via docker-compose
docker-compose up -d

🔧 Intégration MCP

Ce serveur est compatible avec tous les clients MCP. Exemple d'utilisation avec Claude Desktop :

{
  "mcpServers": {
    "weather": {
      "command": "node",
      "args": ["/chemin/vers/dist/index.js"]
    }
  }
}

📄 License

MIT - Voir le fichier LICENSE pour plus de détails.


Développé avec ❤️ en TypeScript

Available Tools

3 tools
get_weatherB

Obtient les informations météorologiques actuelles pour une ville

Inputs: city (required), country, lang, units.

get_weather_by_coordinatesB

Obtient les informations météorologiques actuelles par coordonnées GPS

Inputs: lat (required), lon (required), lang, units.

get_weather_forecastC

Obtient les prévisions météorologiques sur 5 jours pour une ville

Inputs: city (required), country, lang, units.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: get_weather provides current weather for a city, get_weather_by_coordinates provides current weather for GPS coordinates, and get_weather_forecast provides 5-day forecasts for a city. There is no overlap or ambiguity between these three functions.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern with 'get_weather' as the base, plus modifiers ('by_coordinates', 'forecast') to differentiate them. The naming is perfectly predictable and follows the same style throughout.

    Tool Count3/5

    With only 3 tools, the server feels somewhat thin for a weather domain that typically includes more features like historical data, alerts, or air quality. However, it covers basic current and forecast needs, placing it in the borderline range.

    Completeness4/5

    The tools provide good coverage for core weather queries: current conditions by city and coordinates, and multi-day forecasts. A minor gap is the lack of forecast by coordinates, but agents can work around this by using city names from coordinates first.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that provides comprehensive weather data and forecasts through the OpenWeatherMap API, enabling AI assistants to access real-time weather information, forecasts, air quality data, and location services.
      11
      36 npm
      5
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that enables users to fetch weather forecasts through Cursor AI by using natural language queries.
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol (MCP) server that enables AI assistants and LLMs to access real-time weather data and forecasts by connecting to the OpenWeatherMap API.
      -