Skip to main content
Glama
VasimHayat

mcp-weather-service

by VasimHayat

mcp-weather-service

An MCP server that gives an AI assistant live weather data. It speaks JSON-RPC over stdio — there is no HTTP port and nothing to open in a browser. An MCP client (Claude Desktop, Claude Code, the MCP Inspector) spawns the process and talks to it over the pipe.

Tools

Tool

Description

Source

get_current_weather

Current conditions for any location worldwide

OpenWeather

get_forecast

5-day forecast, collapsed to one line per local day

OpenWeather

get_alerts

Active alerts for a US state (two-letter code)

US National Weather Service

get_current_weather and get_forecast accept either a location name ("Tokyo", "Paris,FR") or explicit latitude/longitude, plus an optional units of metric (default) or imperial.

get_alerts is US-only and needs no API key — the NWS API is public. Alerts come from NWS rather than OpenWeather because OpenWeather only exposes them on the paid One Call 3.0 plan.

Related MCP server: Weather MCP Server

Prerequisites

Setup

npm install
npm run build

build/ is gitignored, so a fresh clone must run npm run build before the server will start.

Configuration

The key is read from the OPENWEATHER_API_KEY environment variable and is never hardcoded.

Note that the MCP SDK does not pass your shell environment to the server it spawns — on Windows it copies only an allowlist (PATH, APPDATA, TEMP, …). Setting the variable in your terminal is therefore not enough for MCP clients; it must be handed over explicitly via an env block or the -e flag.

Copy the template and fill in your key:

cp mcp.example.json mcp.json

mcp.json is gitignored — keep your real key out of version control.

Running it

MCP Inspector

npm run inspect

Serves a web UI at http://localhost:6274. Open the URL including the MCP_INSPECTOR_API_TOKEN query parameter it prints; the token changes on every launch.

--config replaces the server command rather than supplementing it — passing both a config file and node build/index.js is an error.

For a one-shot check with no browser:

npx @modelcontextprotocol/inspector --cli --config mcp.json --server weather \
  --method tools/call --tool-name get_current_weather --tool-arg location=Tokyo

In --cli mode the server command must come before any flags. Leading with -e yields a misleading No servers found in config file.

Claude Desktop

Add the server to claude_desktop_config.json:

  • Windows%APPDATA%\Claude\claude_desktop_config.json

  • macOS~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "weather": {
      "command": "node",
      "args": ["/absolute/path/to/weather-mcp/build/index.js"],
      "env": { "OPENWEATHER_API_KEY": "your-key-here" }
    }
  }
}

Use an absolute path for args. On Windows, prefer an absolute path to node.exe (e.g. C:\\Program Files\\nodejs\\node.exe) — Claude Desktop launches outside your shell, and a bare node failing to resolve is the most common reason the server never appears.

Restart Claude Desktop fully afterward (File → Exit — it stays in the tray, so closing the window does not reload the config), then ask "What's the weather in Tokyo?"

Server logs land in %APPDATA%\Claude\logs\mcp-server-weather.log.

Claude Code

claude mcp add weather -e OPENWEATHER_API_KEY=your-key-here -- node /absolute/path/to/weather-mcp/build/index.js

Scripts

Script

Action

npm run build

Compile TypeScript to build/

npm start

Run the server directly on stdio

npm run inspect

Launch the MCP Inspector against mcp.json

There is no watch mode: MCP clients execute build/index.js, so run npm run build after every change to src/ or you will keep testing stale code.

Project layout

src/index.ts        server, tool definitions, API clients
build/index.js      compiled output (gitignored)
mcp.example.json    config template — copy to mcp.json

License

ISC

Available Tools

3 tools
get_alertsA

Get active weather alerts for a US state. Only supports United States locations.

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

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations available, the description carries the full burden. It discloses that the tool is limited to US locations and returns 'active' alerts, which adds context. However, it does not describe the output format, error behavior, or what constitutes 'active,' so transparency is partial.

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 highly concise, consisting of two short sentences that communicate purpose and limitation with zero wasted words. It is well-structured and front-loaded with the core action.

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

Completeness4/5

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

For a simple one-parameter, read-only tool, the description provides the essential context: what it does and a key limitation. It lacks guidance relative to sibling tools, but the tool is simple enough that the description is mostly complete.

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?

Schema description coverage is 100%, with the parameter 'state' already described in the schema. The tool description adds no additional parameter semantics beyond what the schema provides, so baseline 3 is appropriate.

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

Purpose5/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: 'Get active weather alerts for a US state.' It uses a specific verb ('get') and resource ('active weather alerts') with a geographic scope, distinguishing it from sibling tools like get_current_weather and get_forecast.

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 does not provide guidance on when to use this tool versus alternatives. It only mentions a constraint ('Only supports United States locations'), but no explicit when-to-use or when-not-to-use instructions are given.

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

get_current_weatherB

Get the current weather conditions for any location worldwide, by city name or coordinates

