Skip to main content
Glama

weather — Enhanced MCP Weather Server

A feature-rich MCP (Model Context Protocol) server that provides comprehensive weather data using the NWS (National Weather Service) public APIs. Includes input validation, error handling, geocoding, and a unique weather comparison feature.

Quick start

  1. Install uv (macOS / Linux):

curl -LsSf https://astral.sh/uv/install.sh | sh
# restart your terminal
  1. Create project, venv and install deps:

uv init weather
cd weather
uv venv
source .venv/bin/activate
uv add "mcp[cli]" httpx
  1. Run the server:

uv run main.py
# or
uv run weather.py

Related MCP server: weather-mcp

Available Tools

The server provides the following MCP tools:

1. get_alerts(state: str)

Get active weather alerts for a US state.

  • Input: Two-letter US state code (e.g., "CA", "NY", "TX")

  • Features: Validates state codes, provides detailed alert information

2. get_forecast(latitude: float, longitude: float)

Get detailed weather forecast for a location using coordinates.

  • Input: Latitude (-90 to 90) and Longitude (-180 to 180)

  • Features: 10-period forecast (5 days), includes humidity and precipitation probability

3. get_forecast_by_city(city_name: str)

Get weather forecast by city name (no coordinates needed!).

  • Input: City name (e.g., "San Francisco", "New York", "Chicago")

  • Features: Automatic geocoding, works with city names

4. get_current_conditions(latitude: float, longitude: float)

Get real-time current weather conditions.

  • Input: Latitude and Longitude

  • Features: Temperature, humidity, wind, pressure, visibility, and more

5. compare_weather(location1: str, location2: str)

Compare weather conditions between two locations side-by-side.

  • Input: Two locations (city names or "lat,lon" format)

  • Features: Side-by-side comparison, temperature difference analysis, supports both city names and coordinates

Features

  • Input Validation: Validates state codes and coordinate ranges

  • Better Error Handling: Specific, helpful error messages

  • Geocoding Support: Search by city name using Open-Meteo geocoding API

  • Current Conditions: Real-time weather observations

  • Enhanced Forecasts: More detailed information including humidity and precipitation

  • Weather Comparison: Unique feature to compare two locations

  • Location Detection: Automatically detects and displays city/state names

Files

  • weather.py — Main MCP server implementation with all tools

  • main.py — Entry point that imports and runs the server

Notes

  • Python 3.11+ required (see pyproject.toml)

  • NWS Coverage: The NWS API only covers US territories. International locations will not work.

  • Transport: The server uses stdio transport by default

  • MCP Clients: Use Claude Desktop, mcp CLI, or another MCP client to connect

  • Geocoding: City name search uses Open-Meteo's free geocoding API (no API key required)

Example Usage

Once connected to an MCP client, you can use the tools like:

# Get alerts for California
get_alerts("CA")

# Get forecast by city name
get_forecast_by_city("San Francisco")

# Get current conditions
get_current_conditions(37.7749, -122.4194)

# Compare weather between two cities
compare_weather("New York", "Los Angeles")

License

Apache License 2.0 — see LICENSE. Replace the placeholder year/name in LICENSE if needed.


Available Tools

5 tools
compare_weatherA

Compare current weather conditions between two locations.

This unique feature allows you to compare weather at two different places side-by-side.

Args:
    location1: First location (city name or "lat,lon" format, e.g., "New York" or "40.7128,-74.0060")
    location2: Second location (city name or "lat,lon" format, e.g., "Los Angeles" or "34.0522,-118.2437")
ParametersJSON Schema
NameRequiredDescriptionDefault
location1Yes
location2Yes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the tool's behavior (comparison of current conditions) and input format, but lacks details on rate limits, error handling, or response structure. It doesn't contradict annotations, but could be more comprehensive.

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 appropriately sized and front-loaded: the first sentence states the core purpose, followed by a reinforcing statement, then parameter details. Every sentence adds value with no redundancy or waste.

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?

Given the tool's moderate complexity (2 parameters, no annotations, but has output schema), the description is mostly complete: it covers purpose, usage, and parameters well. However, it could benefit from mentioning the output schema's existence or high-level return format for better context.

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

Parameters5/5

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

The schema description coverage is 0%, so the description fully compensates by explaining both parameters (location1 and location2) with clear semantics, examples, and format details ('city name or "lat,lon" format'). This adds significant value beyond the bare schema.

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 specific action ('compare current weather conditions') and resource ('between two locations'), distinguishing it from siblings like get_current_conditions (single location) or get_forecast (future predictions). The phrase 'side-by-side' reinforces the comparative nature.

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 usage context by specifying 'current weather conditions' and 'two locations', suggesting when to use this tool (for comparison) versus siblings that handle single locations or forecasts. However, it doesn't explicitly state when not to use it or name alternatives.

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

get_alertsB

Get weather alerts for a US state.

Args:
    state: Two-letter US state code (e.g. CA, NY, TX)
ParametersJSON Schema
NameRequiredDescriptionDefault
stateYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.2/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 weather alerts but doesn't cover critical aspects like whether it's a read-only operation, potential rate limits, authentication needs, or what happens if the state code is invalid. This leaves significant gaps in understanding the tool's 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 front-loaded with the core purpose in the first sentence, followed by a concise parameter explanation. Every sentence earns its place by providing essential information without redundancy, making it efficient and well-structured for quick comprehension.

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?

Given the tool's low complexity (one parameter) and the presence of an output schema (which handles return values), the description is somewhat complete but lacks depth. It covers the basic purpose and parameter semantics but misses behavioral details and usage guidelines, which are important for a tool with no annotations to guide the agent effectively.

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

Parameters4/5

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

The description adds meaningful context for the single parameter 'state' by specifying it as a 'Two-letter US state code' with examples (e.g., CA, NY, TX), which compensates for the 0% schema description coverage. This clarifies the parameter's format and expected values beyond what the bare schema provides.

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 alerts for a US state'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_current_conditions' or 'get_forecast', which might also provide weather-related data but for different aspects.

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 alternatives. It doesn't mention sibling tools like 'compare_weather' or 'get_forecast', nor does it specify scenarios where weather alerts are preferred over other weather data, leaving the agent to infer usage context without explicit direction.

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

get_current_conditionsB

Get current weather conditions for a location.

Args:
    latitude: Latitude of the location (-90 to 90)
    longitude: Longitude of the location (-180 to 180)
ParametersJSON Schema
NameRequiredDescriptionDefault
latitudeYes
longitudeYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.1/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 'Get[s] current weather conditions' but doesn't mention behavioral traits such as rate limits, authentication needs, error handling, or what the output contains. This leaves significant gaps for a tool that likely interacts with an external API.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded, with the purpose stated clearly in the first sentence and parameter details following. It avoids unnecessary fluff, though the formatting with 'Args:' could be slightly more polished for readability.

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?

Given the tool's moderate complexity (2 required parameters, no annotations, but with an output schema), the description is minimally adequate. It covers the purpose and parameter ranges but lacks behavioral context and usage guidelines. The presence of an output schema means return values don't need explanation, but other gaps remain.

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

Parameters4/5

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

The description adds meaningful context beyond the input schema by specifying valid ranges for latitude (-90 to 90) and longitude (-180 to 180), which aren't covered in the schema (0% description coverage). This compensates well for the schema's lack of detail, though it doesn't explain parameter interactions or units.

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 ('current weather conditions for a location'), making it easy to understand what it does. However, it doesn't explicitly differentiate from sibling tools like 'get_forecast' or 'get_forecast_by_city', which prevents a perfect score.

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 alternatives like 'get_forecast' or 'get_forecast_by_city'. It lacks context about use cases, prerequisites, or exclusions, leaving the agent to infer usage from 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.

get_forecastB

Get weather forecast for a location using coordinates.

Args:
    latitude: Latitude of the location (-90 to 90)
    longitude: Longitude of the location (-180 to 180)
ParametersJSON Schema
NameRequiredDescriptionDefault
latitudeYes
longitudeYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.1/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 gets a forecast but doesn't cover key aspects like whether it's read-only, what data format is returned, potential rate limits, error handling, or authentication needs. This leaves significant gaps in understanding the tool's behavior beyond basic functionality.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded, with the core purpose stated first followed by parameter details. It avoids unnecessary fluff, but the parameter explanations could be slightly more integrated into the flow rather than listed as 'Args:'.

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?

