MCP SSE Weather Server
This is a simple Python-based HTTP SSE (Server-Sent Events) MCP server to get weather details by city name or latitude/longitude.
Features
- SSE endpoint for real-time weather updates
- Query by city name or coordinates
- Docker and Docker Compose support
Usage
1. Set up OpenWeatherMap API Key
Get a free API key from OpenWeatherMap and set it in your environment.
2. Build and Run with Docker Compose```sh
docker-compose up --build
### 3. API Endpoints
- `GET /weather/sse?city=London`
- `GET /weather/sse?lat=51.51&lon=-0.13`
The endpoint streams weather data every 5 seconds as SSE.
### 4. Example curl```sh
curl http://localhost:8000/weather/sse?city=London
5. Development (without Docker)```sh
pip install -r requirements.txt
uvicorn main:app --reload
```
Replace your_openweather_api_key_here in docker-compose.yml with your actual API key.
