weather
A Model Context Protocol server that provides weather information
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:
-
Clone the repository git clone https://github.com/your-organization/weather-mcp-server.git cd weather-mcp-server
-
Install dependencies npm install
or for yarn
yarn install
-
Build the server npm run build
-
Run locally (optional for testing) npm start
-
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
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.