MCP_Server
Weather App MCP server that works with Claude Desktop
claude mcp add --transport stdio gautamrajur-mcp_server python3 /full/path/to/weather_mcp.py \ --env OPENWEATHER_API_KEY="your_openweather_api_key_here"
How to use
This MCP server provides weather information and related utilities through a set of tools and prompts. The core tools include get_weather, which returns current conditions and temperature for a specified city; get_sunrise_and_sunset_in_EST, which provides sunrise and sunset times in the EST timezone; and add_favorite_city, which lets you save cities for quick access. You can also access resources like Weather History to review past queries and Favorite Cities to manage your saved locations. Prompts such as weather_report generate a detailed forecast with clothing suggestions, and compare_cities lets you compare weather across multiple cities at a glance. To use these features, interact with the server by invoking the corresponding tool or prompt names and supplying any required parameters (e.g., city names).
How to install
Prerequisites:
- Python 3.x installed
- pip available
- OpenWeatherMap API key (sign up at openweathermap.org and obtain an API key)
Install dependencies:
pip install mcp httpx python-dotenv
Configure API key:
- Create a .env file in the project root and add:
OPENWEATHER_API_KEY=your_openweather_api_key_here
Prepare data storage:
mkdir -p weather_data
echo "[]" > weather_data/history.json
echo "[]" > weather_data/favorites.json
Run the MCP server:
# Example startup if weather_mcp.py is your main server script
python3 weather_mcp.py
Optionally, customize the configuration by editing the Claude Desktop config (as shown in the README) to point to your weather_mcp.py script.
Additional notes
Tips and notes:
- Ensure OPENWEATHER_API_KEY is set in the environment or in a .env file accessible by the server.
- The server stores query history and favorites in weather_data/history.json and weather_data/favorites.json; back these up if needed.
- If you modify the data directory or file names, update the server configuration accordingly.
- When deploying, keep the API key secure and do not commit the .env file to version control.
- If you encounter network or API rate limits, consider caching results or staggering requests for multiple cities.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP