SNOTEL MCP Server

SNOTEL MCP Server

Provides access to real-time and historical snow conditions, weather data, and snowpack analysis from over 800 SNOTEL stations across the western United States through the USDA Air and Water Database API.

Category
访问服务器

README

SNOTEL MCP Server

A Model Context Protocol (MCP) server built with FastMCP for accessing USDA SNOTEL (SNOwpack TELemetry) weather and snow data through the AWDB (Air and Water Database) REST API.

This server provides AI assistants like Claude with access to real-time and historical snow conditions, weather data, and snowpack analysis from over 800 SNOTEL stations across the western United States.

Features

🏔️ Station Discovery

  • Find by State: Get all SNOTEL stations in any state
  • Find by Location: Search for stations within a radius of coordinates
  • Station Details: Access comprehensive station metadata

📊 Data Access

  • Historical Data: Retrieve snow depth, SWE, temperature, and precipitation
  • Recent Conditions: Get latest readings and recent trends
  • Custom Date Ranges: Query any time period with daily resolution

📈 Analysis Tools

  • Snowpack Trends: Analyze peak conditions and seasonal patterns
  • Storm Tracking: Identify snowfall events and accumulations
  • Statistical Summaries: Calculate averages, maximums, and snow day counts

Quick Start

Prerequisites

  • Python 3.9+
  • uv package manager (recommended) or pip

Installation

# Clone the repository
git clone https://github.com/example/snotel-mcp-server.git
cd snotel-mcp-server

# Create and activate virtual environment with uv
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install dependencies
uv pip install -e .

# Or install development dependencies
uv pip install -e ".[dev]"

Running the Server

FastMCP handles all transport configuration automatically:

# Run with default stdio transport
python -m snotel_mcp_server

# Or if installed
snotel-mcp-server

Usage with Claude Desktop

Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "snotel": {
      "command": "python",
      "args": ["-m", "snotel_mcp_server"],
      "cwd": "/path/to/snotel-mcp-server"
    }
  }
}

Or if installed via pip:

{
  "mcpServers": {
    "snotel": {
      "command": "snotel-mcp-server"
    }
  }
}

Available Tools

find_snotel_stations

Find SNOTEL stations by state or geographic location.

Parameters:

  • state (optional): State abbreviation (e.g., "CO", "MT")
  • latitude (optional): Latitude for location search
  • longitude (optional): Longitude for location search
  • radius_miles (optional): Search radius in miles (default: 50)
  • network (optional): Network type (default: "SNTL")

Examples:

Find all SNOTEL stations in Colorado
Find SNOTEL stations within 25 miles of Aspen, Colorado (39.1911, -106.8175)

get_station_info

Get detailed information about a specific SNOTEL station.

Parameters:

  • station_triplet (required): Station identifier (e.g., "713:CO:SNTL")

Example:

Get information about Red Mountain Pass station (713:CO:SNTL)

get_station_data

Retrieve raw snow and weather data from a station in JSON format.

Parameters:

  • station_triplet (required): Station identifier
  • start_date (required): Start date (YYYY-MM-DD)
  • end_date (required): End date (YYYY-MM-DD)
  • elements (optional): Data types ["SNWD", "WTEQ", "TOBS", "PREC"]
  • duration_name (optional): Duration of measurements ["DAILY", "HOURLY", "MONTHLY"]

Returns: Raw JSON data from the SNOTEL API

Examples:

Get raw JSON data from Red Mountain Pass for March 2025
Get hourly temperature data from Wolf Creek Pass for a specific day
Get monthly averages for a station over a year

get_recent_conditions

Get recent conditions from a station (last 30 days by default).

Parameters:

  • station_triplet (required): Station identifier
  • days (optional): Number of recent days (default: 30)

Example:

What are current conditions at Loveland Pass?
Show me the last 14 days of data from Independence Pass

analyze_snowpack_trends

Analyze snowpack trends and calculate statistics for a time period.

Parameters:

  • station_triplet (required): Station identifier
  • start_date (required): Analysis start date
  • end_date (required): Analysis end date

Examples:

Analyze snowpack trends at Wolf Creek for the 2024-2025 season
Compare peak snow conditions between March 2024 and March 2025 at Red Mountain Pass

Example Conversations

Finding Stations

User: "Find SNOTEL stations near Aspen, Colorado"
Assistant: I'll find SNOTEL stations near Aspen for you.

[Uses find_snotel_stations with coordinates for Aspen]

Found 5 SNOTEL stations within 50 miles of Aspen:
• Independence Pass (589:CO:SNTL) - 12,095 ft
• Grizzly Peak (457:CO:SNTL) - 11,900 ft  
• Schofield Pass (737:CO:SNTL) - 10,707 ft
...

Getting Current Conditions

User: "What are current snow conditions at Red Mountain Pass?"
Assistant: I'll check the current conditions at Red Mountain Pass.

[Uses get_recent_conditions for station 713:CO:SNTL]

Recent Conditions: Red Mountain Pass (713:CO:SNTL)
Latest Reading: 2025-05-26
• Snow Depth: 21.0"
• Snow Water Equivalent: 8.2"
• Temperature: 29.3°F

Analyzing Trends

User: "How did March 2025 compare to typical March conditions at Wolf Creek?"
Assistant: I'll analyze March 2025 snowpack trends at Wolf Creek.

[Uses analyze_snowpack_trends for March 2025]

March 2025 Analysis:
• Peak Depth: 156" on March 15th
• Total New Snow: 67"
• Snow Days: 12
• Above average snowfall for March

Data Elements

The server supports these common SNOTEL measurements:

  • SNWD: Snow depth (inches)
  • WTEQ: Snow water equivalent (inches)
  • TOBS: Observed air temperature (°F)
  • PREC: Precipitation increment (inches)
  • TMAX: Maximum air temperature (°F)
  • TMIN: Minimum air temperature (°F)

API Reference

The server connects to the USDA AWDB REST API:

  • Base URL: https://wcc.sc.egov.usda.gov/awdbRestApi
  • Documentation: Swagger UI
  • Rate Limits: Be respectful with API usage

Development

Project Structure

snotel-mcp-server/
├── src/
│   └── snotel_mcp_server/
│       ├── __init__.py     # FastMCP server implementation
│       └── __main__.py     # Module entry point
├── pyproject.toml          # Project configuration
├── requirements.txt        # Dependencies
├── README.md               # This file
├── tests/                  # Test files
│   └── test_tools.py       # MCP tool tests
└── examples/               # Usage examples
    └── example_usage.py    # Example usage

Running Tests

# Install development dependencies
uv pip install -e ".[dev]"
# Or install from requirements.txt
pip install pytest pytest-asyncio pytest-cov

# Run tests
pytest

# Run with coverage (requires pytest-cov)
pytest --cov=src/snotel_mcp_server tests/

# Run specific test file
pytest tests/test_tools.py -v

Code Quality

# Format code
black snotel_mcp_server.py
isort snotel_mcp_server.py

# Lint code
ruff check snotel_mcp_server.py

# Type checking
mypy snotel_mcp_server.py

Configuration

Environment Variables

  • AWDB_API_BASE: Override default API base URL
  • AWDB_TIMEOUT: Request timeout in seconds (default: 30)

Logging

The server supports configurable logging levels. Set the log level via environment variable:

# Show API requests and responses (recommended for debugging)
LOGLEVEL=INFO python -m snotel_mcp_server

# Show detailed debug information
LOGLEVEL=DEBUG python -m snotel_mcp_server

# Show only warnings and errors (default)
LOGLEVEL=WARNING python -m snotel_mcp_server

Log Levels:

  • DEBUG: Most verbose, shows all internal operations
  • INFO: Shows API requests, responses, and general operations
  • WARNING: Shows only warnings and errors (default)
  • ERROR: Shows only errors

Troubleshooting

Common Issues

Connection Errors

  • Check internet connectivity to USDA servers
  • Verify API endpoint is accessible
  • Check for proxy/firewall restrictions

No Data Returned

  • Verify station triplet format (e.g., "713:CO:SNTL")
  • Check date ranges are valid
  • Some stations may have data gaps

Station Not Found

  • Use find_snotel_stations to verify station exists
  • Check state abbreviation is correct
  • Ensure station is active

Debug Mode

Enable detailed logging to see all API requests:

LOGLEVEL=INFO python -m snotel_mcp_server

For maximum verbosity:

LOGLEVEL=DEBUG python -m snotel_mcp_server

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Related Projects

Acknowledgments

  • USDA Natural Resources Conservation Service for providing the SNOTEL network and API
  • Anthropic for creating the Model Context Protocol
  • The open source community for the underlying tools and libraries

Happy Snow Tracking! 🎿❄️

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选