Skip to main content
Glama
MCP Weather Data Fetcher

MCP Weather Data Fetcher

by Ansh642

🌀️ MCP Weather Data Fetcher

A simple yet powerful weather-fetching tool built using the Model Context Protocol (MCP). This service allows AI agents to retrieve live weather updates for any city via OpenWeatherMap, wrapped in an agent-friendly format using MCP standards.


πŸš€ Features

  • Real-time weather data via OpenWeatherMap API

  • MCP-compatible tool (getWeatherData)

  • Returns structured details: temperature, humidity, wind speed, and description

  • Agent-friendly response formatting

  • CLI-compatible using Stdio transport


Related MCP server: Weather MCP Server

πŸ›  Tech Stack

  • Node.js

  • MCP SDK (@modelcontextprotocol/sdk)

  • OpenWeatherMap API

  • zod (for input validation)

  • dotenv


πŸ“¦ Setup

  1. Clone the repo & install dependencies:

git clone https://github.com/Ansh642/MCP-Server.git
cd mcp-weather-fetcher
npm install
  1. Create a .env file with your OpenWeatherMap API key:

OPENWEATHER_API_KEY=your_api_key_here
  1. Run the MCP server:

node index.js
  1. (Optional) Define the server in mcp.json:

{
  "mcpServers": {
    "weatherData": {
      "command": "node",
      "args": ["C:/Users/91995/Desktop/mcpServer/index.js"]
    }
  }
}

πŸ’¬ Example Interaction

>> Call tool: getWeatherData with { "city": "Delhi" }

βœ… Weather Report for Delhi:
- Temperature: 34.9Β°C
- Feels Like: 37.1Β°C
- Humidity: 45%
- Weather: Clear
- Description: clear sky
- Wind Speed: 3.6 m/s

πŸ‘€ Author

Ansh Agarwal πŸ“§ anshagarwal642@gmail.com πŸ”— GitHub | LinkedIn


Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      B
      quality
      D
      maintenance
      Enables AI agents to retrieve real-time weather conditions and forecasts via OpenWeatherMap API. Supports interactive weather queries and travel planning through MCP tools, resources, and prompts.
      2
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides weather data from OpenWeatherMap API through MCP tools and a REST API with OpenAPI support. Enables LLM agents to retrieve current weather, forecasts, and temperature ranges by city or coordinates.
      11 npm
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Wraps the OpenWeatherMap API to provide weather data through MCP, enabling AI agents to query current conditions, forecasts, and other weather information via natural language.
      317 npm
      MIT