MCP Weather 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., "@MCP Weather Serverget 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.
MCP Weather Server (Node.js)
This repository contains a fully-featured MCP (Model Context Protocol) server built with Node.js and TypeScript that exposes weather-related tools using the US National Weather Service API.
Table of Contents
Overview
This MCP server provides two main tools:
get_alerts- Retrieve current weather alerts for any US state (by two-letter state code)get_forecast- Get detailed weather forecast by geographic coordinates
It follows the Model Context Protocol standards to be compatible with clients such as Claude for Desktop and allows seamless LLM-driven interactions.
Features
Typed requests and responses using
zodschemas for argument validationAsynchronous API requests with error handling
Modular tool definitions for scalable code architecture
Environment variable configuration for flexible deployments
Integration-ready with popular MCP client tools and MCP Inspector for debugging
Tech Stack
Node.js (v18+)
TypeScript
Zod for schema validations
httpxornode-fetchfor HTTP requestsdotenv for environment configuration
MCP SDK (JavaScript/TypeScript)
Optional: ts-node or build with
tsc
Getting Started
Prerequisites
Node.js 18 or higher
npm or yarn
Available Tools
2 toolsget_alertsC
Get weather alerts for a state
| Name | Required | Description | Default |
|---|---|---|---|
| state | Yes | Two-letter state code (e.g. CA, NY) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but doesn't mention any behavioral traits such as rate limits, authentication needs, response format, or error handling. For a tool with zero annotation coverage, this is a significant gap in transparency.
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 a single, clear sentence that directly states the tool's purpose without any unnecessary words. It is appropriately sized and front-loaded, 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 lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., alert types, severity levels, timeframes) or any behavioral context needed for effective use, which is insufficient for a tool with no structured support.
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 100% description coverage, fully documenting the single parameter 'state' with its format and constraints. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline score of 3 for high schema coverage.
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 verb ('Get') and resource ('weather alerts for a state'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from the sibling tool 'get_forecast', which likely provides different weather data, so it misses full sibling distinction.
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 provides no guidance on when to use this tool versus alternatives like 'get_forecast'. It lacks any context about prerequisites, exclusions, or comparative use cases, leaving the agent to infer usage based on tool names alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_forecastC
Get weather forecast for a location
| Name | Required | Description | Default |
|---|---|---|---|
| latitude | Yes | Latitude of the location | |
| longitude | Yes | Longitude of the location |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but lacks critical details like whether this is a read-only operation, potential rate limits, authentication requirements, or what the forecast output includes (e.g., time range, weather elements).
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 a single, efficient sentence that directly states the tool's function without unnecessary words. It's appropriately sized and front-loaded with the core purpose.
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?
For a tool with no annotations and no output schema, the description is insufficient. It doesn't explain what the forecast returns (e.g., temperature, precipitation, timeframe), behavioral constraints, or how it differs from the sibling tool, leaving significant gaps in understanding.
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?
Schema description coverage is 100%, with both parameters clearly documented in the schema. The description adds no additional parameter information beyond implying location-based input, so it meets the baseline score when the schema does the heavy lifting.
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 verb 'Get' and resource 'weather forecast for a location', making the purpose immediately understandable. However, it doesn't explicitly differentiate from the sibling tool 'get_alerts', which likely serves a related but distinct function in weather data retrieval.
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 provides no guidance on when to use this tool versus the sibling 'get_alerts'. There's no mention of prerequisites, alternatives, or specific contexts where this tool is preferred, leaving the agent without usage direction.
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
v1.0.0- First observed
get_alerts - First observed
get_forecast
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: get_alerts retrieves weather alerts for a state, while get_forecast provides weather forecasts for a location. There is no overlap or ambiguity between them, making it easy for an agent to select the correct tool based on the need for alerts versus forecasts.
Both tools follow a consistent verb_noun pattern with 'get_' prefix and descriptive nouns (alerts, forecast). This naming convention is predictable and readable, ensuring clarity and ease of use across the tool set.
With only 2 tools, the server feels under-scoped for a weather domain, as it lacks essential operations like current conditions, historical data, or radar information. While the tools are well-defined, the count is too low to provide comprehensive coverage for typical weather-related tasks.
The tool surface is significantly incomplete for a weather server. It includes alerts and forecasts but misses core functionalities such as current weather conditions, historical data, or location-based searches. This will likely cause agent failures when handling broader weather queries.
Maintenance
Related MCP Connectors
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.
Get US weather forecasts, active alerts, and current observations.
US weather alerts (NWS): warnings, watches. $0.01/query. Register in-session — free testnet funds.