SuperAPIAI Directory

weekly-weather-mcp

github.com · AI developer platforms

Detailed seven-day weather forecasts for anywhere in the world.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)

About this tool

Purpose

weekly-weather-mcp is a weather forecasting MCP (Model Context Protocol) server designed to provide detailed weather data for any location worldwide to AI clients that support MCP (such as Claude Desktop and Cursor), with a particular focus on a one-week (8-day) forecast to help users plan outdoor activities.

Main capabilities

  • Query weather conditions for any location worldwide.
  • Provide an hourly forecast for the next 48 hours.
  • Provide a detailed 8-day forecast (today + the following 7 days), with each day including data for three time points: morning (9:00), afternoon (15:00), and evening (20:00).
  • Include a weather summary and probability of precipitation.
  • Provide detailed weather information such as temperature, feels-like temperature, humidity, and wind speed.
  • Support reporting results by different time zones (via the timezone_offset parameter, for example Beijing is 8, New York is -4, and the default is 0, i.e. UTC time).
  • No separate configuration file is required; the API key can be passed directly via environment variables or call parameters.

How to use

1. Get an OpenWeatherMap API key

You need to register an OpenWeatherMap account and subscribe to the "One Call API 3.0" plan (the free tier provides 1,000 API calls per day). Activation of the API key may take from a few minutes to an hour.

2. Clone the repository and install dependencies

(No specific installation commands are provided in the material, so they are not provided here for now.)

3. Run the server

There are two ways to provide the API key: run directly without setting an environment variable, in which case you need to provide the api_key parameter when calling the tool. (The other method is not explicitly described in the material.)

4. Configure in an MCP client

Add the configuration in an MCP-supported client (such as Claude Desktop or Cursor). If using a virtual environment, the configuration needs to include the full path to the Python executable in the virtual environment. (Specific configuration examples are not provided in the material.)

5. Available tools

The server exposes two tools:get_weather and get_current_weather. Both accept the same parameters:

  • location: A location name string, for example "Beijing", "New York", "Tokyo"; the tool automatically performs geocoding to convert it into latitude and longitude.
  • api_key: OpenWeatherMap API key (optional; if not provided, it is read from an environment variable).
  • timezone_offset: Time zone offset in hours, for example Beijing is 8, New York is -4, and the default is 0 (UTC). The times in the returned data will be displayed accurately for that time zone.

get_weather returns comprehensive weather data, including current weather, an hourly forecast for the next 48 hours, an 8-day forecast (with morning, afternoon, and evening data points each day), weather summary, probability of precipitation, temperature, humidity, wind speed, and more. get_current_weather Only returns current weather information (temperature, feels-like temperature, weather conditions, humidity, wind, etc.), does not include future forecasts, suitable for quickly checking current conditions.

6. Location Parameter Usage

Location names are converted to coordinates via OpenWeatherMap's geocoding:

  • Simple place names can be used: "Paris", "Tokyo", "New York".
  • To improve accuracy, include the country code: "Paris,FR", "London,GB", "Portland,US".
  • US cities can include the state: "Portland,OR,US" or "Portland,ME,US".
  • Supports any Earth location that OpenWeatherMap can geocode.
  • If the location cannot be found, the API will return an error. If ambiguous, add the country or state code.

Use Cases

  • "🏃‍♂️ Which days this week are suitable for running?"
  • "🪴 Which evening this week is best for tending the garden?"
  • "🪁 Which upcoming day has the most wind and is suitable for flying a kite?"
  • "💧 Does the garden need watering this week, or is rain enough?"
  • Can be combined with other MCP servers to implement multi-step workflows, for example, after checking the weather, have Claude add an event reminder to the calendar.

Limitations

  • Requires a valid OpenWeatherMap API key and a subscription to the One Call API 3.0 plan.
  • The free tier allows 1,000 calls per day; exceeding this will be charged according to OpenWeatherMap pricing; a call limit can be set to prevent overspending.
  • Reaching the limit will result in an HTTP 429 error.
  • API key activation may take up to one hour.
  • Location names may not be found due to spelling errors or being too remote.
  • For places with duplicate names, it is recommended to add the country/state code to avoid errors.

Development and Testing

The project includes unit tests, integration tests, and mock client test files. You can use the test script to verify the API key and installation: set the environment variable export OPENWEATHER_API_KEY="your_api_key", then run python3 test_mcp_client.py. The test script directly calls the weather function to check the current weather in New York and display the results. The tests use a sample API response file (test_weather_response.json) to simulate responses, requiring no key or network.

This project is modified based on Zippland's original Weather MCP. The modifications include: integrating the OpenWeatherMap One Call API 3.0, extending forecast data from 2 days to 8 days, adding daily morning, noon, and evening data points, including weather summaries, wind speed, and precipitation probability, and adding unit tests, integration tests, and mock client test files.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools