Skip to main content

MCP weather server using MSN Weather API

Project description

MCP Server MSN Weather

A Model Context Protocol (MCP) server that provides weather data using the MSN Weather API. This server enables access to weather alerts and forecasts for any location using latitude and longitude coordinates.

Installation

pip install mcp-server-msnweather

Requirements

  • Python >= 3.10
  • httpx >= 0.28.1
  • mcp[cli] >= 1.2.0

Usage

  1. First, obtain an MSN Weather API key from Microsoft.

  2. Start the server with your API key:

mcp-server-msnweather --apikey YOUR_API_KEY

Available Tools

get_alerts

Fetches weather alerts for a specific location.

Parameters:

  • latitude (float): Latitude of the location
  • longitude (float): Longitude of the location

Example:

result = await mcp.call_tool("get_alerts", {
    "latitude": 47.6062,
    "longitude": -122.3321
})

get_forecast

Gets a 7-day weather forecast for a specific location.

Parameters:

  • latitude (float): Latitude of the location
  • longitude (float): Longitude of the location

Example:

result = await mcp.call_tool("get_forecast", {
    "latitude": 47.6062,
    "longitude": -122.3321
})

Development

To set up the development environment:

# Clone the repository
git clone https://github.com/yourusername/mcp-server-msnweather.git
cd mcp-server-msnweather

# Create a virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows use: .venv\Scripts\activate

# Install in development mode
pip install -e .

License

See the LICENSE file for details.

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

mcp_server_msnweather-0.2.0.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_server_msnweather-0.2.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file mcp_server_msnweather-0.2.0.tar.gz.

File metadata

  • Download URL: mcp_server_msnweather-0.2.0.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for mcp_server_msnweather-0.2.0.tar.gz
Algorithm Hash digest
SHA256 22950f72e52c80eb800c491ac8b9127152f3bbc7314297d4b6f3e87a9a5b724d
MD5 9c3bf863702eab234724dcb7e73c8fec
BLAKE2b-256 c4c5b08a601e7ceaffa0fb1ecb65c963255d2936b569b1721477d7d2295c13b8

See more details on using hashes here.

File details

Details for the file mcp_server_msnweather-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_server_msnweather-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a9c11527f86cb695c6225b2c773ecf072c5e2a0635a0c65670de327f96ecdcde
MD5 6c16c2d4fb87642da6d5d553463d67be
BLAKE2b-256 97abc51a71fbe9f8dda4c296fb3958b54dd36f6bf6a2c0d34340d1d3cc2debc4

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