Skip to main content
Glama
akaramanapp

Weather MCP Server

by akaramanapp

Weather MCP Server

A Model Context Protocol (MCP) server that provides weather information and alerts for US locations using the National Weather Service (NWS) API. This server is designed to be used by AI agents through the Model Context Protocol.

Features

  • Tool for getting weather alerts for any US state

  • Tool for getting detailed weather forecasts for any US location using coordinates

  • Supports temperature, wind conditions, and short forecast descriptions

  • Real-time data from the National Weather Service

Related MCP server: Weather MCP Server

Prerequisites

  • Node.js (v16 or higher)

  • npm or yarn package manager

Installation

  1. Clone the repository:

git clone https://github.com/akaramanapp/weather-mcp-server.git
cd weather-mcp-server
  1. Install dependencies:

npm install
  1. Build the application:

npm run build

MCP Tools

The server provides two MCP tools that can be used by AI agents:

get-alerts

Get weather alerts for a specific US state.

Parameters:

  • state: Two-letter state code (e.g., CA, NY)

Example response:

{
  "content": [
    {
      "type": "text",
      "text": "Active alerts for CA: ..."
    }
  ]
}

get-forecast

Get weather forecast for a specific location using coordinates.

Parameters:

  • latitude: Latitude of the location (-90 to 90)

  • longitude: Longitude of the location (-180 to 180)

Example response:

{
  "content": [
    {
      "type": "text",
      "text": "Morning: Temperature: 72°F, Wind: 5mph NW, Partly cloudy..."
    }
  ]
}

Project Structure

weather/
├── src/
│   └── index.ts    # Main server code with MCP tool implementations
├── build/          # Compiled JavaScript files
├── package.json    # Project dependencies and scripts
└── tsconfig.json   # TypeScript configuration

Technical Details

  • Built with TypeScript

  • Implements Model Context Protocol (MCP) server

  • Uses @modelcontextprotocol/sdk for MCP server implementation

  • Interfaces with the National Weather Service (NWS) API

  • ES2022 target with Node16 module resolution

Development

To modify or extend the server:

  1. Make changes in the src/index.ts file

  2. Rebuild the application:

npm run build

Dependencies

  • @modelcontextprotocol/sdk: MCP server implementation framework

  • zod: Runtime type checking and validation for tool parameters

  • TypeScript: Development dependency for type safety

License

ISC

Notes

  • This server only works for US locations as it uses the National Weather Service API

  • API requests are rate-limited and require a User-Agent header

  • All coordinates should be in decimal degrees format

  • This is not a standalone CLI application, but rather a server that provides tools for AI agents through the Model Context Protocol

Available Tools

2 tools
get-alertsC

Get weather alerts for a state

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

TDQS

C2.9/5.0
Behavior2/5

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 'Get weather alerts' which implies a read-only operation, but doesn't specify whether this requires authentication, has rate limits, what format the alerts are returned in, or any error conditions. For a tool with zero annotation coverage, this is insufficient.

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 states the core functionality without any wasted words. It's appropriately sized for this simple tool and gets straight to the point.

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 lack of annotations and output schema, the description should provide more context about what the tool returns and its behavioral characteristics. A simple 'Get weather alerts for a state' is inadequate for a tool that presumably returns structured alert data. The agent needs more information about the nature of the response.

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 description coverage is 100%, with the single parameter 'state' fully documented in the schema. The description doesn't add any additional parameter semantics beyond what's already in the schema (which specifies it's a two-letter state code). This meets the baseline of 3 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.

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 the resource 'weather alerts for a state', making the purpose immediately understandable. However, it doesn't differentiate from the sibling tool 'get-forecast' (which presumably provides weather forecasts rather than alerts), so it doesn't reach the highest score of 5.

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 the sibling 'get-forecast' or any other alternatives. It states what the tool does but offers no context about appropriate use cases, prerequisites, or exclusions.

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?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't mention any behavioral traits such as rate limits, authentication requirements, data freshness, error handling, or what the forecast includes (e.g., temperature, precipitation). This leaves significant gaps in understanding how the tool behaves beyond its basic function.

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, clear sentence with zero waste. It's front-loaded with the core purpose and appropriately sized for a simple tool, 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 lack of annotations and output schema, the description is incomplete. It doesn't cover behavioral aspects like rate limits or auth, and it doesn't explain what the forecast returns (e.g., format, time range). For a tool with no structured support beyond the input schema, more context is needed to guide effective usage.

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 description coverage is 100%, with both parameters (latitude and longitude) well-documented in the schema. The description adds no additional meaning beyond what the schema provides, such as explaining coordinate systems or units. Since the schema does the heavy lifting, 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 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 might also provide weather-related information but for alerts specifically.

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 the sibling 'get-alerts'. It lacks any context about alternatives, prerequisites, or specific scenarios where this tool is appropriate, leaving the agent to infer usage based on the tool name alone.

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 in functionality, and an agent can easily differentiate between them based on their specific use cases.

Naming Consistency5/5

Both tools follow a consistent verb_noun naming pattern with hyphens (get-alerts and get-forecast). This uniformity makes the tool set predictable and easy to understand, with no deviations in style or convention.

Tool Count2/5

With only two tools, the server feels thin for a weather domain, as it lacks essential operations like getting 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 set is severely incomplete for a weather server, missing core functionalities such as current weather, historical data, and radar or satellite imagery. Agents will face significant gaps when trying to perform common weather queries, leading to potential failures in broader tasks.

Maintenance

ActivityInactive
ResponsivenessNo issues

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

Related MCP Servers

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/akaramanapp/weather-mcp-server'

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