weather-mcp

This repository hosts a Model Context Protocol (MCP) server that fetches and provides 5-day weather forecasts for locations in Canada using the Government of Canada Weather API, integrating with Claude

0
0

Weather MCP Server

This repository hosts a Model Context Protocol (MCP) server designed to provide weather forecast data sourced from the Government of Canada Weather API. It allows users to retrieve weather forecasts for any location within Canada by specifying its latitude and longitude coordinates.

Features

  • Fetches weather forecasts for Canadian locations using latitude and longitude.
  • Seamlessly integrates with Claude Desktop and other MCP-compatible clients.

Installation

Prerequisites

  • Python 3.13 or higher
  • mise or another Python version manager (optional)

Installation Steps

Detailed instructions are provided for cloning the repository, setting up a virtual environment (recommended), and installing the necessary dependencies using pip install -e ..

Usage

Running as a standalone server

The server can be run directly using python weather.py.

Integration with Claude Desktop

Configuration steps are outlined for integrating the server with Claude Desktop by modifying the claude_desktop_config.json file to include the path to the weather.py script.

Using with other MCP hosts

Instructions are provided for configuring other MCP hosts to execute weather.py using Python 3.13 or higher.

API Reference

get_forecast(latitude: float, longitude: float) -> str

This function retrieves a 5-day weather forecast for a given location, specified by latitude and longitude. The function returns a formatted string containing the forecast.

Development

Running Tests

The project includes tests that can be run using pytest.

Contributing

Contributions are encouraged through Pull Requests.

License

The project is licensed under the terms specified in the repository's license file.

Repository

SE
SeanLF

SeanLF/weather-mcp

Created

March 3, 2025

Updated

March 3, 2025

Language

Python

Category

Developer Tools