- Home
- MCP servers
- MCP Weather Server
MCP Weather Server
- python
0
GitHub Stars
python
Language
7 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.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"hritik003-weather": {
"command": "uv",
"args": [
"--directory",
"<path/to/weather>",
"run",
"weather"
]
}
}
}You run a lightweight MCP server that handles weather data and provides a CLI client for interaction. This setup uses asynchronous communication to efficiently respond to client requests and is easy to extend with new weather-related commands or data formats.
How to use
To operate locally, first start the weather MCP server, then connect with the CLI client to interact and fetch weather information.
Start the server to host weather data locally:
uv --directory <path/to/weather> run weather
# This launches the weather MCP server from the specified directory.
After the server is running, open another terminal to start the CLI client and connect to your local server:
uv run client.py <path/to/server.py>
# This launches the MCP CLI client and connects to the server you started.
With the client connected, you can request current weather data, observe weather updates, and extend the server with additional commands as needed. The design prioritizes asynchronous handling so multiple requests can be processed efficiently.
How to install
Prerequisites you need before installation include Python 3.12 or higher and access to a Python package installer.
Follow these steps to set up and run the server and client locally.
# Step 1: Install Python 3.12+
# Step 2: Ensure dependencies can be installed
# Step 3: Clone the project and install dependencies
# Replace the repository URL as needed
git clone https://github.com/Hritik003/mcp-weather-server.git
# Start the server from its directory using the specified command
cd Server
uv --directory <path/to/weather> run weather
# Start the client from its directory using the specified command
cd mcp-Client
uv run client.py <path/to/server.py>
Notes and quick references
This MCP Weather Server emphasizes modular design and extensibility. You can add new weather data formats or commands by extending the server’s command handling while keeping asynchronous communication intact.
Available tools
start_server
Launches the MCP weather server locally from the weather directory using the uv runtime.
start_client
Launches the CLI MCP client to interact with the running weather server.
async_communication
Uses asyncio to handle asynchronous client-server communication efficiently.