Given the tool's moderate complexity (2 required parameters) and the presence of an output schema, the description is partially complete. It covers the purpose and parameters adequately but lacks usage guidelines and behavioral details. The output schema mitigates the need to describe return values, but other gaps remain.

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

Parameters4/5

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

The description adds meaningful context beyond the input schema, which has 0% description coverage. It specifies that latitude ranges from -90 to 90 and longitude from -180 to 180, clarifying valid coordinate ranges that aren't in the schema. However, it doesn't explain units (e.g., degrees) or precision, leaving minor gaps.

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: 'Get weather forecast for a location using coordinates.' It specifies the verb ('Get'), resource ('weather forecast'), and method ('using coordinates'), which is specific and actionable. However, it doesn't explicitly differentiate from sibling tools like 'get_forecast_by_city' or 'get_current_conditions', keeping it from a perfect score.

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 alternatives. It doesn't mention sibling tools like 'get_forecast_by_city' (which might use city names instead of coordinates) or 'get_current_conditions' (which might provide current rather than forecasted weather), leaving the agent without context for tool selection.

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

get_forecast_by_cityB

Get weather forecast for a city by name.

Args:
    city_name: Name of the city (e.g., "San Francisco", "New York", "Chicago")
ParametersJSON Schema
NameRequiredDescriptionDefault
city_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

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 the full burden of behavioral disclosure. It states what the tool does but provides no information about rate limits, authentication requirements, error conditions, response format, or whether this is a read-only operation. The description doesn't mention what time period the forecast covers or any other behavioral characteristics.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded with the core purpose in the first sentence. The parameter documentation is structured clearly with an 'Args:' section. There's minimal waste, though the formatting could be slightly more polished.

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?

Given the tool has an output schema (which handles return values), the description covers the basic purpose and parameter semantics adequately. However, for a weather forecasting tool with no annotations, it should ideally mention more about what the forecast includes (e.g., temperature, precipitation, timeframe) and any limitations (e.g., city name ambiguity, supported regions).

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

Parameters4/5

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

The description adds significant value beyond the input schema, which has 0% description coverage. It explains the 'city_name' parameter with examples ('San Francisco', 'New York', 'Chicago'), clarifying the expected format and providing concrete usage guidance. This compensates well for the schema's lack of documentation.

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 city by name'). It distinguishes from some siblings like 'get_alerts' and 'get_current_conditions' by specifying it's for forecasts, but doesn't explicitly differentiate from 'get_forecast' which appears to be a similar tool.

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 alternatives. It doesn't mention when to choose this over 'get_forecast' (the most obvious sibling) or other weather-related tools like 'get_current_conditions' or 'compare_weather'. There's no context about prerequisites, limitations, or appropriate use cases.

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. Dates show when Glama detected each change.

  1. 5 tool updatesv1.0.0
    • Addedcompare_weather
    • Changedget_alerts1 field changed
      • addedInput schema / title
        Added value: +"get_alertsArguments"
    • Addedget_current_conditions
    • Changedget_forecast1 field changed
      • addedInput schema / title
        Added value: +"get_forecastArguments"
    • Addedget_forecast_by_city
  2. 2 tool updates
    • First observedget_alerts
    • First observedget_forecast

TDQS

A3.5/5.0
Disambiguation3/5

Most tools have distinct purposes, but there is notable overlap between get_forecast and get_forecast_by_city, which both provide forecasts but use different input formats (coordinates vs. city name). This could cause confusion for an agent deciding which to use. The other tools (compare_weather, get_alerts, get_current_conditions) are clearly distinct.

Naming Consistency4/5

The naming follows a consistent verb_noun pattern (e.g., get_forecast, get_alerts, get_current_conditions), with all tools using snake_case. The only minor deviation is compare_weather, which uses a verb_noun format but starts with 'compare' instead of 'get', which is reasonable given its distinct function.

Tool Count5/5

With 5 tools, the count is well-scoped for a weather server, covering key functions like current conditions, forecasts, alerts, and comparisons. Each tool serves a clear purpose without being overly sparse or bloated, fitting typical expectations for such a domain.

Completeness4/5

The tool set covers core weather operations effectively, including current conditions, forecasts, alerts, and comparisons. A minor gap is the lack of historical weather data or more specialized features like air quality, but agents can work around this for most common use cases without significant failures.

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/zayedansari2/MCP_WeatherServer'

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