Weather app provides current conditions forecasts alerts worldwide via command-line interface
The Weather App MCP Server is an advanced, command-line-based weather application designed to provide real-time weather conditions and forecasts for locations worldwide. It leverages the Model Context Protocol (MCP) to seamlessly integrate with AI applications such as Claude Desktop, Continue, Cursor, and others, allowing them to leverage a standardized, reliable interface for accessing weather data.
get_current_weather
: Retrieve current weather conditions.get_forecast
: Obtain daily forecast details.get_hourly_forecast
: View hourly conditions.get_alerts
: Stay updated on severe weather events.get_weather_by_coordinates
: Fetch weather data by geographic coordinates.get_user_location
: Determine current location or set a new one.test_api_connection
: Test the API to ensure connectivity.check_api_key_and_subscription
: Validate your API key and subscription status.The Weather App MCP Server follows the Model Context Protocol (MCP) for seamless integration with AI applications. The protocol ensures that data requests are standardized, making it easier for AI applications to consume and utilize weather-related services. The server implements a robust MCP endpoint that supports various API calls:
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server]
C --> D[Data Source/Tool]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
MCP Client | Resources | Tools | Prompts | Status |
---|---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ | Full Support |
Continue | ✅ | ✅ | ✅ | Full Support |
Cursor | ❌ | ✅ | ❌ | Tools Only |
This matrix highlights that while all clients support data resources and tools, not all support prompts, indicating that full compatibility is available for tools.
The architecture of the Weather App MCP Server ensures reliable and efficient integration with AI applications. It uses Python 3.12 or higher and relies on the uv
package manager for dependencies, streamlining setup and configuration. The server runs a FastMCP framework that exposes API endpoints following MCP protocol standards.
To get started with installing the Weather App MCP Server, you'll need to meet certain prerequisites:
uv
package managerClone the repository:
git clone <repository-url>
cd weather-app
Create a .env
file and provide your OpenWeatherMap API key:
OPENWEATHER_API_KEY=your_api_key_here
Run the installation script with or without development mode options:
For standard setup, use:
./scripts/install.sh
For a development environment, add --dev
flag:
./scripts/install.sh --dev
Imagine integrating the Weather App MCP server into an AI-powered personal assistant that provides users with real-time weather updates. When a user asks, "What's the current temperature outside?" the assistant can fetch the data from theWeather App MCP Server, ensuring accuracy and reliability.
AI-driven home automation systems can use the Weather App MCP server to react to different weather conditions. For example, if it's raining heavily, smart lights could be dimmed or smart shutters closed automatically. This integration would leverage hourly forecast data and alerts from the MCP server.
Integration with MCP clients is designed to be straightforward, providing a seamless experience for users and developers. The server supports automatic detection of API credentials and location services, ensuring that AI applications can quickly begin accessing relevant weather information.
The performance of the Weather App MCP Server is optimized for efficiency when handling multiple requests from various AI clients. It ensures minimal latency and smooth operation, making it ideal for real-time applications.
import os
from dotenv import load_dotenv
from mcp.server.fastmcp import FastMCP
# Load environment variables
load_dotenv()
# Initialize FastMCP server
mcp = FastMCP("WeatherApp")
# Define your tools
@mcp.tool
async def get_current_weather(location: str) -> str:
"""Fetch current weather conditions for a given location."""
# Your implementation here
return "Current Weather Data"
# Run the server
if __name__ == "__main__":
mcp.run()
For more advanced configurations and enhanced security, you can customize the environment variables and add additional tools as needed. The FastMCP
framework allows for secure handling of API keys, ensuring data privacy and integrity during queries.
Q: Can this server be integrated with different MCP clients?
Q: How can I test if my API key is working correctly?
test_api_connection
tool provided by the server to quickly verify your API key's validity without interrupting other functionalities.Q: Can this server be run locally, or must it be hosted online?
Q: How do I set up custom environment variables while running the server?
.env
files or specify them during installation using --env-override
flags provided by the uv
manager.Q: Is there documentation available for advanced tool creation and configuration?
Contributions are highly encouraged from the developer community. If you wish to contribute, ensure you adhere to our development practices by setting up pre-commit hooks for automated code formatting and linting. Contributions can be made through pull requests, addressing issues, or adding new feature implementations.
For developers looking to integrate with various MCP servers and tools, the Weather App MCP Server serves as a robust foundation that aligns seamlessly with the broader MCP ecosystem. Explore other open-source projects within this ecosystem for additional inspiration and integration ideas.
By following these guidelines and leveraging the Weather App MCP Server, you can significantly enhance your AI applications by providing reliable, real-time weather information through a standardized protocol.
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Learn to set up MCP Airflow Database server for efficient database interactions and querying airflow data
Build stunning one-page websites track engagement create QR codes monetize content easily with Acalytica
Explore CoRT MCP server for advanced self-arguing AI with multi-LLM inference and enhanced evaluation methods
Access NASA APIs for space data, images, asteroids, weather, and exoplanets via MCP integration