Weather Prediction MCP Server

Weather Prediction MCP Server

An MCP server that provides weather forecast tools (current weather, forecast, travel recommendations, and city comparison) powered by Open-Meteo, designed for Databricks Agent Bricks.

Category
Visit Server

README

Weather Prediction MCP Server

A Model Context Protocol (MCP) server that exposes weather-forecast tools, designed for consumption by a Databricks Agent Bricks agent. Deployed as a Databricks App.

Architecture

┌───────────────────────────────────────────────────────────────────┐
│  User (natural language)                                         │
│       │                                                          │
│       v                                                          │
│  Agent Bricks Agent (system_prompt.txt)                          │
│       │  MCP tool calls (streamable-HTTP)                        │
│       v                                                          │
│  ┌───────────────────────────────────────────────────────────┐   │
│  │  weather_mcp_server.py (FastMCP, Databricks App)       │   │
│  │    ├─ get_current_weather(location)                     │   │
│  │    ├─ get_forecast(location, days)                      │   │
│  │    ├─ get_travel_recommendation(location, days)         │   │
│  │    └─ compare_weather(locations, days)                  │   │
│  └───────────────────────────────────────────────────────────┘   │
│       │                                                          │
│       v                                                          │
│  ┌───────────────────────────────────────────────────────────┐   │
│  │  weather_adapter.py (HTTP layer)                        │   │
│  │    ├─ geocode(location) → lat/lon                       │   │
│  │    ├─ get_current_weather(lat, lon)                     │   │
│  │    ├─ get_forecast(lat, lon, days)                      │   │
│  │    └─ build_recommendations(forecast)                   │   │
│  └───────────────────────────────────────────────────────────┘   │
│       │                                                          │
│       v                                                          │
│  Open-Meteo API (free, no key required)                          │
│    ├─ geocoding-api.open-meteo.com/v1/search                     │
│    └─ api.open-meteo.com/v1/forecast                              │
└───────────────────────────────────────────────────────────────────┘

Weather API

Open-Meteo — chosen because:

  • Zero signup, zero API keys, zero cost
  • ~10,000 calls/day (non-commercial)
  • Global coverage (not US-only)
  • Provides geocoding, current weather, and 16-day forecasts in one API family

Tools

Tool Purpose Key Inputs
get_current_weather Live conditions (temp, wind, humidity) location
get_forecast Multi-day daily forecast location, days (1-16)
get_travel_recommendation Packing/planning advice with thresholds location, days (1-16)
compare_weather Side-by-side city comparison locations (list), days

Recommendation Thresholds

Condition Threshold Advice
Rain Precip probability > 40% Bring umbrella/rain jacket
Cold Temp < 15°C Light jacket
Very cold Temp < 5°C Heavy coat + thermals
Windy Wind > 30 km/h Windbreaker
High UV UV index ≥ 5 Sunscreen + sunglasses
Heat Temp > 35°C Hydration alert
Variable Day swing > 10°C Dress in layers

Project Structure

WeatherMCPserver/
├── weather_adapter.py       # HTTP layer: Open-Meteo API calls + geocoding + logic
├── weather_mcp_server.py    # FastMCP server with @mcp.tool decorators
├── pyproject.toml           # UV package management
├── app.yaml                 # Databricks App deployment config
├── system_prompt.txt        # Agent Bricks system prompt
└── README.md                # This file

Setup & Deployment

Prerequisites

  • Databricks workspace with Apps enabled
  • UV installed (pip install uv or curl -LsSf https://astral.sh/uv/install.sh | sh)
  • No API keys needed (Open-Meteo is key-free)

Local Development

# Install dependencies
uv sync

# Run the MCP server locally
uv run weather_mcp_server.py

# Server starts on http://localhost:8000
# MCP endpoint: http://localhost:8000/mcp

Deploy as Databricks App

# From the workspace, deploy the app
databricks apps create weather-mcp-server \
  --source-code-path /Workspace/Users/<your-email>/WeatherMCPserver

# Or deploy via the Apps UI:
# 1. Go to Compute > Apps > Create App
# 2. Point source to this folder
# 3. The app.yaml handles the rest

Register as External MCP Tool in Agent Bricks

  1. Navigate to your Agent Bricks agent configuration
  2. Add an External MCP connection:
    • URL: https://<your-app-url>/mcp
    • Transport: Streamable HTTP
  3. Paste the contents of system_prompt.txt as the agent's system prompt
  4. Test with: "What's the weather in Tokyo right now?"

Example Queries

Current conditions:

"What's the temperature in Berlin right now?"

Forecast:

"Will it rain in Chicago this week?"

Travel advice:

"I'm traveling to Austin, Texas for 3 days. What should I pack?"

Comparison:

"Which has better weather this weekend: Miami, LA, or Denver?"

Edge cases (handled gracefully):

"What's the weather in Xyzzyville?" → Error: location not found, suggests being more specific.

Authentication & Secrets

None required. Open-Meteo needs no API key. If you later add a keyed API (e.g. WeatherAPI.com), store the key as a Databricks secret:

from databricks.sdk import WorkspaceClient
w = WorkspaceClient()
api_key = w.secrets.get_secret(scope="weather", key="api_key").value

Never hardcode keys in source files.

Lakebase Integration (Optional)

Query history can be stored in the provisioned Lakebase Postgres instance for dashboard/analytics:

Host: ep-gentle-paper-e1xaec1l.database.eastus2.azuredatabricks.net
Database: databricks_postgres
User: WeatherMCPserver

License

Internal project — Databricks learning challenge submission.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured