Weather MCP Server
Click on "Deploy 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., "@Weather MCP ServerGet active weather alerts for Texas"
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 for Claude
This repository implements a Model Context Protocol (MCP) server for Claude. It exposes weather-related tools via FastMCP over stdio, using the National Weather Service (NWS) API for data.
Project Structure
weather/
├── clients/
│ ├── __init__.py
│ └── nws_client.py
├── formatters/
│ ├── __init__.py
│ └── alert_formatter.py
├── services/
│ ├── __init__.py
│ └── weather_service.py
├── tools/
│ ├── __init__.py
│ └── weather_tools.py
├── models/
│ ├── __init__.py
│ └── responses.py
├── config.py
├── logging_config.py
├── main.py
├── pyproject.toml
└── README.mdRelated MCP server: Weather MCP Server
Features
MCP server for Claude using
FastMCPget_alerts(state)tool for active weather alertsget_forecast(latitude, longitude)tool for forecast dataSimple, maintainable service and client separation
Requirements
Python 3.10 or higher
uvinstalled and available at the full path used by Claudemcpandhttpxdependencies installed in the Python environment
Running the Server Locally
From the repository root:
cd /Users/dinukakasun/Documents/MCP/weather
/Users/dinukakasun/.local/bin/uv --directory /Users/dinukakasun/Documents/MCP/weather run main.pyor using the virtual environment Python if preferred:
/Users/dinukakasun/Documents/MCP/weather/.venv/bin/python main.pyThe server should start and expose MCP tools on stdio.
Claude Desktop MCP Configuration
Update ~/Library/Application Support/Claude/claude_desktop_config.json so Claude launches this server with the correct executable path and working directory.
Example configuration:
{
"mcpServers": {
"weather": {
"command": "/Users/dinukakasun/.local/bin/uv",
"args": [
"--directory",
"/Users/dinukakasun/Documents/MCP/weather",
"run",
"main.py"
]
}
}
}Why absolute paths matter
Claude desktop may not inherit your interactive shell PATH. Using the absolute uv path avoids startup failures caused by missing commands.
Example Claude Questions
Use these example prompts to exercise the MCP server:
Get the current weather alerts for CA using get_alerts.Call get_forecast with latitude 37.7749 and longitude -122.4194.What are active alerts for NY?Provide a 5-period weather forecast for 40.7128, -74.0060.
Local Test Client
You can verify the MCP tools locally with a small Python client that starts the server and sends a request over stdio.
import asyncio
import json
import subprocess
async def run_request():
proc = await asyncio.create_subprocess_exec(
"/Users/dinukakasun/.local/bin/uv",
"--directory",
"/Users/dinukakasun/Documents/MCP/weather",
"run",
"main.py",
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
request = {
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {},
"clientInfo": {"name": "local-test", "version": "1.0.0"}
}
}
stdout, stderr = await proc.communicate((json.dumps(request) + "\n").encode())
print(stdout.decode())
print(stderr.decode())
asyncio.run(run_request())This confirms the server accepts MCP requests. For tool-specific tests, replace method with a valid tool name and pass params matching the tool signature.
Verifying the MCP Server
Start the server manually.
Confirm the process is running:
ps aux | grep "main.py" | grep -v grepConfirm Claude is configured to use the same command and working directory.
If Claude still does not connect, use the absolute
uvpath inclaude_desktop_config.json.
Notes
The MCP server uses
stdiotransport, not a network HTTP endpoint.The entrypoint is
main.py, notweather.py.The tools are registered in
tools/weather_tools.py.
Reference
Model Context Protocol Python server docs: https://modelcontextprotocol.io/docs/develop/build-server#python
Available Tools
2 toolsget_alertsD
| Name | Required | Description | Default |
|---|---|---|---|
| state | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_forecastD
| Name | Required | Description | Default |
|---|---|---|---|
| latitude | Yes | ||
| longitude | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v0.1.0- First observed
get_alerts - First observed
get_forecast
TDQS
Scored across 2 tools
The two tools, get_alerts and get_forecast, have clearly distinct purposes. An agent can easily differentiate between retrieving weather alerts and obtaining a forecast, with no overlap in functionality.
Both tools follow a consistent verb_noun pattern using snake_case (get_alerts, get_forecast), ensuring predictable and uniform naming.
With only two tools, the server's scope feels somewhat thin for a weather-related service. While it covers the basics, a typical weather server would benefit from additional tools like current conditions or location search.
The tool set covers alerts and forecasts, but lacks common operations such as current conditions or historical data. This represents a notable gap that may hinder comprehensive weather queries.
Maintenance
Related MCP Connectors
Get US weather forecasts, active alerts, and current observations.
US weather & geo for AI agents: forecasts, alerts, earthquakes, elevation, geocoding. No keys.
US weather & geo for AI agents: forecasts, alerts, earthquakes, elevation, geocoding. No keys.
Provide real-time and forecast weather information for locations in the United States using natura…
Related MCP Servers
- FlicenseDqualityDmaintenanceProvides real-time weather forecasts and alerts by fetching data from the National Weather Service API, allowing Claude to answer weather-related questions with up-to-date information.2-
- FlicenseBqualityDmaintenanceProvides real-time US weather alerts and forecasts by integrating with the National Weather Service API. It enables AI assistants to fetch state-specific alerts and detailed local forecasts using geographic coordinates.21-
- FlicenseNot gradedqualityDmaintenanceProvides weather forecasts and alerts for US locations via the National Weather Service API, enabling AI assistants to deliver real-time weather information.8 npm-
- FlicenseNot gradedqualityDmaintenanceExposes tools for retrieving weather forecasts and alerts using the National Weather Service API.-