ParametersJSON Schema
NameRequiredDescriptionDefault
unitsNometric = °C and m/s (default), imperial = °F and mph
latitudeNoLatitude, used only when no location name is given
locationNoCity name, optionally with country/state code. Examples: "Tokyo", "Paris,FR", "Springfield,US-IL". Preferred over coordinates.
longitudeNoLongitude, used only when no location name is given

TDQS

B3.3/5.0
Behavior2/5

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

With no annotations, the description must carry the full burden of behavioral disclosure. It only restates the purpose and input methods, without mentioning return format, default units, error behavior, or the fact that this is a read-only operation. No additional behavioral context is added beyond what the schema already implies.

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, well-structured sentence that is front-loaded with the primary action and resource. It contains no filler, unnecessary qualifiers, or repetition, earning a perfect score for conciseness.

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?

The tool is relatively simple with 4 optional parameters all documented in the schema, but the description does not explain what 'current weather conditions' includes in the response, nor does it nod to sibling tools for differentiation. It is minimally complete for a straightforward read operation, but it lacks a clearer sense of the overall context.

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?

Schema description coverage is 100%, so a baseline of 3 is appropriate. The description adds a small amount of context by linking 'city name' to the location parameter and 'coordinates' to latitude/longitude, but it does not clarify precedence (e.g., location is preferred) or units behavior, which are already in the schema, so no significant extra value.

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 uses a specific verb ('Get') and identifies the resource ('current weather conditions'), while also specifying scope ('any location worldwide') and method ('by city name or coordinates'). It implicitly distinguishes from siblings like get_forecast by focusing on 'current' conditions, but does not explicitly name alternatives, so it loses a point for lack of direct sibling differentiation.

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

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context with 'any location worldwide' and 'current weather', but it provides no explicit when-to-use or when-not-to-use guidance, nor does it reference sibling tools like get_forecast or get_alerts. This gives a general sense of applicability but falls short of clear alternatives or exclusions.

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

get_forecastA

Get a 5-day weather forecast for any location worldwide, by city name or coordinates

ParametersJSON Schema
NameRequiredDescriptionDefault
unitsNometric = °C and m/s (default), imperial = °F and mph
latitudeNoLatitude, used only when no location name is given
locationNoCity name, optionally with country/state code. Examples: "Tokyo", "Paris,FR", "Springfield,US-IL". Preferred over coordinates.
longitudeNoLongitude, used only when no location name is given

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the burden of behavioral disclosure. It states the output is a 5-day forecast and supports city/coordinate input, but does not disclose unit defaults, precedence rules, or potential errors; the schema fills some gaps, so a 3 is a fair baseline.

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 12-word sentence that is entirely information-bearing, with no filler. It front-loads the action and outcome, making it maximally concise.

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

Completeness4/5

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

The tool is simple enough that this one-sentence description plus a well-described schema is adequate. It does not explain return data structure, but an output schema is not present and the forecast format is likely conventional. Sibling differentiation is absent but not critical here.

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 covers 100% of parameters with detailed descriptions including defaults and constraints, so the description adds little beyond naming the two lookup modes. The baseline of 3 is appropriate because the schema already does the heavy lifting.

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

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool returns a 5-day weather forecast using the verb 'get' and resource 'forecast', and specifies both the geographic scope ('any location worldwide') and input methods ('by city name or coordinates'). This distinguishes it from sibling tools like get_current_weather and get_alerts.

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

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is for multi-day forecasting, and the sibling names suggest alternatives for current conditions and alerts. However, it does not explicitly state when to prefer this tool over others or mention exclusions, so a 4 is appropriate.

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.

  1. 3 tool updatesv1.0.0
    • First observedget_alerts
    • First observedget_current_weather
    • First observedget_forecast

TDQS

A4/5.0

Scored across 3 tools

Disambiguation5/5

Each tool addresses a distinct weather data need: current conditions, forecast, and alerts. There is no overlap or ambiguity between them.

Naming Consistency5/5

All tool names follow a consistent 'get_<resource>' pattern using snake_case, making them predictable and easy to understand.

Tool Count5/5

With only 3 tools, the server is tightly scoped and covers the essential weather service needs without unnecessary bloat.

Completeness5/5

The tool set provides comprehensive coverage of core weather information: current conditions, forecast, and alerts. There are no obvious missing operations for a basic weather service.

Maintenance

ActivitySlowing
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

  • F
    license
    B
    quality
    D
    maintenance
    An MCP server that provides weather information and alerts for US locations using the National Weather Service API, enabling retrieval of weather forecasts and active weather alerts.
    2
    -
  • F
    license
    B
    quality
    D
    maintenance
    An MCP server providing US National Weather Service data with tools to fetch weather alerts by state and forecasts by coordinates.
    2
    -
  • F
    license
    C
    quality
    D
    maintenance
    An MCP server that provides weather alerts and forecasts using the National Weather Service API, with additional system tools for shell commands and process information.
    4
    3
    -