Weather MCP Server
A Model Context Protocol (MCP) server that provides weather data from the Open-Meteo API.
Overview
This MCP server fetches weather data from the Open-Meteo API endpoint and communicates over HTTP using the Streamable HTTP transport.
Features
HTTP Transport: Communicate over HTTP for remote access
Current Weather: Get current temperature and wind speed
Hourly Forecast: Access hourly temperature, relative humidity, and wind speed data
Flexible Coordinates: Query weather for any latitude/longitude coordinates
Session Management: Supports multiple concurrent client sessions
Installation
Install dependencies:
Build the server:
Start the server:
The server will start on http://localhost:3000 by default. You can customize the port:
Endpoints
POST /mcp- Main MCP endpoint for tool calls and requestsGET /mcp- Server-Sent Events (SSE) endpoint for streamingDELETE /mcp- Close session endpointGET /health- Health check endpoint
Tools
get_weather
Fetches current weather and hourly forecast data for specified coordinates.
Parameters:
latitude(number): Latitude coordinate (e.g., 52.52 for Berlin)longitude(number): Longitude coordinate (e.g., 13.41 for Berlin)
Returns:
Current temperature (°C)
Current wind speed (km/h)
Hourly forecast data arrays
Complete raw API response
Usage with MCP Clients
HTTP Client (Recommended)
Use the provided HTTP client to connect to the running server:
Or create your own HTTP client using the MCP SDK:
VS Code
Add to your .vscode/mcp.json:
Claude Desktop
The HTTP server can be accessed by any MCP client that supports HTTP transport. Configure your client to connect to:
Example Queries
Once connected to an MCP client, you can ask questions like:
"What's the current weather in Berlin?" (latitude: 52.52, longitude: 13.41)
"Get weather forecast for San Francisco" (latitude: 37.77, longitude: -122.42)
"Show me the hourly temperature forecast for Tokyo" (latitude: 35.68, longitude: 139.65)
Development
The server is built using:
MCP SDK: @modelcontextprotocol/sdk
Zod: For schema validation
TypeScript: For type safety
API Reference
Weather data is sourced from Open-Meteo, a free weather API that provides:
Real-time weather data
Hourly forecasts
No API key required
License
ISC
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Provides current weather data and hourly forecasts for any location worldwide using the Open-Meteo API, accessible through HTTP transport without requiring an API key.