Get the FREE Ultimate OpenClaw Setup Guide →

weather

A Model Context Protocol server that provides weather information

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio szypetike-weather-mcp-server node path/to/weather-server/build/index.js \
  --env OPENWEATHER_API_KEY="your-api-key-here"

How to use

The Weather MCP Server provides current weather information for cities around the world. It can operate with real-time data from the OpenWeather API when you supply a valid API key, or in mock mode if no key is provided. The server exposes a get_current_weather tool that returns structured weather details including location, date, time, temperature (current and feels like), main weather condition, description, icon, and additional details such as humidity, pressure, wind, cloudiness, and sunrise/sunset times. When using real data, the source will indicate OpenWeather API; otherwise, it will indicate mock data. To integrate with Claude or other MCP-compatible assistants, configure an MCP entry pointing to the weather-server, providing the command and path to the built index file, and optionally set OPENWEATHER_API_KEY for real data.

Example usage in an MCP configuration: { "mcpServers": { "weather-server": { "command": "node", "args": ["path/to/weather-server/build/index.js"], "env": { "OPENWEATHER_API_KEY": "your-api-key-here" }, "disabled": false, "autoApprove": [] } } }

With the API key provided, requests to get_current_weather will fetch live data from OpenWeather. Without a key, the server returns predefined mock data for major cities (London, New York, Tokyo, Paris, Sydney) and sensible defaults for others, which is ideal for development and testing.

How to install

Prerequisites:

  • Node.js 14 or higher
  • npm or yarn
  • Optional: OpenWeather API key for real-time data

Installation steps:

  1. Clone the repository git clone https://github.com/your-organization/weather-mcp-server.git cd weather-mcp-server

  2. Install dependencies npm install

    or for yarn

    yarn install

  3. Build the server npm run build

  4. Run locally (optional for testing) npm start

  5. Integrate with MCP Ensure your MCP configuration includes an entry similar to: { "mcpServers": { "weather-server": { "command": "node", "args": ["path/to/weather-server/build/index.js"], "env": { "OPENWEATHER_API_KEY": "your-api-key-here" }, "disabled": false, "autoApprove": [] } } }

Additional notes

Tips and considerations:

  • An OpenWeather API key is optional. If omitted, the server runs in mock mode with predefined cities for testing.
  • If you switch to real data, ensure the OPENWEATHER_API_KEY is kept secure and not checked into version control.
  • The mock data covers London, New York, Tokyo, Paris, and Sydney by default; other cities will use default mock data.
  • If API requests fail, the server will fall back to mock data to maintain availability.
  • Ensure the built index.js path matches your deployment structure; adjust the MCP config accordingly.
  • Monitor for API rate limits if using the real OpenWeather API in production.

Related MCP Servers

Sponsor this space

Reach thousands of developers