Weather MCP Server
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., "@Weather MCP ServerAre there any active weather alerts for California?"
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 & Client
A Model Context Protocol (MCP) implementation that exposes weather alerts from the National Weather Service API as tools. Includes an interactive chat client powered by Groq LLM and test scripts for both STDIO and SSE transports.
Table of Contents
Related MCP server: MCP Weather Alert Agent
Prerequisites
Python 3.13+ (see pyproject.toml)
uv – Python package manager (install)
Groq API Key – for the LLM (get one)
Setup
Clone or navigate to the project:
cd /path/to/MCPCreate a
.envfile with your Groq API key:GROQ_API_KEY=your_groq_api_key_hereInstall dependencies with uv:
uv syncThis creates a
.venvand installs all dependencies frompyproject.toml. The project useslangchain>=1.2.0,<2.0.0for compatibility with mcp-use.
Configuration Files
File | Purpose |
| Default config for stdio: spawns |
| Same as above; used by stdio test script |
| SSE config: connects to |
Config Format
STDIO (command-based):
{
"mcpServers": {
"weather": {
"command": "uv",
"args": ["run", "server/weather.py"]
}
}
}SSE (URL-based):
{
"mcpServers": {
"weather": {
"url": "http://127.0.0.1:8000/sse"
}
}
}Use Cases & How to Run
All commands use uv run to execute scripts with the project's virtual environment and dependencies.
Case 1: Interactive Chat Client (STDIO)
Run an interactive chat that connects to the weather MCP server. The agent can call get_alerts when you ask about weather.
Run:
uv run client_chatbot.pyCommands:
Type any question (e.g., "What are the weather alerts for California?")
exitorquit– end the sessionclear– clear conversation history
What happens:
Client reads
server/weather_mcp.jsonSpawns
uv run server/weather.pyas a subprocessCommunicates via stdin/stdout (stdio transport)
Agent uses Groq LLM and calls
get_alertswhen needed
Case 2: STDIO Transport Test
Explicit test of the stdio transport. Same behavior as Case 2 but uses a dedicated config file.
Run:
uv run test_weather_stdio.pyWhat happens:
Uses
server/weather_stdio_config.jsonClient spawns
uv run server/weather.pyRuns one query and exits
Case 3: SSE Transport Test
Test the SSE (HTTP) transport. The script starts the server in HTTP mode, connects via URL, runs a query, then shuts down the server.
Run:
uv run test_weather_sse.pyWhat happens:
Starts
server/weather_sse.pyin the background (listens on port 8000)Waits for the server to be ready
Connects to
http://127.0.0.1:8000/sseRuns one query
Terminates the server process
Case 4: Run Weather Server Manually (SSE)
Run the weather server as a standalone HTTP process. Useful for debugging or when multiple clients need to connect.
Run:
# Terminal 1: Start the server
uv run server/weather_sse.pyThen in another terminal, use a client configured with url: "http://127.0.0.1:8000/sse" (e.g., test_weather_sse.py or a custom client with weather_sse_config.json).
Case 6: Run Weather Server Manually (STDIO)
Running the stdio server directly is rarely useful because it expects JSON-RPC on stdin. It's normally spawned by the client.
For debugging:
uv run server/weather.py
# Server waits for stdin; won't do anything useful without a clientProject Structure
MCP/
├── README.md # This file
├── .env # GroQ API key (create this)
├── pyproject.toml # Project dependencies
├── client_chatbot.py # Interactive chat client (stdio)
├── test_weather.py # Quick one-shot test (stdio)
├── test_weather_stdio.py # STDIO transport test
├── test_weather_sse.py # SSE transport test
├── server/
│ ├── weather.py # MCP server (STDIO transport)
│ ├── weather_sse.py # MCP server (SSE transport)
│ ├── weather_mcp.json # Default client config (stdio)
│ ├── weather_stdio_config.json
│ └── weather_sse_config.json
└── src/
└── app_mcp/
└── __init__.py # Package initMCP Tools Exposed
Tool | Description | Args |
| Get active weather alerts for a US state |
|
MCP Resources
URI | Description |
| Echo a message (for testing) |
Troubleshooting
"No module named 'mcp_use'"
Run uv sync to install dependencies, then use uv run for all scripts:
uv sync
uv run client_chatbot.py"ModuleNotFoundError: No module named 'httpx'"
Dependencies are in pyproject.toml. Run uv sync to install.
"qwen-qwq-32b has been decommissioned"
The project uses llama-3.3-70b-versatile. If you see references to qwen-qwq-32b, update the model in the client/test scripts.
"Connection closed" or "Invalid JSON"
Avoid printing to stdout from code that runs in the MCP server process. Stdio uses stdin/stdout for JSON-RPC; any extra output breaks the protocol.
Port 8000 already in use
Stop the process using port 8000, or change the port in server/weather_sse.py:
mcp = FastMCP("weather", host="127.0.0.1", port=8001)Then update SSE_SERVER_PORT in test_weather_sse.py and the URL in weather_sse_config.json.
Sandbox / uv cache errors
Run with full permissions if you see "Operation not permitted" for uv cache:
uv run client_chatbot.py # may need to run outside sandboxAvailable Tools
1 toolget_alertsA
MCP Tool: Get active weather alerts for a US state.
This tool is exposed to MCP clients and can be invoked by AI agents. It fetches from the NWS API and returns formatted alert information.
Args: state: Two-letter US state code (e.g. CA, NY, TX)
Returns: Formatted string of all active alerts, or a message if none found
| 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?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the data source ('NWS API') and that it 'returns formatted alert information', which adds some context. However, it lacks details on error handling, rate limits, authentication needs, or what 'formatted' specifically entails, leaving gaps in behavioral understanding.
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?
The description is well-structured and front-loaded with the core purpose in the first sentence. Each subsequent sentence adds value without redundancy, such as specifying the API source and return format. There is no wasted text, making it efficient and easy to parse.
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?
Given the tool's moderate complexity (single parameter, no annotations, but with an output schema), the description is reasonably complete. It explains the purpose, parameter, and return behavior. The presence of an output schema means the description doesn't need to detail return values, but it could benefit from more behavioral context like error handling or usage constraints.
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?
The input schema has 0% description coverage, but the description compensates by explaining the 'state' parameter as 'Two-letter US state code (e.g. CA, NY, TX)', which adds crucial semantic context not present in the schema. This effectively documents the single parameter, though it doesn't cover edge cases or validation rules.
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?
The description clearly states the tool's purpose with specific verb ('Get'), resource ('active weather alerts'), and scope ('for a US state'). It distinguishes itself by specifying the data source ('NWS API') and the geographic limitation, making the purpose unambiguous even without sibling tools for comparison.
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?
The description implies usage context by mentioning 'active weather alerts' and 'US state', suggesting it should be used when such alerts are needed. However, there are no explicit guidelines on when to use this tool versus alternatives, nor any mention of prerequisites or exclusions, leaving the agent to infer appropriate usage scenarios.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
With only one tool, there is no possibility of ambiguity or overlap between tools. The tool's purpose is clearly defined and distinct by default.
A single tool inherently follows a consistent naming pattern. The tool name 'get_alerts' uses a verb_noun structure, which is clear and appropriate for its function.
A single tool is too few for a weather server's apparent scope, which typically includes forecasts, current conditions, and alerts. This feels thin and limits functionality, though it is focused on one specific task.
The tool set is severely incomplete for a weather domain, covering only alerts for US states. Obvious gaps include lack of forecast retrieval, current weather data, international support, or historical data, which will cause agent failures in broader weather-related tasks.
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
US weather alerts from NWS: warnings, watches, advisories by state. $0.01/query.
US weather & geo for AI agents: forecasts, alerts, earthquakes, elevation, geocoding. No keys.
Get US weather forecasts, active alerts, and current observations.
Active weather alerts and warnings from the National Weather Service
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI models to fetch weather alerts and detailed forecasts for US locations using the National Weather Service API.80GPL 3.0
- FlicenseNot gradedqualityDmaintenanceA lightweight AI agent that fetches real-time weather alerts for any U.S. state using the National Weather Service API.
- -licenseBqualityDmaintenanceEnables users to retrieve current weather alerts for US states and detailed weather forecasts by geographic coordinates using the US National Weather Service API. Built with Node.js and TypeScript following Model Context Protocol standards for seamless LLM integration.2
- FlicenseAqualityDmaintenanceProvides real-time weather alerts for US states using the National Weather Service API, enabling users to fetch and view active weather warnings through natural language queries.11
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/arunm8489/MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server