Weather MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Weather MCP Server
A Model Context Protocol (MCP) server that provides weather information, web search capabilities, and basic math operations using FastMCP.
Features
π€οΈ Weather Tools
get_alerts: Get weather alerts for any US state
get_forecast: Get detailed weather forecast for any location (latitude/longitude)
π Search Tools
brave_search: Search the web using Brave Search API
add_numbers: Add two numbers together
π‘ Prompts
suggest_events: Get comprehensive weather data and event suggestions for a location
Related MCP server: mcp-weather-api
Prerequisites
Python 3.11 or higher
uv package manager
Brave Search API key (free from Brave Search API)
Installation
Clone and navigate to the project:
cd /opt/projects/mcp-hack/weatherInstall dependencies:
uv sync
Configuration
The server uses a hardcoded Brave Search API key. If you want to use your own API key, you can:
Get a free API key from Brave Search API
Update the
BRAVE_API_KEYconstant inweather.py
Running the Server
Method 1: Direct Python execution
uv run python weather.pyMethod 2: Using the main module
uv run python main.pyMethod 3: Using uv with module execution
uv run -m weatherUsage Examples
Once the server is running, you can use the following tools:
Weather Tools
# Get weather alerts for California
get_alerts("CA")
# Get forecast for San Francisco (37.7749, -122.4194)
get_forecast(37.7749, -122.4194)Search Tool
# Search the web with default 3 results
brave_search("python programming tutorials")
# Search with custom result count
brave_search("weather forecast San Francisco", 5)Math Tool
# Add two numbers
add_numbers(15.5, 24.3)Prompts
# Get weather-based event suggestions
suggest_events("San Francisco")
# or with coordinates
suggest_events("37.7749,-122.4194")API Integration
This server integrates with:
National Weather Service API: For weather data and alerts
Brave Search API: For web search functionality
FastMCP: For MCP server implementation
LangChain Community: For Brave Search tool integration
Development
Project Structure
weather/
βββ weather.py # Main MCP server with all tools
βββ main.py # Alternative entry point
βββ pyproject.toml # Project dependencies
βββ uv.lock # Dependency lock file
βββ README.md # This fileAdding New Tools
To add new tools, follow the FastMCP pattern:
@mcp.tool()
async def your_tool_name(param1: str, param2: int = 10) -> str:
"""Tool description.
Args:
param1: Description of parameter 1
param2: Description of parameter 2 (default: 10)
"""
# Your tool logic here
return "Tool result"Troubleshooting
Common Issues
"BRAVE_SEARCH_API_KEY environment variable not set"
The API key is hardcoded in the server, but if you see this error, check that
BRAVE_API_KEYis properly set inweather.py
Weather API errors
Ensure you're using valid US state codes (2 letters) for alerts
Verify latitude/longitude coordinates are valid for forecasts
Import errors
Run
uv syncto ensure all dependencies are installedMake sure you're using Python 3.11 or higher
Dependencies
Key dependencies include:
fastmcp: MCP server frameworkhttpx: HTTP client for API requestslangchain-community: Brave Search integrationlangchain-core: Core LangChain functionality
License
This project is part of the MCP hack and is provided as-is for educational and development purposes.
This server cannot be deployed
Maintenance
Related MCP Connectors
US NWS weather alerts and 5-day forecasts for AI agents. $0.01 per call.
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.
Get current weather for any city and create images from your prompts. Streamline planning, reportsβ¦
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides current weather conditions, seven-day forecasts, and US weather alerts using Open-Meteo and National Weather Service APIs. It enables users to retrieve global weather data and regional alerts without requiring any API keys.73 npmGPL 3.0
- AlicenseNot gradedqualityDmaintenanceProvides weather forecasts and alerts for US locations via the National Weather Service API, enabling AI assistants to deliver real-time weather information.8 npmISC
- AlicenseNot gradedqualityCmaintenanceProvides real-time weather, 5-day forecasts, and weather alerts for US states via NWS and WeatherAPI.com, accessible through natural language queries.0MIT
- FlicenseNot gradedqualityCmaintenanceProvides real-time weather data, forecasts, alerts, and travel recommendations for US locations using the National Weather Service API, enabling agents to answer weather-related queries.-