Sponsored by Deepsite.site

Weather MCP Server

Created By
Jai-Keshav-Sharmaa year ago
Content

Weather 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.

MCP SDK Docker License

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

  1. Clone the repository:
git clone <repository-url>
cd Creating-MCP-server
  1. 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

  1. Install the server in Claude Desktop:
mcp install weather.py
  1. 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

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. 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
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
CursorThe AI Code Editor
WindsurfThe new purpose-built IDE to harness magic
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
DeepChatYour AI Partner on Desktop
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Tavily Mcp
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
ChatWiseThe second fastest AI chatbot™
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Amap Maps高德地图官方 MCP Server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Playwright McpPlaywright MCP server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Serper MCP ServerA Serper MCP Server