Skip to main content

weather-forecast-server: MCP server for weather forecast

Project description

Weather Forecast MCP Server

A Model Context Protocol (MCP) server for retrieving weather information using the wttr.in service.

Overview

This MCP server provides tools for accessing current weather conditions and forecasts for locations worldwide. It can be easily integrated with MCP clients, including Claude and other LLM applications supporting the MCP protocol.

Features

  • Get current weather for any location
  • Get multi-day weather forecasts (up to 3 days)
  • Support for both Chinsee/English and other language location names
  • Easy integration with MCP client applications

Installation

You can install the MCP Weather Server using uv:

uv install weather-forecast-server

Or using pip:

pip install weather-forecast-server

Usage

Python Demo

from weather_forecast_server import get_current_weather
print(get_current_weather('保定')) # can be baoding or "保定"

Running as a standalone MCP server

Run the server with the stdio transport:

uv run weather-forecast-server

Integrating with Cursor

To add the weather MCP server to Cursor, add stdio MCP with command:

uv run weather-forecast-server

Tools available

  1. get_weather - Get current weather conditions for a location (up to 3 days)

Example

Using the server with the MCP CLI:

# Start the MCP inspector for testing
uv run mcp dev weather-forecast-server

Development

To set up a development environment:

git clone https://github.com/shibing624/mcp-server-weather.git
cd weather-forecast-server

pip install -e .

Contact

  • Issues and suggestions: GitHub issues
  • Email: xuming624@qq.com
  • WeChat: Add me (WeChat ID: xuming624) with the message: "Name-Company-NLP" to join our NLP discussion group.

License

This project is licensed under The Apache License 2.0 and can be used freely for commercial purposes. Please include a link to codev and the license in your product documentation.

Contribute

We welcome contributions to improve this project! Before submitting a pull request, please:

  1. Add appropriate unit tests in the tests directory
  2. Run python -m pytest to ensure all tests pass
  3. Submit your PR with clear descriptions of the changes

Acknowledgements

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

weather_forecast_server-0.0.2.tar.gz (9.0 kB view details)

Uploaded Source

File details

Details for the file weather_forecast_server-0.0.2.tar.gz.

File metadata

  • Download URL: weather_forecast_server-0.0.2.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for weather_forecast_server-0.0.2.tar.gz
Algorithm Hash digest
SHA256 e732875ae301d02028b6c1af1b08bdbca08563329c153ad45b83ae8df8d546d5
MD5 5ee512922194f339fe7ef70f99ba6817
BLAKE2b-256 f3d2a24ca3d04d2ab02940ef62915de3564ed84d645b6b414a898034b8a67d50

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page