MCP
Provides a natural language interface to query US weather data via Google's Gemini AI.
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., "@MCP What are the current weather alerts in CA?"
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.
MCP
A Simple implementation of a command-line tool that provides access to US weather data through a client-server architecture using the Model Context Protocol (MCP) and Google's Gemini AI. Built to practive and understand how MCP works.
Overview
This project connects a Python client application with a weather data server, allowing users to query weather information using natural language. The server communicates with the National Weather Service API to retrieve weather alerts and forecasts.
Related MCP server: mcp-foundry
Features
Query weather alerts for US states using state codes
Get detailed weather forecasts for specific locations using latitude and longitude
Natural language interface powered by Google's Gemini AI
Client-server architecture using Model Context Protocol (MCP)
Prerequisites
Python 3.8+
Node.js (if running JavaScript server)
Google Gemini API key
Installation
Clone the repository:
git clone https://github.com/Abhinavexists/MCP_Server.git cd weather-toolInstall uv if you don't have it already:
pip install uvCreate and activate a virtual environment:
uv venvOn Windows:
.venv\Scripts\activateOn macOS/Linux:
source .venv/bin/activate
Install dependencies using uv (this project uses uv.lock and pyproject.toml):
uv pip syncCreate a
.envfile in the project root directory with your Gemini API key:GEMINI_API_KEY=your_gemini_api_key_here
Usage
Start the client and connect to the weather server:
python client.py server.pyOnce connected, you can ask questions about weather information:
Query: What are the current weather alerts in CA? Query: What's the forecast for latitude 37.7749, longitude -122.4194?Type
quitto exit the application.
Available Tools
The server provides the following tools:
get_alerts: Fetches weather alerts for a specified US state (using two-letter state code)
get_forecast: Retrieves weather forecasts for a specific location (using latitude and longitude)
Project Structure
client.py: MCP client that connects to the server and processes user queries using Gemini AIserver.py: MCP server that implements weather data tools and communicates with the National Weather Service API
Error Handling
The application includes robust error handling for:
Invalid server script paths
Connection issues with the NWS API
Invalid or missing data in API responses
Future Improvements
Add additional weather data endpoints
Implement caching for frequently requested data
Add support for location name lookup (instead of requiring lat/long)
Create a web interface
License
Resources
For more information about Model Context Protocol (MCP), refer to the official Claude MCP documentation:
Available Tools
2 toolsget_alertsB
Get weather alert for US states.
Args:
state: Two-letter US state code (e.g. CA, NY)
Inputs: state (required).
get_forcastC
Get weather forecast for a location.
Args:
latitude: Latitude of the location
longitude: Longitude of the location
Inputs: latitude (required), longitude (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
get_alerts and get_forecast clearly serve distinct purposes: one retrieves alerts for a state, the other a forecast by coordinates. There is no ambiguity between them.
Both tool names follow a consistent get_ + noun pattern, matching the domain (alerts, forecast). The naming style is uniform and predictable.
With only two tools, the server feels very minimal, likely covering only a narrow subset of weather functionality. It is borderline appropriate for a highly focused server but may be too thin for general weather use.
The surface is extremely limited: no support for current conditions, alerts by coordinates, or marine/aviation forecasts. Users needing basic weather data beyond forecast or state alerts will find the server inadequate.
Related MCP Connectors
Hosted MCP server for Xweather weather data: conditions, forecasts, alerts, and more.
MCP server for weather with reasoning — umbrella advice, outdoor checks, city comparisons.
Official NWS forecasts and alerts, as one MCP tool through Apify
Weather, code search, currency & Solana trust scoring as MCP tools. Free, no API key needed.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides weather forecasts and active alerts for US locations using the National Weather Service API. It supports both local stdio and remote HTTP/SSE transport modes for flexible integration with MCP clients.ISC
- AlicenseNot gradedqualityDmaintenanceAn MCP server providing AI-powered weather tools via Google Generative AI, enabling real-time weather data retrieval through natural language queries.MIT
- FlicenseNot gradedqualityDmaintenanceA demo MCP server that provides AI assistants access to live US weather data via the free National Weather Service API, offering forecast and alert tools without requiring an API key.-
- AlicenseAqualityDmaintenanceA free, MIT-licensed MCP server that provides AI agents with analyst-grade US severe-weather tools, including live warning polygons, SPC outlooks, radar-derived hail and rotation products, and a composite threat brief.10MIT