Get the FREE Ultimate OpenClaw Setup Guide →

mcp -weather-js

Simple Weather MCP Server Example

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio hideya-mcp-server-weather-js npx -y @h1deya/mcp-server-weather

How to use

This MCP server exposes weather information for the US via the Model Context Protocol. It provides at least two tools: get-alerts and get-forecast. The get-alerts tool returns weather alerts for a given US state, requiring a state code input (two-letter, e.g., CA, NY). The get-forecast tool provides a weather forecast for a specified location in the US by supplying latitude and longitude. To use the server, run it via npx as shown in the installation guidance, and then query the available tools through your MCP client to retrieve weather data for the requested region or coordinates.

How to install

Prerequisites:

  • Node.js and npm installed on your system
  • Access to run npx (comes with npm)

Installation and run steps:

  1. Ensure Node.js and npm are installed. Check versions: node -v npm -v

  2. Run the MCP server using npx (no local installation required): npx -y @h1deya/mcp-server-weather

  3. The server will start and expose the MCP tools, such as get-alerts and get-forecast.

  4. (Optional) If you prefer to install locally, you can install the package and run the server from a script: npm install -g @h1deya/mcp-server-weather mcp-server-weather

  5. Connect your MCP client to the running server and invoke the available tools:

    • get-alerts: provide { state: "CA" }
    • get-forecast: provide { latitude: 37.7749, longitude: -122.4194 }

Additional notes

Notes:

  • The server is published as an npm package for convenient usage with npx. If you need to run the server locally in a project, you can install the package and run it from your project scripts.
  • Ensure you are targeting a US location when using get-forecast (latitude/longitude in the US).
  • If you encounter connectivity or MCP protocol issues, verify that the client is correctly configured to communicate with the server's MCP endpoints and that the environment supports the required network access.
  • This example follows the MCP Quickstart guidance and is intended for demonstration purposes.

Related MCP Servers

Sponsor this space

Reach thousands of developers