li000592/weather-mcp
If you are the rightful owner of weather-mcp 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.
A Model Context Protocol (MCP) server that provides weather information using the National Weather Service API.
Weather MCP Server
A Model Context Protocol (MCP) server that provides weather information using the National Weather Service API.
Features
- Weather Alerts: Get active weather alerts for any US state
- Weather Forecasts: Get detailed weather forecasts for any location (latitude/longitude)
- Clean Architecture: Modular codebase with separation of concerns
Tools
get_alerts
Get weather alerts for a US state.
Parameters:
state(string): Two-letter state code (e.g., "CA", "NY")
Example:
{
"state": "CA"
}
get_forecast
Get weather forecast for a specific location.
Parameters:
latitude(number): Latitude of the location (-90 to 90)longitude(number): Longitude of the location (-180 to 180)
Example:
{
"latitude": 37.7749,
"longitude": -122.4194
}
Installation
-
Clone the repository
-
Install dependencies:
npm install -
Build the project:
npm run build
Development
This project is built with TypeScript and follows the MCP Node.js quickstart guide.
Project Structure
src/
├── index.ts # Main server entry point
├── types.ts # TypeScript interfaces and types
├── api-client.ts # NWS API client
├── formatters.ts # Data formatting utilities
└── tools.ts # MCP tool definitions
Building
npm run build
This compiles TypeScript to JavaScript in the build/ directory and makes the main file executable.
Setup with Claude Desktop
To use this weather server with Claude Desktop:
-
Build the server (if not already done):
npm run build -
Find your Claude Desktop configuration file:
- macOS/Linux:
~/Library/Application\ Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
You can open it directly with:
# macOS/Linux code ~/Library/Application\ Support/Claude/claude_desktop_config.json - macOS/Linux:
-
Add the weather server to your configuration:
{ "mcpServers": { "weather": { "command": "node", "args": ["/ABSOLUTE/PATH/TO/PARENT/FOLDER/weather/build/index.js"] } } }Replace
/ABSOLUTE/PATH/TO/PARENT/FOLDER/weatherwith the actual absolute path to your weather project directory. -
Save the configuration file and restart Claude Desktop.
The MCP UI elements will only show up in Claude Desktop if at least one server is properly configured.
API Data Source
This server uses the National Weather Service (NWS) API, which provides weather data for locations within the United States. The API is free and does not require authentication.
License
ISC