ednybracho/mcp-server-weather
If you are the rightful owner of mcp-server-weather and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Weather MCP Server is an example server built with FastMCP to fetch weather data from the US National Weather Service, providing tools for MCP clients.
Weather MCP Server
This repository contains an example server built with FastMCP to fetch weather data from the US National Weather Service. It exposes tools that can be invoked through an MCP client.
Requirements
- Python 3.12 (see
.python-version
) - Dependencies listed in
pyproject.toml
and locked inuv.lock
httpx
mcp[cli]
Setup
Create a virtual environment and install the project in editable mode:
python -m venv .venv
source .venv/bin/activate
pip install -e .
If you use the uv
package manager you can reproduce the locked environment:
uv pip install --system -r uv.lock
Running the server
Start the FastMCP server with:
python weather.py
This launches the server using the stdio
transport. The following tools become available to an MCP client:
get_alerts(state)
– Fetch active alerts for a US state.get_forecast(latitude, longitude)
– Retrieve a forecast for a geographic location.
For a quick sanity check you can also run python main.py
, which prints a greeting.
Project layout
weather.py
– Server implementation and API calls.pyproject.toml
– Project metadata and core dependencies.uv.lock
– Lock file generated by the uv package manager..python-version
– Specifies the required Python version.main.py
– Simple entry point used for testing the environment.