Weather MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Weather MCP Server what's the current weather and 5-day forecast for New York City?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Weather MCP Server
A Model Context Protocol (MCP) server that provides real-time and historical weather data using the Open-Meteo API. This server enables AI assistants and applications to access comprehensive weather information through a standardized interface.
Features
This MCP server provides 5 powerful weather tools:
1. get_current_weather
Get real-time current weather conditions for any city worldwide.
Temperature (actual and feels-like)
Humidity
Precipitation
Weather description
Wind speed and direction
2. get_weather_forecast
Retrieve weather forecasts for up to 16 days ahead.
Daily max/min temperatures
Precipitation predictions
Weather conditions
Wind speeds
Perfect for trip planning and event scheduling
3. get_weather_alerts
Check for weather warnings and alerts based on current conditions.
Extreme temperature warnings
High wind alerts
Heavy precipitation notices
Thunderstorm warnings
Real-time condition-based alerts
4. get_growing_conditions
Access agricultural and gardening data.
Growing Degree Days (GDD) calculation
Solar radiation levels
Soil temperature and moisture
Humidity metrics
Customizable base temperature for different crops
5. get_historical_weather
Retrieve historical weather data for specific months.
Monthly statistics over multiple years (up to 10 years back)
Average, max, and min temperatures
Total precipitation
Average wind speed
Climate trend analysis
Related MCP server: Weather MCP Server
Installation
Prerequisites
Node.js 16 or higher
npm or yarn
Setup
Clone the repository:
git clone <repository-url>
cd weather-mcp-serverInstall dependencies:
npm installBuild the project:
npm run buildUsage
Deployment Options
This server supports multiple transport modes:
1. SSE Transport (Recommended for HTTP) ⭐
Server-Sent Events transport provides a persistent, stateful connection over HTTP.
npm run dev:sse # Development (port 3003)
npm run start:sse # Production (port 3003)Benefits:
✅ Persistent connection maintains state across tool calls
✅ Native MCP protocol support over HTTP
✅ Better efficiency for streaming AI interactions
✅ Standards-compliant SSE implementation
Test it:
curl http://localhost:3003/health
curl http://localhost:3003/2. HTTP Proxy (Simple REST API)
Request-response HTTP wrapper for quick testing and REST API usage.
npm run proxy # Runs on port 3002Test it:
npm test
curl "http://localhost:3002/weather/current?city=Manila&country=PH"3. Stdio Transport (Original)
Standard MCP over stdio for Claude Desktop and MCP Inspector.
npm run dev # Development
npm start # ProductionSee INTEGRATION.md for integrating with your Next.js app.
📖 For detailed information about improvements and architecture, see IMPROVEMENTS.md
Running the MCP Server Directly
Development mode (with hot reload):
npm run devProduction mode:
npm startConfiguration with Claude Desktop
Add this server to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"weather": {
"command": "node",
"args": ["/absolute/path/to/weather-mcp-server/dist/index.js"]
}
}
}Or use the development version:
{
"mcpServers": {
"weather": {
"command": "npx",
"args": ["-y", "tsx", "/absolute/path/to/weather-mcp-server/src/index.ts"]
}
}
}Configuration with Other MCP Clients
This server uses the standard MCP protocol over stdio, so it can be integrated with any MCP-compatible client. Refer to your client's documentation for specific configuration instructions.
Development
Project Structure
weather-mcp-server/
├── src/
│ ├── index.ts # Main MCP server (stdio transport)
│ ├── sse-server.ts # SSE transport server with routing (modified)
│ ├── sse-server-fixed.ts # SSE server variant (untracked)
│ └── sse-server-with-routing.ts # SSE server variant (untracked)
├── dist/
│ ├── index.js # Compiled stdio server
│ └── sse-server.js # Compiled SSE server
├── http-proxy.js # HTTP proxy wrapper (11KB)
├── test-integration.js # Integration test suite
├── test-sse.html # SSE transport test page
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── CLAUDE.md # Claude Code instructions
├── INTEGRATION.md # Integration guide for Next.js
├── IMPROVEMENTS.md # Detailed improvements documentation
├── CHANGELOG.md # Version history and changes
└── README.md # This fileAvailable Scripts
npm run build- Compile TypeScript to JavaScriptnpm run dev- Run stdio transport in development modenpm run dev:sse- Run SSE transport in development mode (port 3003) ⭐npm start- Run the compiled stdio transportnpm run start:sse- Run the compiled SSE transport (port 3003) ⭐npm run proxy- Build and start HTTP proxy server (port 3002)npm test- Run integration tests (requires proxy to be running)npm run test:inspector- Test with MCP Inspector (interactive UI)npm run test:manual- Run manual tests
Testing
Option 1: Integration Tests (Recommended)
Start the HTTP proxy and run automated tests:
# Terminal 1: Start the proxy
npm run proxy
# Terminal 2: Run tests
npm testOption 2: MCP Inspector (Interactive UI)
npm run test:inspectorThis will open a web interface where you can:
View all available tools
Test each tool with different inputs
See responses in real-time
Debug any issues
Making Changes
Edit
src/index.tsto modify or add toolsRun
npm run buildto compileTest using one of these methods:
npm run proxythennpm testfor automated testsnpm run test:inspectorfor interactive testingRestart your MCP client (e.g., Claude Desktop)
API Reference
Tool: get_current_weather
Parameters:
city(required): City name (e.g., "London", "Tokyo")country(optional): Country code (e.g., "US", "GB", "JP")
Example:
{
"city": "Paris",
"country": "FR"
}Tool: get_weather_forecast
Parameters:
city(required): City namecountry(optional): Country codedays(optional): Number of forecast days (1-16, default: 7)
Example:
{
"city": "New York",
"country": "US",
"days": 5
}Tool: get_weather_alerts
Parameters:
city(required): City namecountry(optional): Country code
Example:
{
"city": "Miami",
"country": "US"
}Tool: get_growing_conditions
Parameters:
city(required): City namecountry(optional): Country codebase_temp(optional): Base temperature for GDD calculation in °C (default: 10)
Example:
{
"city": "Sacramento",
"country": "US",
"base_temp": 10
}Tool: get_historical_weather
Parameters:
city(required): City namemonth(required): Month number (1-12, where 1=January, 12=December)country(optional): Country codeyears_back(optional): Number of years back to retrieve (1-10, default: 1)
Example:
{
"city": "London",
"month": 7,
"years_back": 5
}Data Source
This server uses the Open-Meteo API, which provides:
Free access with no API key required
High-quality weather data from multiple sources
Historical weather archives
Global coverage
No rate limiting for reasonable use
Technical Details
Protocol: Model Context Protocol (MCP)
Transport Modes:
Stdio (standard MCP)
Server-Sent Events (SSE) with message routing
HTTP Proxy (REST API wrapper)
Language: TypeScript with Node.js
Runtime: Node.js 16+
Dependencies:
@modelcontextprotocol/sdk(^1.18.2) - MCP frameworkzod(^3.25.76) - Runtime type validation
Dev Dependencies:
tsx(^4.20.6) - TypeScript executiontypescript(^5.9.3) - TypeScript compiler@types/node(^24.6.1) - Node.js type definitions
APIs Used:
Open-Meteo Forecast API
Open-Meteo Geocoding API
Open-Meteo Archive API (for historical data)
Contributing
Contributions are welcome! To contribute:
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Make your changes
Test thoroughly with
npm run test:inspectorCommit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
License
ISC License
Support
For issues, questions, or contributions, please open an issue on the repository.
Built with the Model Context Protocol
Available Tools
6 toolsget_current_weatherA
Get real-time current weather conditions for any city worldwide. Returns temperature, feels-like temperature, humidity, precipitation, weather description, and wind information. Accepts either city name OR latitude/longitude coordinates.
Inputs: city, country, latitude, longitude.
get_growing_conditionsA
Get current growing conditions including Growing Degree Days (GDD), solar radiation, humidity, and soil metrics. Used to predict crop development stages and optimize growing conditions. Accepts either city name OR latitude/longitude coordinates.
Inputs: city, country, latitude, base_temp, +1 more.
get_historical_weatherA
Retrieve historical weather data for a specific month over multiple years. Returns monthly statistics including average, max, and min temperatures, total precipitation, and average wind speed. Default retrieves data for the past year, up to 10 years available. Accepts either city name OR latitude/longitude coordinates.
Inputs: month (required), city, country, latitude, +2 more.
get_hourly_weatherA
Get hour-by-hour weather forecast for up to 7 days (168 hours). Returns detailed hourly predictions including temperature, feels-like temperature, humidity, precipitation, weather conditions, wind speed, direction, and gusts. Perfect for planning daily activities or tracking weather changes throughout the day. Accepts either city name OR latitude/longitude coordinates.
Inputs: city, hours, country, latitude, +1 more.
get_weather_alertsB
Check for weather warnings and alerts based on current conditions. Detects extreme temperatures, high winds, heavy precipitation, and severe weather like thunderstorms. Accepts either city name OR latitude/longitude coordinates.
Inputs: city, country, latitude, longitude.
get_weather_forecastA
Get weather forecast for up to 16 days. Returns daily predictions including max/min temperatures, precipitation, weather conditions, and wind speeds. Perfect for planning trips or events. Accepts either city name OR latitude/longitude coordinates.
Inputs: city, days, country, latitude, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct weather data type: current conditions, daily forecast, hourly forecast, alerts, historical data, and agricultural growing conditions. The daily vs. hourly forecast distinction is clear from descriptions and cadence. No two tools appear interchangeable.
All tools use a consistent get_ prefix and snake_case, which is highly predictable. Minor deviation: most follow get_[modifier]_weather while two use get_weather_[noun] (forecast/alerts), but this remains readable and not confusing.
Six tools is well-scoped for a weather server, covering current, forecast, hourly, alerts, historical, and specialized growing conditions without redundancy. Each tool earns its place and the set is easy to scan.
Core weather lifecycle coverage is strong, including current, forecast, hourly, alerts, and historical data. Minor gaps exist for location/geocoding search, air quality, UV index, or unit configuration, but agents can work around these by supplying city names or coordinates.
Maintenance
Related MCP Connectors
Global weather via Open-Meteo: forecast, historical, marine, air quality, geocoding, elevation.
Weather data, forecast API, climate data, historical weather, alerts, agricultural & travel weather.
Global weather API: forecasts, historical data, marine, ski, astronomy and timezone.
Open-Meteo MCP — weather forecast + historical reanalysis + sister APIs
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides current weather data and hourly forecasts for any location worldwide using the Open-Meteo API, accessible through HTTP transport without requiring an API key.ISC
- AlicenseNot gradedqualityDmaintenanceProvides weather data including current conditions, daily forecasts up to 16 days, and hourly forecasts up to 7 days, using the free Open-Meteo API with no API key required.1MIT
- FlicenseNot gradedqualityDmaintenanceProvides real-time and historical weather data for any city worldwide, including forecasts, air quality, and marine conditions, using the free Open-Meteo API.-
- FlicenseNot gradedqualityDmaintenanceProvides real-time weather forecasts, air quality data, and timezone information via Open-Meteo API, with no API key required.-