weather
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@weatherWhat are the weather alerts in CA?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Weather MCP Server
Overview
This project implements a Model Context Protocol (MCP) server that provides weather information services. It leverages the National Weather Service (NWS) API to fetch weather alerts and forecasts, and exposes them as tools that can be used by MCP clients like Claude.
The server is built with a modular architecture following best practices for Python projects, making it easy to maintain and extend.
Features
Weather Tools: Get weather alerts for states and forecasts for specific coordinates
System Tools: Run shell commands and view system process information
MCP Integration: Seamlessly integrates with MCP clients like Claude Desktop
Installation
Prerequisites
Python 3.11 or higher
uv package manager
Setup
Clone the repository:
git clone https://github.com/yourusername/weather.git cd weatherInstall dependencies using uv:
make installFor development, install additional dependencies:
make dev
Usage
Running the Server
To start the MCP server:
make runOr directly with uv:
uv run python -m mainConnecting to Claude Desktop
Update your Claude Desktop configuration to include the weather server:
{
"mcpServers": {
"weather": {
"command": "python",
"args": ["-m", "main"],
"cwd": "/path/to/weather"
}
}
}Restart Claude Desktop to apply the changes
In Claude Desktop, you can now select the "weather" MCP server from the MCP server dropdown menu
The weather MCP server will be available to Claude Desktop, allowing you to interact with weather data directly in your conversations.
Example Queries
Once connected, you can ask Claude:
"What are the current weather alerts in CA?"
"What's the forecast for latitude 37.7749, longitude -122.4194?"
"What processes are using the most CPU on my system?"
Project Structure
weather/
├── src/
│ └── weather/
│ ├── __init__.py # Package initialization
│ ├── server.py # Main server setup
│ ├── tools/ # Tool implementations
│ │ ├── __init__.py
│ │ ├── weather_tools.py
│ │ └── system_tools.py
│ ├── resources/ # Resource implementations
│ │ ├── __init__.py
│ │ └── system_resources.py
│ ├── services/ # External service integrations
│ │ ├── __init__.py
│ │ ├── weather_service.py
│ │ └── system_service.py
│ └── utils/ # Helper functions
│ ├── __init__.py
│ ├── http.py
│ └── formatting.py
├── tests/ # Test suite
├── main.py # Entry point
├── pyproject.toml # Dependencies and metadata
├── Makefile # Build commands
└── README.md # This fileMake Targets
The project includes several make targets to simplify development:
Target | Description |
| Install project dependencies using uv |
| Run ruff linter with auto-fix using uv |
| Run black formatter using uv |
| Check if files would be reformatted by black |
| Run both linter and formatter |
| Run tests using pytest with uv |
| Remove build artifacts and cache files |
| Check for outdated dependencies using uv |
| Upgrade all outdated dependencies using uv |
| Start the MCP server using uv |
| Start the MCP Inspector for testing |
| Install git hooks |
| Start the MCP server in development mode |
| Stop the MCP server and Inspector |
| Install the server in Claude Desktop |
| Uninstall the server from Claude Desktop |
Run make help to see all available targets.
Using with Claude Desktop
To use the weather MCP server with Claude Desktop:
Install the server in Claude Desktop:
make claude-installThis will:
Use the MCP CLI to install the server in Claude Desktop
Install the project in editable mode (
-e .)Register the server with the name "weather"
Configure the server to run from your project directory
Restart Claude Desktop to apply the changes
In Claude Desktop, you can now select the "weather" MCP server from the MCP server dropdown menu
The weather MCP server will be available to Claude Desktop, allowing you to interact with weather data directly in your conversations.
To uninstall the server from Claude Desktop:
make claude-uninstallThis will remove the weather MCP server configuration from Claude Desktop. You'll need to restart Claude to apply the changes.
Development Mode
For active development with automatic reloading when code changes:
# Start the server in development mode with the MCP Inspector
make dev-serverThis will:
Start the MCP server using the
mcp devcommandInstall the project in editable mode (
-e .)Launch the MCP Inspector automatically
Enable automatic reloading when your code changes
The MCP Inspector will be available at http://localhost:5173 in your web browser.
To stop the server and Inspector:
make stop-serverThis setup is ideal for iterative development as the server will automatically reload when you make changes to your code.
Inspector Features
The MCP Inspector allows you to:
Explore Tools: View all available tools, their parameters, and documentation.
Call Tools: Execute tools with custom parameters and see the results.
Browse Resources: View all available resources and their current values.
Test Prompts: If your server provides prompt templates, you can test them with different inputs.
View Logs: See detailed logs of all interactions between the Inspector and your server.
Testing Weather Tools
With the Inspector, you can easily test the weather tools:
Find the
get_weather_alertstool in the Inspector interfaceEnter a state code (e.g., "CA", "NY", "FL") in the parameters field
Execute the tool and view the results
Similarly, you can test the get_forecast tool by providing latitude and longitude coordinates.
Testing System Tools
The Inspector also makes it easy to test system tools:
Find the
run_shell_commandtoolEnter a safe command (e.g., "ls -la", "echo hello") in the parameters field
Execute the tool and view the results
Debugging with the Inspector
The Inspector is particularly useful for debugging:
It shows detailed error messages if a tool call fails
You can see the exact request and response payloads
It helps identify issues with parameter validation or tool implementation
For more information about the MCP Inspector, visit the Model Context Protocol documentation.
Testing Locally
You can test your MCP server locally using the MCP CLI tool that comes with the mcp[cli] package:
Start your server:
make runIn a separate terminal, use the MCP CLI to interact with your server:
# List all available tools make inspector # Call a specific weather tool mcp call-tool http://localhost:8000 get_weather_alerts --args '{"state": "CA"}' # Get a weather forecast mcp call-tool http://localhost:8000 get_forecast --args '{"latitude": 37.7749, "longitude": -122.4194}' # List system resources mcp list-resources http://localhost:8000 # Get system processes mcp get-resource http://localhost:8000 top_processes
If you're using uv directly, you can run the MCP CLI with:
uv run mcp list-tools http://localhost:8000Development
Adding New Tools
To add a new tool to the server:
Create a function in the appropriate tools module
Register it with the
@server.tool()decoratorUpdate the tool registration in
tools/__init__.py
Example:
@server.tool()
async def my_new_tool(param1: str, param2: int) -> str:
"""
Tool description.
Args:
param1: Description of param1
param2: Description of param2
Returns:
Description of return value
"""
# Implementation
return resultAdding New Resources
To add a new resource:
Create a function in the appropriate resources module
Register it with the
@server.resource()decoratorUpdate the resource registration in
resources/__init__.py
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Model Context Protocol for the MCP specification
National Weather Service API for weather data
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jalateras/weather'
If you have feedback or need assistance with the MCP directory API, please join our Discord server