Skip to main content
Glama
SandroSD

MCP Weather Server

by SandroSD

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 zod schemas for argument validation

  • Asynchronous 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

  • httpx or node-fetch for HTTP requests

  • dotenv 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 tools
get_alertsB

Get weather alerts for a state

ParametersJSON Schema
NameRequiredDescriptionDefault
stateYesTwo-letter state code (e.g. CA, NY)

TDQS

B3.1/5.0
Behavior2/5

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 mentions 'get' which implies a read operation, but doesn't specify whether this requires authentication, has rate limits, returns real-time or historical data, or what format the alerts come in. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that communicates the core functionality without unnecessary words. It's appropriately sized for a simple tool with one parameter and gets straight to the point.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read operation with one well-documented parameter and no output schema, the description is minimally adequate. However, the lack of annotations means the description should do more to explain behavioral aspects, and the absence of sibling differentiation is a notable gap given the related 'get_forecast' tool exists.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 100% description coverage, with the single parameter 'state' clearly documented as a two-letter code. The description adds no additional parameter information beyond what the schema provides, so it meets the baseline for high schema coverage but doesn't enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

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') with a specific scope ('for a state'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from its sibling tool 'get_forecast', which appears to be related but serves a different function (forecasts vs alerts).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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 its sibling 'get_forecast', nor does it mention any prerequisites, limitations, or alternative scenarios. It simply states what the tool does without contextual usage information.

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

ParametersJSON Schema
NameRequiredDescriptionDefault
latitudeYesLatitude of the location
longitudeYesLongitude of the location

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves forecasts but doesn't describe what data is returned (e.g., temperature, precipitation), format, rate limits, error conditions, or whether it's a read-only operation. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

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 is appropriately sized for a simple tool and front-loaded with the core purpose, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (simple retrieval) but lack of annotations and output schema, the description is incomplete. It doesn't explain what forecast data is returned, potential limitations (e.g., supported locations), or how to interpret results. For a tool with no structured output information, the description should provide more context about the return values.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, clearly documenting both latitude and longitude parameters with their constraints. The description adds no additional parameter semantics beyond what the schema provides, such as examples of valid locations or coordinate systems. With high schema coverage, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

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 a specific verb ('Get') and resource ('weather forecast for a location'). It distinguishes the tool's function from its sibling 'get_alerts', which likely retrieves weather alerts rather than forecasts. However, it doesn't specify the forecast timeframe (e.g., current, hourly, daily), leaving some ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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 its sibling 'get_alerts'. It doesn't mention any prerequisites, alternatives, or contextual constraints. The agent must infer usage based on tool names alone, which is insufficient for optimal selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

B3.1/5.0
Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count2/5

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.

Completeness2/5

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

ActivityInactive
ResponsivenessSyncing

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

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/SandroSD/MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server