U.S. National Parks MCP Server: Alerts and Trails
Explore U.S. National Parks on the MCP server for latest alerts, park details, visitor centers, campgrounds, trails, and events.
npx -y @KyrieTangSheng/mcp-server-nationalparksOverview
This MCP (Model Context Protocol) server exposes curated data about U.S. National Parks — alerts, park metadata, visitor centers, campgrounds, trails, and scheduled events — in a lightweight API suitable for integration with generative AI agents, chat assistants, trip planners, or monitoring dashboards. It implements a predictable, REST-style surface that can act as a context provider to models or other services that need up‑to‑date park information.
The project is open source (GitHub: https://github.com/KyrieTangSheng/mcp-server-nationalparks) and is designed for developers who want an easy-to-run local or containerized data provider. Typical uses include supplying context tokens for LLMs, driving UI widgets in mobile/web apps, and feeding automated alerting systems for park administrators and visitors.
Features
- Exposes park-level metadata (name, description, location, entrance fees, hours)
- Provides current alerts and advisory messages for parks
- Lists visitor centers and campground details (amenities, coordinates)
- Publishes trail information (length, difficulty, status) and event schedules
- Simple REST endpoints with predictable resource names for easy consumption
- Ready for local development and Docker deployment
- Designed to be used as a Model Context Protocol (MCP) resource provider
Installation / Configuration
Prerequisites:
- Node.js >= 14 (or Docker)
- Git
Clone and install:
Environment configuration (.env example):
PORT=8080
NODE_ENV=development
# Optional: if the project supports an upstream NPS API or external dataset
# NPS_API_KEY=your_nps_api_key_here
# DATA_SOURCE can be "local" (default) or "nps"
DATA_SOURCE=local
Start the server:
# development
# production
Docker (build and run):
If the repository includes a docker-compose file:
Available Tools / Resources
The server exposes REST endpoints intended for programmatic consumption. Below is a concise reference of common routes and their purpose.
| Path | Method | Description | Query/Path Params |
|---|---|---|---|
| /parks | GET | List parks (paginated) | ?page=&limit=&state= |
| /parks/{parkCode} | GET | Park details by park code | parkCode (path) |
| /alerts | GET | Recent alerts across parks | ?parkCode=&severity= |
| /parks/{parkCode}/alerts | GET | Alerts for a single park | parkCode (path) |
| /parks/{parkCode}/trails | GET | Trails for a park | parkCode (path), ?maxLength= |
| /campgrounds | GET | Campgrounds list | ?parkCode= |
| /visitor-centers | GET | Visitor centers list | ?parkCode= |
| /events | GET | Upcoming events | ?parkCode=&start=&end= |
Example alert response (abbreviated):
Authentication: If the server is configured to use an upstream API key or user authentication, configure those credentials in the .env file. Otherwise local/dev mode typically runs without authentication.
Use Cases
- LLM context provider: Attach recent park alerts and trail conditions as context for a conversational agent answering visitor safety questions. Example: fetch /parks/yell and /parks/yell/alerts before generating a hiking recommendation.
- Trip planning app: Populate a mobile itinerary by fetching parks, campgrounds, and events. Example flow:
- GET /parks?state=UT
- GET /parks/{parkCode}/trails
- GET /parks/{parkCode}/campgrounds
- Alerting/monitoring system: Poll /alerts or /parks/{parkCode}/alerts on a schedule; trigger email/SMS when severity=“Critical”.
- Mapping and visualization: Use the trails and visitor-centers endpoints to render trailheads and points of interest on an interactive map.
- Data enrichment for search: Index the parks and events endpoints into a search engine (Elasticsearch/Algolia) to provide fast lookup and faceted search.
Quick Examples
Fetch all parks (curl):
Fetch trails for a park:
Fetch active alerts across parks:
Notes for Developers
- The API is intentionally simple to make it easy to use from server-side code, edge functions, or within an agent pipeline feeding context to models.
- Check the repository README and code for configuration options related to data sources (local JSON fixtures vs remote NPS API) and any available sample data.
- If you plan to deploy to production, add appropriate authentication, rate limiting, and update-checking cadence for upstream data feeds.
For code, issues, and contribution instructions, see the project repository: https://github.com/KyrieTangSheng/mcp-server-nationalparks