Weather-Prediction MCP Server
Uses OpenStreetMap (Nominatim) to resolve US city names to coordinates, enabling weather lookups for specified locations.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Weather-Prediction MCP ServerShould I bring an umbrella to Seattle tomorrow?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Day 3 Homework: Weather-Prediction MCP Server
A FastMCP server that exposes weather-forecast tools over the Model Context Protocol, designed to be consumed by a Databricks Agent Bricks agent.
Architecture
Agent Bricks agent --(MCP tool calls)--> weather_mcp_server.py --(HTTP)--> NWS API (free, no key)
|
+--> weather_broker.py (adapter: all HTTP/parsing logic)Related MCP server: Weather MCP Server
MCP Tools Exposed
Tool | Description |
| Real-time temperature, humidity, wind, conditions from nearest NWS station |
| Multi-day forecast (up to 7 days) with temp, wind, precip chance, conditions |
| Active warnings, watches, and advisories for the location |
| Derived recommendations with threshold logic (umbrella, jacket, heat, outdoors) |
Weather API
API: National Weather Service (NWS) — https://www.weather.gov/documentation/services-web-api
Auth: None required (free, public US government API)
Coverage: United States only
Geocoding: Nominatim/OpenStreetMap (free, no key) for resolving city names to coordinates
Files
File | Role |
| FastMCP server with |
| Adapter module — all HTTP calls, parsing, and recommendation logic |
| Lakebase connection helper (same pattern as Day 2/3, for extensibility) |
| Databricks App configuration |
| Python dependencies |
Secrets Required in Databricks
Secret Scope | Secret Key | Value | Required For |
|
| Base64-encoded Postgres connection URL | Lakebase (optional, for future use) |
Note: The NWS API requires NO API key. No weather-related secrets needed.
Deploy as Databricks App
Upload this entire folder (
day3-homework-mcpserver-weather/) to your Databricks workspaceCreate a new Databricks App pointing to this folder
The app will start via
python weather_mcp_server.py(as defined inapp.yaml)Register the app URL as an external MCP server in Agent Bricks
Register as External MCP in Agent Bricks
Go to your Databricks workspace → Agent Bricks
Add a new external MCP tool connection
Set the URL to your deployed app's endpoint (e.g.
https://<your-app-url>/mcp)The 4 tools will be auto-discovered by the agent
Suggested Agent System Prompt
You are a weather assistant that helps users understand weather conditions
and make plans based on forecasts. You have access to real-time weather
data for US locations via the National Weather Service.
Rules:
- ALWAYS use the weather tools to get data. NEVER guess or hallucinate weather information.
- Use get_current_weather() for "what's the weather now?" questions.
- Use get_forecast() for "what will the weather be like?" questions.
- Use get_weather_alerts() when users ask about severe weather or safety.
- Use get_travel_recommendation() for planning questions ("should I bring an umbrella?", "is it a good day for hiking?").
- If a location cannot be resolved, ask the user to clarify with "City, State" format.
- Only US locations are supported. If asked about international locations, explain this limitation.
- If the API returns an error, tell the user honestly rather than making up data.
- When presenting forecasts, summarize the key points rather than dumping raw data.Local Development
pip install -r requirements.txt
python weather_mcp_server.py
# Server starts on http://0.0.0.0:8000This server cannot be deployed
Maintenance
Related MCP Connectors
US weather & geo for AI agents: forecasts, alerts, earthquakes, elevation, geocoding. No keys.
US weather & geo for AI agents: forecasts, alerts, earthquakes, elevation, geocoding. No keys.
Provide real-time and forecast weather information for locations in the United States using natura…
Get US weather forecasts, active alerts, and current observations.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI assistants to access real-time US weather forecasts and alerts through the National Weather Service API.210 npmMIT
- FlicenseBqualityDmaintenanceProvides real-time US weather alerts and forecasts by integrating with the National Weather Service API. It enables AI assistants to fetch state-specific alerts and detailed local forecasts using geographic coordinates.21-
- FlicenseNot gradedqualityDmaintenanceProvides real-time weather alerts and forecasts from the National Weather Service for US locations, integrating with AI assistants via the Model Control Protocol.-
- FlicenseNot gradedqualityDmaintenanceProvides weather forecasts and alerts for US locations via the National Weather Service API, enabling AI assistants to deliver real-time weather information.21 npm-