home / mcp / weather mcp server
Provides current and hourly weather data by querying Open-Meteo through an HTTP MCP endpoint.
Configuration
View docs{
"mcpServers": {
"gmailhasan-mcpexample": {
"url": "http://localhost:3000/mcp",
"headers": {
"PORT": "8080"
}
}
}
}You run a weather MCP server that fetches live data from Open-Meteo and serves it over HTTP. You can query current conditions and hourly forecasts for any latitude/longitude, making it easy to build apps or assistants that need weather insights without managing API keys.
Connect to the server using an MCP-compatible HTTP client and you can call the weather tool to retrieve current conditions and hourly forecasts. Start by establishing a connection to the server at the MCP endpoint, then list available tools to confirm the get_weather tool is accessible. Use get_weather with latitude and longitude to obtain the data you need, including current temperature, wind speed, and arrays for hourly values.
Key tool: get_weather. You provide numeric latitude and longitude, and you receive current weather data plus hourly forecasts. Examples of practical uses include displaying Berlin weather (52.52, 13.41), San Francisco (37.77, -122.42), Tokyo (35.68, 139.65), or any location you specify.
If you are using an MCP client that supports streaming, you can keep the session open to receive updates or follow along with hourly changes as new data comes in. The server supports multiple concurrent sessions, so you can have several clients querying different coordinates at the same time.
# Prerequisites
- Node.js (16.x or newer)
- npm (bundled with Node.js)
# 1) Install dependencies
npm install
# 2) Build the server
npm run build
# 3) Start the server (default port 3000)
node build/index.js
# Optional: run on a different port (example)
PORT=8080 node build/index.jsOnce running, you will access the MCP server at http://localhost:3000/mcp by default. You can override the port with the PORT environment variable as shown above.
HTTP transport is used to communicate with the server. The MCP endpoint path is /mcp. Common operations include listing tools and calling the weather tool. You can perform a health check via a dedicated endpoint to ensure the server is running correctly.
The weather tool returns current temperature and wind speed, plus hourly arrays for temperature, relative humidity, and wind speed. Use the latitude and longitude parameters to target any location.
The server runs on a local HTTP endpoint by default. If you need to run multiple sessions or different ports, start separate instances with PORT set to the desired value. Example: PORT=8080 node build/index.js.
The server is built with the MCP SDK and TypeScript, using Open-Meteo as the data source. No API key is required for the Open-Meteo data in this configuration.
Query Berlin current weather: latitude 52.52, longitude 13.41.
Get Tokyo hourly forecast: latitude 35.68, longitude 139.65.
Fetches current weather and hourly forecast data for specified coordinates.