Skip to main content
Glama

Weather Prediction MCP Server + Agent A weather-focused Model Context Protocol (MCP) server built with FastMCP and integrated with a Databricks Agent Bricks agent. The project exposes weather tools that allow an AI agent to retrieve current weather, obtain forecasts, and make simple weather-based recommendations. Project Overview This project follows the Day 3 MCP architecture demonstrated in the classroom reference project. Instead of a financial trading MCP server, this project provides weather capabilities using the free National Weather Service (NWS) API.

Project Structure weather-mcp-server/ │ ├── mcp_server/ │ ├── weather_mcp_server.py │ └── weather_adapter.py │ ├── agent/ │ ├── system_prompt.txt │ └── tool_list.md │ ├── requirements.txt ├── app.yaml └── README.md Weather API This project uses the National Weather Service (NWS) API. NWS was selected because:

  • It is free.

  • It does not require an API key.

  • It provides official U.S. weather information.

  • It provides current observations and forecasts.

  • It is suitable for demonstrating an MCP weather assistant without requiring paid services or credentials. API base URL: https://api.weather.gov The NWS API is U.S.-focused, so this implementation supports U.S. locations. MCP Server The MCP server is implemented using FastMCP. The server uses the streamable HTTP transport required by the Day 3 MCP pattern. The MCP tool functions are intentionally thin. HTTP requests and weather-data parsing are implemented separately in weather_adapter.py. Server file mcp_server/weather_mcp_server.py Adapter file mcp_server/weather_adapter.py The adapter is responsible for:

  • Resolving locations.

  • Calling the NWS API.

  • Handling HTTP errors.

  • Parsing NWS responses.

  • Normalizing weather data.

  • Applying recommendation rules. MCP Tools The server exposes three required weather tools.

  1. get_current_weather Returns current weather conditions for a U.S. location. Input location: string Example: Chicago, IL Provides

  • Temperature

  • Conditions

  • Humidity

  • Wind speed

  • Wind direction

  • Observation time

  • Location information

  • Data source Example natural-language question: What's the weather in Chicago right now?

  1. get_forecast Returns a multi-day forecast. Inputs location: string days: integer The number of days must be between 1 and 7. Provides

  • Forecast date/time

  • Temperature

  • Conditions

  • Precipitation probability

  • Wind speed

  • Wind direction

  • Data source Example natural-language question: What's the forecast for Chicago for the next three days?

  1. get_weather_recommendation Provides a simple weather-based recommendation using forecast data. Inputs location: string date: string The date uses: YYYY-MM-DD Recommendation logic The tool applies deterministic rules to forecast information. Precipitation probability >= 40% → Recommend an umbrella.

Temperature < 55°F → Recommend a jacket.

