README.md
Provides AI assistants with tools to retrieve current weather and forecasts.
Weather MCP Server
An MCP (Model Context Protocol) server that provides weather tools for AI assistants, built with xmcp.
Features
Tools
- get-current-weather - Get current weather conditions for any city (temperature, humidity, wind speed)
- get-forecast - Get weather forecast for 1-7 upcoming days
- compare-weather - Compare weather between two cities
Resources
weather://{city}/current- Current weather data as a resource
Prompts
- weather-summary - Generate weather summary prompts
Installation
npm install
Usage
Development
npm run dev
Production
npm run build
npm run start
Inspect with MCP Inspector
npm run inspect
Configuration
Add to your MCP client configuration:
{
"mcpServers": {
"weather": {
"command": "node",
"args": ["/path/to/weather-mcp/dist/stdio.js"]
}
}
}
API
This server uses the free Open-Meteo API for weather data. No API key required.
Tech Stack
- xmcp - MCP framework
- Zod - Schema validation
- Open-Meteo API - Weather data
License
MIT
Tools (3)
get-current-weatherGet current weather conditions for any city (temperature, humidity, wind speed)get-forecastGet weather forecast for 1-7 upcoming dayscompare-weatherCompare weather between two citiesConfiguration
claude_desktop_config.json
{"mcpServers": {"weather": {"command": "node", "args": ["/path/to/weather-mcp/dist/stdio.js"]}}}Try it
→What is the current weather in London right now?
→Give me a 5-day weather forecast for New York City.
→Compare the weather between Tokyo and San Francisco.
→Can you provide a weather summary for Paris using the weather-summary prompt?
→Check the humidity and wind speed in Berlin.