Goal: Build one small integration three ways: a shared API client, an agent-friendly CLI, and a local MCP server. You will use the free, no-key-required National Weather Service (NWS) API, then verify the CLI from the terminal and the MCP server with the MCP Inspector.
Steps:
uv if needed, then run uv init weather-agent-tools && cd weather-agent-tools.uv add httpx typer rich "mcp[cli]". You may use argparse instead of Typer if you prefer the standard library.weather_core.py with functions such as get_alerts(state: str), get_forecast(latitude: float, longitude: float), and format_compact_alerts(...). Use httpx, set a timeout, and return predictable Python dictionaries/lists rather than raw response objects.WEATHER_USER_AGENT environment variable or simple config value. Write a doctor() function that checks whether config is present and whether https://api.weather.gov is reachable.weather_cli.py with commands:doctor — prints setup/API status; support --json.alerts STATE — returns active alerts for a two-letter state code; support --json and an optional --limit.forecast LATITUDE LONGITUDE — returns a compact forecast for a point; support --json.brief STATE — a compound command that calls alerts and produces a short operational summary.--help text, predictable exit codes, and a structured output mode. Do not hard-code secrets. If something fails, write the error to stderr and exit nonzero.weather_mcp.py using FastMCP. Reuse the functions in weather_core.py; do not duplicate API logic. Expose:get_alerts(state: str) tool,get_forecast(latitude: float, longitude: float) tool,data://nws_state_codes resource,severe_weather_briefing(state: str) prompt.uv run python weather_cli.py doctor --jsonuv run python weather_cli.py alerts CA --json --limit 3uv run python weather_cli.py forecast 34.0522 -118.2437 --jsonuv run mcp dev weather_mcp.py (or the equivalent Inspector command). Confirm it lists your tools/resources/prompts, then invoke both tools with valid arguments.Deliverables: Submit your source files (weather_core.py, weather_cli.py, weather_mcp.py), screenshots or terminal logs showing the three CLI commands running, an MCP Inspector screenshot showing both tools listed and one successful tool call, and your written reflection.