mcp-weather-server

mcp-weather-server

3.5

The MCP Weather Application is a client-server system using the Model Context Protocol to retrieve weather data from the National Weather Service API.

The MCP Weather Application is designed to demonstrate the use of the Model Context Protocol (MCP) framework in a client-server architecture to fetch and process weather information. The server component connects to the National Weather Service (NWS) API to retrieve weather alerts and forecasts, while the client component uses LangChain and the Groq API to interpret natural language queries. The client determines if a server tool is needed to fulfill a query, sends a request to the server via MCP, and incorporates the server's response into a final answer for the user. This setup allows for seamless interaction between natural language processing and real-time data retrieval.

Features

  • MCP Framework: Utilizes the Model Context Protocol for efficient client-server communication.
  • NWS API Integration: Fetches real-time weather data from the National Weather Service.
  • Natural Language Processing: Uses LangChain and Groq API for interpreting user queries.
  • Tool Discovery: Client discovers available server tools for dynamic query handling.
  • Automated Response: Integrates server data into natural language responses for users.

MCP Tools

  • get_alerts: Fetches current weather alerts from the NWS API.
  • get_forecast: Retrieves weather forecasts from the NWS API.

Usage with Different Platforms

uvicorn

bash
uv run client.py ../weather/weather.py