A FastAPI application that exposes current weather conditions and daily forecasts from WeatherAPI.com as Model Context Protocol (MCP) tools. Built with fastapi-mcp.
pip install -r requirements.txt
export WEATHER_API_KEY=your_key_here
./app.shOpen http://localhost:8888 for interactive docs, code samples, and an API test panel. The MCP endpoint is at http://localhost:8888/mcp.
-
Environment variables – set
WEATHER_API_KEYin the project settings. Optionally setROOT_PATHto the URL prefix assigned by the platform (e.g./app/<run-id>). -
Start command:
./app.sh
-
Authentication – Domino routes traffic through an nginx proxy that validates bearer tokens. Agents running inside Domino can obtain a token from the sidecar at
http://localhost:8899/access-tokenand pass it in theAuthorizationheader when connecting to the MCP endpoint.
| Tool | Description |
|---|---|
get_current_weather |
Current conditions (temp, wind, humidity, UV, etc.) |
get_weather_forecast |
Today's forecast with hourly breakdown |
Both tools accept a location parameter – city name, zip code, lat/lon, etc.
main.py – FastAPI app, weather endpoints, MCP mount
landing.html – Self-documenting landing page with code samples + test panel
requirements.txt – Python dependencies