OpenWeatherMap
STREAMABLE HTTPMCP server providing real-time weather data and forecasts via OpenWeatherMap API.
MCP server providing real-time weather data and forecasts via OpenWeatherMap API.
A Model Context Protocol (MCP) server that provides comprehensive weather data and forecasts through the OpenWeatherMap API. This server enables AI assistants to access real-time weather information, forecasts, air quality data, and location services.
git clone https://github.com/robertn702/mcp-openweathermap.git cd mcp-openweathermap
bun install
cp .env.example .env # Edit .env and add your OpenWeatherMap API key
Environment variables:
OPENWEATHER_API_KEY - Your OpenWeatherMap API key (required for stdio transport only)PORT - Server port for HTTP transport (default: 3000)MCP_TRANSPORT - Transport type: stdio or httpStream (default: stdio)MCP_ENDPOINT - HTTP endpoint path (default: /stream)Stdio Transport (default):
bun run src/main.ts
HTTP Stream Transport:
MCP_TRANSPORT=httpStream PORT=3000 bun run src/main.ts
Add this configuration to your Claude Desktop MCP settings:
{ "mcpServers": { "openweathermap": { "command": "npx", "args": ["mcp-openweathermap"], "env": { "OPENWEATHER_API_KEY": "your-api-key-here" } } } }
get-current-weather - Current weather conditionsget-weather-forecast - 5-day forecastget-hourly-forecast - Hourly forecasts (up to 48 hours)get-daily-forecast - Daily forecasts (up to 8 days)get-minutely-forecast - Minute-by-minute precipitationget-weather-alerts - Weather warnings and alertsget-current-air-pollution - Current air quality dataget-air-pollution - Air quality forecasts and historyget-location-info - Reverse geocoding from coordinatesgeocode-location - Convert addresses to coordinatesget-onecall-weather - Comprehensive weather databun run src/main.ts
bun run src/main.ts
Then connect the MCP Inspector to test the tools interactively.
bun run build
Stdio Transport: Requires OPENWEATHER_API_KEY environment variable.
HTTP Transport: The OpenWeatherMap API key is passed as a bearer token in the HTTP request headers. No environment variable needed.
This project is licensed under the MIT License - see the LICENSE file for details.