Skip to main content
Glama

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

  1. Clone the repository:

    git clone https://github.com/Abhinavexists/MCP_Server.git
    cd weather-tool
  2. Install uv if you don't have it already:

    pip install uv
  3. Create and activate a virtual environment:

    uv venv
    • On Windows: .venv\Scripts\activate

    • On macOS/Linux: source .venv/bin/activate

  4. Install dependencies using uv (this project uses uv.lock and pyproject.toml):

    uv pip sync
  5. Create a .env file in the project root directory with your Gemini API key:

    GEMINI_API_KEY=your_gemini_api_key_here

Usage

  1. Start the client and connect to the weather server:

    python client.py server.py
  2. Once 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?
  3. Type quit to 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 AI

  • server.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

MIT License

Resources

For more information about Model Context Protocol (MCP), refer to the official Claude MCP documentation:

A
license - permissive license
Not graded
quality - not tested
D
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
    Not graded
    quality
    D
    maintenance
    Provides 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.
    76
    GPL 3.0
  • F
    license
    Not graded
    quality
    C
    maintenance
    A 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.
  • A
    license
    A
    quality
    A
    maintenance
    A 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.
    10
    MIT

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.

  • NOAA and ECMWF weather forecast MCP for discovery, validation, and GribStream OAuth queries.

  • OpenWeather MCP — wraps the OpenWeatherMap API (openweathermap.org)

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/Abhinavexists/MCP_Server'

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