About Weather MCP Server
Weather MCP Server provides weather alerts for US states using the National Weather Service API. It is intended for MCP clients and includes stdio and SSE transports, plus a separate LLM-powered CLI client with conversation memory.
Key features
- 01Retrieve alerts for a US state
- 02Use stdio or SSE transport
- 03Run in a Docker container
- 04Integrate with Claude Desktop and Cursor IDE
- 05LLM-powered CLI client with conversation memory
Use cases
- 01Check weather alerts for a US state
- 02Connect weather alerts to Claude Desktop or Cursor IDE
- 03Use the LLM-powered CLI with conversation memory
MCP support
Exposes a get_alerts tool that returns weather alerts for a specified US state. The server supports stdio and SSE transports.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEWeather MCP Server
A Model Context Protocol (MCP) server implementation that provides weather alerts for US states, built using the MCP Python SDK. This project demonstrates how to create an MCP server with tools, resources, and Docker integration.
Features
- Weather alerts for US states using the National Weather Service API
- Support for both stdio and SSE (Server-Sent Events) transport
- Docker containerization
- Integration with Claude Desktop and Cursor IDE
- LLM-powered CLI client using Groq
- Built-in conversation memory support
Project Structure
Creating-MCP-server/
├── server/
│ ├── weather.py # Main MCP server implementation
│ ├── client.py # LLM-powered CLI client
│ └── weather.json # Server configuration
├── mcpserver/
│ ├── Dockerfile # Docker configuration
│ ├── requirements.txt # Python dependencies
│ ├── client-stdio.py # Standard I/O client example
│ ├── client-sse.py # SSE client example
│ └── server.py # Containerized server
Installation
Local Setup
- Clone the repository:
git clone <repository-url>
cd Creating-MCP-server
- Install dependencies:
pip install -r mcpserver/requirements.txt
Docker Setup
Pull the pre-built image:
docker pull ksharma9719/weather-mcp-server
Or build locally:
cd mcpserver
docker build -t weather-mcp-server .
Usage
Running the Server
Local Development
cd server
python weather.py
Using Docker
docker run -p 8000:8000 ksharma9719/weather-mcp-server
Client Examples
CLI Client with LLM Integration
cd server
python client.py
Standard I/O Client
cd mcpserver
python client-stdio.py
SSE Client
cd mcpserver
python client-sse.py
Available Tools
get_alerts
Get weather alerts for a US state.
Parameters:
state: Two-letter US state code (e.g., CA, TX, NY)
Example:
result = await session.call_tool("get_alerts", arguments={"state": "CA"})
Integration with Claude Desktop
- Install the server in Claude Desktop:
mcp install weather.py
- Optional: Specify a custom name:
mcp install weather.py --name "Weather Alerts Server"
Development
Prerequisites
- Python 3.11 or higher
- uv package manager
- Docker (optional)
Environment Variables
Create a .env file in the server directory:
GROQ_API_KEY=your_groq_api_key
Documentation
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Model Context Protocol team for the excellent SDK
- National Weather Service for their public API
- Groq for their LLM API
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.