weather-mcp-server

rehmat123/weather-mcp-server

3.1

If you are the rightful owner of weather-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A Model Context Protocol (MCP) server for fetching weather data using the Open-Meteo API, designed for integration with Cursor IDE.

Weather MCP Server in TypeScript

A Model Context Protocol (MCP) server for fetching weather data using the Open-Meteo API. This server can be integrated with Cursor IDE to provide weather information through the MCP protocol.

Usage

As a Langchain Agent

https://github.com/rehmat123/Langchain-typescript/blob/main/src/langchain/weather.ts

In Cursor IDE

Add the following configuration to your cursor.json:

{
  "mcp": {
    "servers": {
      "weather": {
        "command": "@rehmatalisayany/weather-mcp-server",
        "transport": "stdio"
      }
    }
  }
}

Test using MCP Client

check get-weather.ts for source code, you can run this file to connect to MCP Server

To connect with Local MCP Server first you need to install

Installation

git clone https://github.com/rehmat123/weather-mcp-server.git

go to directory and than

Install dependencies and build

npm i
npm build

Code usage in your Agent

  const transport = new StdioClientTransport({
    command: 'node',
    args: ['dist/index.js']
  });

To connect with Remote MCP Server use this, you dont need to install and compile

  const transport = new StdioClientTransport({
    command: 'npx',
    args: ['@rehmatalisayany/weather-mcp-server']
  });

API

The server provides the following tool:

  • getWeather: Get current weather for a location
    • Arguments:
      • location: String (city name or location)
    • Returns:
      • temperature: Current temperature in Celsius
      • conditions: Weather conditions description
      • humidity: Humidity percentage
      • windSpeed: Wind speed in m/s

License

MIT