weather_mcp_server

nmsabc/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 dayong@mcphub.com.

A Python weather microservice with an MCP wrapper that fetches weather data using the OpenWeatherMap One Call API.

Weather MCP Server

A Python weather microservice with an MCP wrapper. It fetches OpenWeatherMap One Call API data (current weather for lat/lon) via a FastAPI server, usable by a separate client or LLM. Configurable for local or GCP deployment, enabling flexible access to weather info.

Quick Start

  1. Install dependencies:
pip install -r requirements.txt
  1. Configure environment:
cp .env.example .env
# Add your OpenWeatherMap API key to .env
  1. Run the server:
python main.py
  1. run the server via http
python mcp_server_http.py --host 0.0.0.0 --port 8001
  1. call the new server like this
curl -X POST http://localhost:8001/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "get_current_weather",
      "arguments": {"location": "Baden bei Wien"}
    },
    "id": 1
  }' | jq
  1. call the mcp server from the chat-cli
cd /Users/seba/GCP/mcp_cli_model_agnostic
workon mcp_cli_model_agnostic
python3 -m mcp_cli.cli chat --mcp-server "python examples/mcp_server.py" --mcp-server "python examples/weather_http_bridge.py"
  1. or access the API at http://localhost:8000

Features

  • 🌤️ Current weather data via OpenWeatherMap One Call API
  • 🚀 FastAPI REST API server
  • 🤖 MCP wrapper for LLM integration
  • 🔧 Local and GCP deployment support
  • 📊 Comprehensive error handling
  • 🌍 Multiple unit systems and languages

API Usage

Get weather for coordinates:

curl "http://localhost:8000/weather?latitude=40.7128&longitude=-74.0060&units=metric"

See for complete documentation.

Deployment

  • Local: python main.py
  • Docker: docker build -t weather-mcp-server . && docker run -p 8000:8000 --env-file .env weather-mcp-server
  • GCP: gcloud app deploy

Documentation

  • Full documentation:
  • API docs: http://localhost:8000/docs (when running)