Get the FREE Ultimate OpenClaw Setup Guide →

weather

A simple minimal weather mcp server :)

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio sjanax01-weather-mcp-server python main.py \
  --env WEATHER_API_KEY="Weather API key (required)"

How to use

This MCP server provides a weather data toolkit based on FastAPI and the MCP framework. It exposes multiple tools for AI assistants to query current conditions, 1-14 day forecasts, historical data, air quality, astronomy data (sunrise/sunset and moon phases), location search, timezone information, and even sports events related to weather contexts. Each tool is designed to be invoked via MCP protocol calls, returning structured weather data that can be consumed by the assisting agent in downstream tasks.

To use the server, run the Python entry point as described in the installation guide. Once running, you can request the available endpoints/tools through the MCP interface and pass parameters such as location (city, coordinates, or place name), date ranges for forecasts, or a time window for historical data. Ensure you have a valid WeatherAPI key configured in the environment so the server can fetch real-time data. The server will respond with JSON objects containing weather metrics, units, and relevant metadata to support decision making, planning, or user-facing responses.

How to install

Prerequisites:

  • Python 3.13+ installed on your system
  • uv (uvx) package manager installed or available in PATH
  • WeatherAPI key (signup at weatherapi.com) and access to the weather data service

Manual installation steps:

  1. Clone the repository:
git clone https://github.com/yourusername/Weather_mcp_server.git
cd Weather_mcp_server
  1. Create and activate a virtual environment with uv:
uv venv
uv pip install -e .
  1. Create a .env file at the project root and add your WeatherAPI key:
WEATHER_API_KEY=your_api_key_here
  1. Run the server:
python main.py

The server will start on http://localhost:8000 by default.

Additional notes

Environment variables and configuration:

  • WEATHER_API_KEY is required for weather data requests. Ensure the key is valid and has the necessary permissions.
  • If the server cannot reach WeatherAPI, verify network access and that the API key is active.
  • The MCP framework will route requests to the appropriate tool (current conditions, forecast, air quality, etc.). For production deployments, consider running behind a reverse proxy and enabling TLS.
  • Adjust default port or host via FastAPI configuration if needed; consult the codebase for port binding options and environment-based overrides.

Related MCP Servers

Sponsor this space

Reach thousands of developers