mcp-server-weather

manistiw/mcp-server-weather

3.2

If you are the rightful owner of mcp-server-weather 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.

mcp-server-weather is a Python MCP server that provides real-time weather data using the Open-Meteo API.

Tools
1
Resources
0
Prompts
0

mcp-server-weather

Overview

mcp-server-weather is a Python MCP server that provides real-time weather data for any latitude and longitude using the Open-Meteo API. It is built with FastMCP and exposes a tool endpoint for fetching current weather data.

Features

  • MCP server with stdio transport
  • Tool: get_current_weather(latitude, longitude)
    • Returns current weather details for the given coordinates
  • Uses httpx for HTTP requests

Requirements

  • Python 3.13+
  • httpx
  • mcp (with CLI support)

Installation

pip install -e .

Or install dependencies directly:

pip install httpx mcp[cli]

Usage

Start the MCP server:

python server.py

Tool: get_current_weather

Fetch current weather for a location:

  • Parameters:

    • latitude (float): Latitude of location
    • longitude (float): Longitude of location
  • Returns:

    • Weather data as returned by Open-Meteo API
Example
get_current_weather(latitude=37.7749, longitude=-122.4194)

Testing and Running the MCP Server

The MCP server is now fully functional and ready to test using the MCP Inspector. You'll learn more about the inspector in the next video, but here's a preview:

  1. In terminal, start your MCP server in developer mode by running:
    mcp dev server.py
    
  2. The MCP Inspector is now available at http://localhost:5173; open the URL in your browser.
  3. Select the "Connect" button.
  4. Select the "Tools" tab.
  5. Select the "List Tools" button.
  6. Select the get_current_weather tool.
  7. In the get_current_weather panel, enter a latitude and longitude, e.g. 63.4463991, 10.8127596.
  8. Under "Tool Result" you'll see a JSON object with weather data.
  9. Press Ctrl+C in terminal to exit the MCP Inspector.

Development

  • Main entry point:
  • Project metadata:

License

MIT