
mcp weather example
Example of mcp weather set up
Repository Info
About This Server
Example of mcp weather set up
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Weather MCP Server
This repository contains a Model Context Protocol (MCP) server for weather forecasting and alerts. Follow the steps below to set it up on your local machine.
Prerequisites
-
Claude for Desktop
- Download and install Claude for Desktop from the official website.
- Ensure it is updated to the latest version.
-
uvCLI-
For macOS/Linux: Install the
uvCLI by running the following command in your terminal:curl -LsSf https://astral.sh/uv/install.sh | shRestart your terminal to ensure the
uvcommand is available. -
For Windows: Install the
uvCLI using PowerShell with the following command:iwr https://astral.sh/uv/install.ps1 -useb | iexRestart your terminal to ensure the
uvcommand is available.
-
-
Python
- Install Python 3.10 or higher.
Setup Instructions
-
Clone this repository:
git clone <repository-url> cd weather -
Create a virtual environment and activate it:
uv venv source .venv/bin/activate -
Install dependencies:
uv add "mcp[cli]" httpx -
Run the server:
uv run weather.py
Installing Dependencies from requirements.txt
If you prefer to use the requirements.txt file to install dependencies, follow these steps:
-
Ensure your virtual environment is activated:
source .venv/bin/activate -
Install the dependencies:
pip install -r requirements.txt
Configuring Claude for Desktop
-
Locate the
claude_desktop_config.jsonfile in this repository. -
Move it to the appropriate configuration directory for Claude for Desktop:
- On Windows: Place it in
%AppData%\\Claude\\claude_desktop_config.json. - On MacOS/Linux: Place it in
~/Library/Application Support/Claude/claude_desktop_config.json.
- On Windows: Place it in
-
Edit the configuration file to include the absolute path to this repository. For example:
{ "mcpServers": { "weather": { "command": "uv", "args": [ "--directory", "/ABSOLUTE/PATH/TO/PARENT/FOLDER/weather", "run", "weather.py" ] } } } -
Restart Claude for Desktop to apply the changes.
Testing the Server
- Open Claude for Desktop and ensure the MCP server is detected.
- Test the server by asking questions like:
- "What’s the weather in Sacramento?"
- "What are the active weather alerts in Texas?"
Additional Resources
- MCP Quickstart Guide
- Debugging MCP Servers
Feel free to reach out if you encounter any issues!
Quick Start
Clone the repository
git clone https://github.com/fhuamancaja/mcp-weather-exampleInstall dependencies
cd mcp-weather-example
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.