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 by name or address.
Installation
pip install mcp-server-msnweather
Requirements
- Python >= 3.10
- httpx >= 0.28.1
- mcp[cli] >= 1.2.0
Usage
-
You'll need to obtain two API keys:
- MSN Weather API key from Microsoft (for weather data)
- Bing Maps API key (for location search and geocoding)
-
Start the server with your API keys:
mcp-server-msnweather --wxapikey YOUR_WEATHER_API_KEY --autosuggestapikey YOUR_BING_MAPS_API_KEY
Available Tools
get_alerts
Fetches weather alerts for a specific location by name.
Parameters:
location_name(string): Name of the location (e.g., "Seattle, WA")
Example:
result = await mcp.call_tool("get_alerts", {
"location_name": "Seattle, WA"
})
get_forecast
Gets a 7-day weather forecast for a specific location by name.
Parameters:
location_name(string): Name of the location (e.g., "Seattle, WA")
Example:
result = await mcp.call_tool("get_forecast", {
"location_name": "Seattle, WA"
})
get_location_coordinates
Converts a location name to complete location information including latitude and longitude coordinates, region, country, and address.
Parameters:
location_name(string): Name of the location to look up (e.g., "Seattle, WA")
Example:
result = await mcp.call_tool("get_location_coordinates", {
"location_name": "Seattle, WA"
})
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 .
Running Tests
The project includes debug scripts in the debug/ directory to test different features:
# Set your API keys as environment variables
export MSN_WEATHER_API_KEY="your-weather-api-key"
export BING_MAPS_API_KEY="your-bing-maps-api-key"
# Test location lookup
python debug/test_location.py
# Test weather alerts
python debug/test_alerts.py
# Test weather forecast
python debug/test_forecast.py
License
See the LICENSE file for details.
Metadata
Release files for mcp-server-msnweather 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mcp_server_msnweather-0.3.0.tar.gz | 18.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_server_msnweather-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.8 kB
Release files / mcp_server_msnweather-0.3.0.tar.gz
| Download URL | mcp_server_msnweather-0.3.0.tar.gz |
|---|---|
| Size | 18.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d4a73e164964ecdaa99caaddd2c0b5fcef9dbc759077046d9d760714793cbebe
|
|
BLAKE2b-256 checksum How to use checksums |
a863a8b8d49a7baa810865f72255f1501a926fd76750440a75ad25a3554a0591
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.9
|
Release files / mcp_server_msnweather-0.3.0-py3-none-any.whl
| Download URL | mcp_server_msnweather-0.3.0-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
89adcd756a178d1fd3016c699b46bd981cd06b7390c1afb9d0b4961894af3526
|
|
BLAKE2b-256 checksum How to use checksums |
8c7d09a7ba0761b37257f823abe4a776e8790b9fda6a761367af8193f86f1a0f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.9
|