- Home
- MCP servers
- Weather
Weather
- python
0
GitHub Stars
python
Language
6 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You set up this Weather MCP Server to give your AI assistants access to live weather data and forecasts through a consistent set of tools, resources, and prompts. It acts as a bridge between external weather services and your AI workflows, so you can ask natural questions like a weather assistant and get structured, actionable results.
How to use
Use the Weather MCP Server with an MCP client to let your AI assistant fetch current weather, forecast data, and location information. The server exposes tools that you can call from your prompts, provides readable weather resources, and offers prompts to analyze or compare weather patterns. In practice, you can ask your AI to get a current condition for a location, request a multi‑day forecast, or compare weather across two places. The AI will automatically invoke the appropriate tool, read the weather resources, or apply the available prompts to fulfill your request.
How to install
Prerequisites: Python 3.12 or higher and a way to run Python commands. You also need a package manager for your environment. The server example uses the uv package manager, but you can also work with pip.
- Install dependencies using the package manager you prefer.
uv sync
# or
pip install -r requirements.txt
# Optional: create a local environment file
# .env
WEATHER_API_KEY=your_api_key_here
"} ]},{
-
Prepare environment variables if you plan to use a real API. If you omit the API key, the server will use mock data for demonstration.
-
Run the server. Use the command that starts the MCP server process.
Configuration and execution notes
The server runs as a local process and communicates through standard input/output. This is the MCP transport used by Cursor IDE, so you can configure Cursor to launch the server and connect to it automatically.
For local development, the example run uses the uv package manager to start the server from a Python script.
Here is the exact command used to start the server in this setup.
uv run
python main.py
````}]} ,{
Cursor IDE integration
In Cursor IDE you can add an MCP server configuration so the AI can use the weather tools and resources. Create a weather MCP server entry that points to the local MCP process and ensures the correct working directory is used.
Example MCP configuration for Cursor IDE (adjust the path to your project):
{
"mcpServers": {
"weather": {
"command": "uv",
"args": [
"run",
"python",
"/Users/pratik/weather/main.py"
],
"env": {}
}
}
}
```"}]} ,{
Usage examples
Ask your AI to fetch weather data, compare locations, or analyze patterns using the provided tools and prompts. Examples you can try after setup include asking for the current weather in a city, requesting a 5‑day forecast for a location, or comparing weather between two cities.
Available tools
get_current_weather
Fetches current weather conditions for a given location and returns structured data such as temperature, humidity, wind, and conditions.
get_weather_forecast
Returns a multi-day forecast for a specified location with daily temperature ranges, precipitation chances, and conditions.
search_locations
Searches for location names matching a query to help users find the exact location for weather data.