Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather Service

A weather service that provides current weather and forecasts for US and Canadian cities.

Setup

  1. Install dependencies using uv:
uv pip install python-dotenv httpx

Note: Project uses uv for dependency management. The dependencies are already specified in pyproject.toml and locked in uv.lock.

  1. Create a .env file from the example:
cp .env.example .env
  1. Add your OpenWeather API key to the .env file:
OPENWEATHER_API_KEY=your_api_key_here

Usage

The service provides two main tools:

  1. Get current weather:
# With country code
await get_current_weather("Toronto", country="CA")
await get_current_weather("New York", country="US")

# Without country code
await get_current_weather("Chicago")
  1. Get forecast:
# 5-day forecast with country code
await get_forecast("Vancouver", days=5, country="CA")
await get_forecast("Seattle", days=3, country="US")

# Without country code
await get_forecast("Chicago", days=2)

Response Format

The service returns JSON-formatted responses with weather information:

Current Weather

{
  "location": "Toronto, CA",
  "conditions": "Clear Sky",
  "temperature": "20°C",
  "feels_like": "18°C",
  "humidity": "65%",
  "wind_speed": "5.2 m/s",
  "pressure": "1013 hPa"
}

Forecast

{
  "forecasts": [
    {
      "date": "2025-01-26",
      "conditions": "Partly Cloudy",
      "temperature": "22°C",
      "feels_like": "20°C",
      "humidity": "70%",
      "wind_speed": "4.1 m/s"
    }
  ]
}

Development

The project uses:

  • uv for Python package management
  • python-dotenv for environment variable management
  • httpx for async HTTP requests
  • FastMCP for MCP server implementation

About

MPC server that use openweathermap

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages