This is a Python implementation of a Model Context Protocol (MCP) server that provides weather information tools.
get_alerts
: Retrieve weather alerts for a US stateget_forecast
: Get weather forecast for a specific location using latitude and longitude
- Run the setup script to create a virtual environment and install dependencies:
./setup.sh
- Open the project in VSCode, which will use the provided configuration:
.vscode/launch.json
: Configures the debugger.vscode/settings.json
: Sets up Python linting and formatting
- Open the project in VSCode
- Select the "Run and Debug" tab (or press
Ctrl+Shift+D
) - Choose "Python: Weather MCP Server" from the dropdown
- Click the play button or press F5 to start the server
# Activate virtual environment
source .venv/bin/activate
# Run the server
python weather_mcp_demo.py
To use this server with Claude:
- Add the server to Claude's MCP configuration
- Configure the command to run the server
- Use the provided tools through Claude's interface
Get weather alerts for a US state.
Parameters:
state
: Two-letter US state code (e.g., CA, NY)
Get weather forecast for a location.
Parameters:
latitude
: Latitude of the locationlongitude
: Longitude of the location