Temperature > 80°F → Recommend light clothing and hydration. If none of the thresholds are reached, the tool reports that no special weather gear is strongly recommended. Example natural-language question: Should I bring an umbrella to Chicago tomorrow? This tool demonstrates derived reasoning rather than simply returning raw API data. Agent Configuration The Databricks Agent Bricks agent uses the Weather MCP server as an external MCP tool. The agent configuration is documented in: agent/system_prompt.txt agent/tool_list.md Agent responsibilities The agent is instructed to:

  • Use MCP tools for weather information.

  • Never invent weather information.

  • Use get_current_weather for current conditions.

  • Use get_forecast for future weather.

  • Use get_weather_recommendation for practical weather decisions.

  • Ask for clarification when a location is ambiguous.

  • Report API failures instead of guessing.

  • Ground responses in MCP tool results. Dependencies The application uses the following Python packages: databricks-sdk>=0.30.0 fastmcp>=3.2.0 python-dotenv>=1.0.1 requests>=2.31.0 Databricks App Configuration The MCP server is deployed as a Databricks App. App name: mcp-weather-server The application is started using: python mcp_server/weather_mcp_server.py The application configuration is defined in: app.yaml The MCP server uses streamable HTTP transport. Local Setup Clone the repository and install dependencies: pip install -r requirements.txt Start the MCP server: python mcp_server/weather_mcp_server.py The server can then be connected to an MCP-compatible client. Databricks Deployment

  1. Create the Databricks App Create a new Databricks App using the MCP Server starter. Configuration: App name: mcp-weather-server Compute: Medium

  2. Connect the GitHub repository Connect the Databricks workspace to this repository and deploy the application source.

  3. Deploy the MCP server The application uses: app.yaml requirements.txt mcp_server/weather_mcp_server.py

  4. Register the MCP server Register the deployed Databricks App as an external MCP server in Databricks Agent Bricks.

  5. Configure the agent Use the system prompt from: agent/system_prompt.txt and make the three Weather MCP tools available to the agent. Agent System Prompt The agent is designed to follow these principles:

  6. Use tools for weather facts.

  7. Never hallucinate weather information.

  8. Select the appropriate tool based on the user's request.

  9. Ask for clarification when the location or date is ambiguous.

  10. Report API failures clearly.

  11. Explain recommendations using the returned weather data. The complete system prompt is stored in: agent/system_prompt.txt Error Handling The MCP server handles common failure cases including:

  • Invalid or unknown locations.

  • Weather API request failures.

  • Invalid API responses.

  • Missing forecast data.

  • Invalid dates.

  • Unsupported forecast ranges. Errors are returned as clean responses instead of exposing Python stack traces to the agent. The agent is instructed to report these failures rather than inventing a response. Demonstration The final submission will demonstrate the Agent Bricks agent answering at least three different natural-language weather questions. Demonstration 1 — Current Weather Question: What's the weather in Chicago right now? Expected behavior: Agent ↓ get_current_weather ↓ NWS ↓ Current weather result ↓ Agent response Current Weather Test Demonstration 2 — Forecast Question: What's the forecast for Chicago for the next three days? Expected behavior: Agent ↓ get_forecast ↓ NWS ↓ Multi-day forecast ↓ Agent response Forecast Weather Test

Forecast Weather Test

Demonstration 3 — Recommendation Question: Should I bring an umbrella to Chicago tomorrow? Expected behavior: Agent ↓ get_weather_recommendation ↓ Forecast data ↓ Recommendation rules ↓ Agent response Weather Recommendation Test

Weather Recommendation Test

Submission The submission includes:

Limitations

  • The implementation uses U.S.-focused National Weather Service data.

  • Location resolution depends on the external geocoding service.

  • Weather forecasts can change as new observations and forecasts are published.

  • The recommendation logic is intentionally simple and rule-based for this assignment.

  • The recommendation tool is not intended for emergency or safety-critical weather decisions. Future Improvements If additional development time were available, the project could be extended with:

  • Severe weather alerts.

  • Historical weather lookup.

  • Weather comparison across multiple cities.

  • More sophisticated recommendation logic.

  • Support for additional weather APIs and international locations.

  • A dashboard showing recent agent queries and recommendations.

F
license - not found
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Enables AI assistants to access real-time US weather forecasts and alerts through the National Weather Service API.
    2
    15
    MIT
  • F
    license
    B
    quality
    D
    maintenance
    Provides 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.
    2
    1
  • F
    license
    -
    quality
    D
    maintenance
    Provides real-time weather alerts and forecasts from the National Weather Service for US locations, integrating with AI assistants via the Model Control Protocol.
  • F
    license
    -
    quality
    D
    maintenance
    Provides weather forecasts and alerts for US locations via the National Weather Service API, enabling AI assistants to deliver real-time weather information.
    20

View all related MCP servers

Related MCP Connectors

  • US weather, alerts, earthquakes and elevation for AI agents, from NWS/NOAA and USGS. No API keys.

  • US weather & geo for AI agents: forecasts, alerts, earthquakes, elevation, geocoding. No keys.

  • Get US weather forecasts, active alerts, and current observations.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bhavikamange03/weather-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server