Get the FREE Ultimate OpenClaw Setup Guide →

weather

A robust Weather MCP Server in TypeScript

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio glaucia86-weather-mcp-server node path/to/server.js \
  --env LOG_LEVEL="info" \
  --env REDIS_URL="redis://localhost:6379" \
  --env DATABASE_URL="postgres://user:password@localhost:5432/weatherdb" \
  --env CLAUDE_RUNTIME="path or URL to Claude runtime if required" \
  --env OPENWEATHERMAP_API_KEY="OpenWeatherMap API key"

How to use

The Weather MCP Server extends Claude Desktop with real-time weather capabilities using the MCP protocol. It connects to external weather data sources (OpenWeatherMap) and caches frequently requested data in Redis for ultra-fast responses. The server exposes use cases to fetch the current weather, obtain a 5-day forecast, and retrieve historical query data from its cache. As a Claude-powered tool, you can ask natural language questions like "What is the current temperature in São Paulo?" or "Show me the 5-day forecast for London," and the MCP server will handle API calls, cache lookups, and data formatting for you. In addition to live weather, you can query the history of your past weather requests and monitor cache hit rates to understand performance.

To use it, ensure the MCP integration is connected to Claude Desktop via the MCP bridge. Then issue weather-related queries; the server will respond with structured weather data including temperature, humidity, wind, conditions, and timestamps. The cache layer powered by Redis speeds up repeated queries, so repeated requests are typically served from the cache rather than hitting the external API on every call.

How to install

Prerequisites:

  • Node.js (and npm) installed
  • Access to Redis (and PostgreSQL if using the full stack)
  • OpenWeatherMap API key
  1. Install dependencies (in your project or environment where the MCP server runs):
npm install
  1. Configure environment variables (example in a .env file):
OPENWEATHERMAP_API_KEY=your_openweathermap_api_key
REDIS_URL=redis://localhost:6379
DATABASE_URL=postgres://user:password@localhost:5432/weatherdb
LOG_LEVEL=info
  1. Run the MCP server (example):
node path/to/server.js
  1. Verify the server is up and reachable by the MCP bridge and Claude Desktop.

  2. (Optional) Build a Docker image if you prefer containerized deployment and Redis/Postgres connectivity within the same environment:

docker build -t weather-mcp-server .
docker run -e OPENWEATHERMAP_API_KEY -e REDIS_URL -e DATABASE_URL -p 3000:3000 weather-mcp-server

Additional notes

Tips and considerations:

  • Ensure OpenWeatherMap API key is valid and has enough quota for your expected usage.
  • Redis is used for caching; monitor cache eviction policies and TTLs to balance freshness and speed.
  • If you deploy with Docker, consider mounting a persistent Redis/PostgreSQL container or using managed services.
  • For production, set LOG_LEVEL to warning or error to reduce log noise and improve performance.
  • If Claude Desktop cannot reach the MCP server, verify network routing, MCP bridge configuration, and that the server process is listening on the expected port/path.
  • You can adjust env vars to point to different data sources or cache configurations as needed.

Related MCP Servers

Sponsor this space

Reach thousands of developers