← Back to directory
W

Weather MCP Server

Community
A comprehensive MCP server for real-time weather data with Claude Desktop
GitHub source repository ↗
★ 98 Stars Category · Other Popular Source revision 25d68abac2b1
50FMRS · D
Reliability
9/20
Security and permissions
8/20
Maintenance
12/20
Documentation
12/20
Setup experience
9/20

This project is a well-featured weather MCP server with a clean architecture and clear tool interfaces. Suitable for developers wanting to integrate weather queries into Claude.

Read the FMRS scoring method →

The Weather MCP Server is a TypeScript-based MCP server built with Clean Architecture and SOLID principles. It enables Claude Desktop to query real-time weather, 5-day forecasts, history, and cache statistics via OpenWeatherMap, PostgreSQL, and Redis.

Tools

get_current_weather
Retrieves current weather conditions for any city.
get_weather_forecast
Provides a 5-day weather forecast.
get_weather_history
Returns past weather query records.
get_cache_statistics
Shows Redis cache performance statistics.

Setup

  1. Clone repository: git clone https://github.com/glaucia86/weather-mcp-server.git
  2. Install dependencies: npm install
  3. Copy .env.example to .env and configure WEATHER_API_KEY, DATABASE_URL, REDIS_URL
  4. Build project: npm run build
  5. Start infrastructure: npm run docker:up
  6. Configure Claude Desktop's claude_desktop_config.json with the provided JSON.
claude_desktop_config.json
{
  "mcpServers": {
    "weather-mcp": {
      "command": "node",
      "args": [
        "/caminho/completo/para/weather-mcp-server/dist/mcp-entry.js"
      ],
      "env": {
        "WEATHER_API_KEY": "SUA_API_KEY_OPENWEATHERMAP",
        "DATABASE_URL": "postgresql://mcp_user:mcp_pass@localhost:5432/weather_mcp",
        "REDIS_URL": "redis://localhost:6379",
        "NODE_ENV": "production",
        "LOG_LEVEL": "error",
        "MCP_MODE": "true"
      }
    }
  }
}

Fit and risk

Best for

  • Developers looking to integrate real-time weather into Claude Desktop
  • Use cases requiring caching for faster responses
  • Developers interested in Clean Architecture and SOLID principles

Not for

  • Users without an OpenWeatherMap API key
  • Simple use cases that don't require caching or a database
  • Users who cannot run Docker environments

Required permissions

  • Access to external OpenWeatherMap API
  • Read/write to PostgreSQL database (for query history)
  • Read/write to Redis cache
  • Read API keys from environment variables

Risks and side effects

  • API key exposure if not securely stored
  • Database and Redis unavailability could cause failures
  • Cache data may become stale, leading to inaccurate info
  • Dependency on external OpenWeatherMap API, which might have rate limits or downtime

Troubleshooting

  1. If 'Cannot find module', run rm -rf node_modules package-lock.json; npm cache clean --force; npm install; npm run build
  2. If MCP doesn't connect to Claude Desktop, verify the path in claude_desktop_config.json is correct, ensure dist/mcp-entry.js exists, and completely restart Claude Desktop
  3. If PostgreSQL connection refused, run npm run docker:down and npm run docker:up, then wait 30 seconds

Use cases

Query current weather for any city in real-time
Get a 5-day weather forecast
Review history of past weather queries
Monitor cache system performance

Supported clients

Claude DesktopFull support