National Parks Mcp Server

io.github.cyanheads由 GitHub 账号 cyanheads 发布v0.3.0更新于 Oct 29, 2026

Plan US National Park Service trips — parks, alerts, campgrounds, things to do, events.

已验证Streamable HTTP可网页运行位置与生活网页搜索与抓取

概览

AI 生成的概览

规划美国国家公园管理局行程:查询公园、查看警报与关闭信息,并查找营地、活动与活动日程(数据来自 NPS Data API)。

可以做什么
  • 按地名、州或自由文本查询公园并取得 parkCode
  • 一次读取最多十个公园的详情:门票费用、开放时间、联系方式、交通指引、天气概述与图片
  • 按类别与时间查看某公园或全州的最新警报、危险与关闭信息
  • 查找营地,含设施、营位数、费用与预订说明
  • 浏览精选活动与景点,以及指定日期范围内的活动日程
适用场景
适合在规划美国国家公园、纪念地、历史遗址或海滨景点行程时使用,可一次取得公园信息、当前关闭情况、露营选择、可做之事与活动日期。仅覆盖 NPS 管辖地点,不含州立公园、林务局或土地管理局土地。
运行要求
可作为公开托管端点使用,也可通过 npx(Node.js)或 Docker 在本地运行。需要免费的 NPS Data API 密钥,放在 NPS_API_KEY 中,缺少时服务器无法启动。其余可选设置包括传输方式、HTTP 主机/端口/路径、认证模式与日志级别。
安装前请注意
NPS_API_KEY 是凭据,会以 X-Api-Key 请求头发送,请勿写入共享配置。服务器对 NPS 数据只读,但警报与活动信息时效性强,出行前应再次确认。部分返回的图片与素材带有第三方权利,NPS Arrowhead 标志受限制使用。

安装

在 SourceWeft 中

  1. 打开 控制台中的 National Parks Mcp Server,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.cyanheads%2Fnational-parks-mcp-server/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "national-parks": {
      "type": "http",
      "url": "https://national-parks.caseyjhand.com/mcp"
    }
  }
}

README

@cyanheads/national-parks-mcp-server

Plan US National Park Service trips — find parks, check alerts and closures, find campgrounds, browse things to do and events via the NPS Data API. STDIO or Streamable HTTP.

6 Tools • 1 Skill


Overview

Plan a National Park Service trip: find a park, check alerts and closures, and browse campgrounds, activities, and events. Covers national parks, monuments, historic sites, and seashores, not state parks, Forest Service, or BLM land.

Tools

ToolDescription
nps_find_parksResolve a place name, US state, or free-text query to parks — the required first step. Returns each park's parkCode plus a trip-planning summary.
nps_get_parkFull detail for up to ten parks in one batched call: description, activities, fees & passes, hours, contacts, directions, weather overview, images.
nps_get_alertsCurrent alerts for a park or state — closures, hazards, caution, information — with category and recency surfaced first.
nps_find_campgroundsCampgrounds at a park or state: amenities, reservable vs. first-come site counts, reservation info, accessibility, and fees.
nps_get_activitiesCurated things to do and points of interest: title, duration, location, accessibility, and fee/pet/reservation flags.
nps_find_eventsScheduled events within a date range: dates/times, location, category, fee, and registration links.

Capability reference

nps_find_parks tool

  • Free-text query, two-letter stateCode (or a comma-separated list such as "WY,MT,ID"), and an optional activity filter; limit 1–50 (default 10) with a start offset
  • Each park carries its parkCode plus designation, states, description, coordinates, headline activities, lowest entrance fee, and NPS page; exact parkCode or name matches rank first, and totalCount counts every match

nps_get_park tool

  • Up to 10 parkCodes per call; the optional fields selector (activities, topics, fees, hours, contacts, directions, images) trims the payload to the sections you need
  • Always returns name, designation, states, description, coordinates, weather overview, and NPS page; fees and passes by category, hours by area and season, contacts, and up to 5 images (imagesTruncated when the park has more)
  • Codes that match no site come back as missingCodes; the call fails (no_parks_found) only when none resolve

nps_get_alerts tool

  • Filter by parkCode, stateCode, free-text query, and category (Danger, Caution, Information, Park Closure); limit 1–50 (default 20) with a start offset
  • Most-recent-first, each alert with its category, lastIndexedDate recency, and detail; categoryBreakdown counts the returned alerts by severity
  • The notice tells an all-clear (no alerts at that location) apart from a filter that matched nothing and a page past the end

nps_find_campgrounds tool

  • Filter by parkCode, stateCode, or free-text query; limit 1–50 (default 15) with a start offset
  • Per campground: amenities (potable water, showers, dump station, toilets, trash collection, RV access) as yes, no, or unknown; reservable, first-come, and total site counts; reservation guidance and booking URL; lowest fee, accessibility, coordinates, and NPS page

nps_get_activities tool

  • A single parkCode or a single stateCode is required, plus an optional query; limit 1–50 (default 15) with a start offset
  • Per activity: title, short description, time commitment, location, coordinates, accessibility, season, reservation-required and pets-permitted flags, fee description, and NPS page

nps_find_events tool

  • Filter by parkCode, stateCode, or query within a dateStart / dateEnd window (YYYY-MM-DD); pages by pageNumber and pageSize (1–50, default 15), not by offset
  • Per event: title, date range, occurrenceDates inside the window (isRecurring marks a series), time slots, location, category, fee, and registration and info URLs
  • Errors NPS reports alongside results fold into the notice instead of failing the call

Features

Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.

NPS-specific:

  • One service wrapping the NPS Data API (developer.nps.gov/api/v1, X-Api-Key auth) across six trip-planning endpoints
  • Aggressive normalization of NPS's inconsistent payloads — numeric and boolean fields returned as strings, nested values (campsites.totalSites), array-typed amenity fields, and the distinct /events envelope with lowercased field names — coerced to clean domain types before they reach handlers
  • nps_get_park batches up to ten park codes into a single upstream request
  • Light retry on transient upstream failures (5xx / network); a missing or invalid key fails loud and names NPS_API_KEY
  • Coordinates returned by nps_find_parks / nps_get_park feed weather servers (nws-weather, open-meteo) for a forecast

Agent-friendly output:

  • Visit-planning guidance — the published national-parks-guide skill checks park identity, access, reservation evidence, and event dates. It ships with plugins, npm, Docker, and MCPB, and MCP clients discover it through the Skills extension (skill://national-parks-guide/SKILL.md).
  • Result-set context on every response — totalCount, truncation (truncated / shown / cap), applied-filter echo, and empty-result notices reach both the structured and text surfaces
  • Many parks list no campgrounds, curated activities, or events; an empty result comes back with a notice on where else to look, never as an error
  • The parkCode-first workflow is encoded in every tool description; nps_get_park returns missingCodes so a wrong code self-corrects
  • Uncertainty preserved, never fabricated — missing coordinates, directions, fees, and amenity values come back null, not a guess; coordinates are never invented for downstream weather lookups

Getting started

Connect to the hosted instance, no install:

sh
claude mcp add --transport http national-parks-mcp-server https://national-parks.caseyjhand.com/mcp

Or run it locally:

sh
claude mcp add national-parks-mcp-server -e NPS_API_KEY=your-key -- npx -y @cyanheads/national-parks-mcp-server

For other clients, add this to the MCP config file:

json
{  "mcpServers": {    "national-parks-mcp-server": {      "command": "npx",      "args": ["-y", "@cyanheads/national-parks-mcp-server"],      "env": {        "NPS_API_KEY": "your-api-key"      }    }  }}

Get a free NPS Data API key. For Docker or a source build, see Running the server.

Configuration

All configuration is validated at startup via Zod schemas. Key environment variables:

VariableDescriptionDefault
NPS_API_KEYRequired. NPS Data API key, sent as the X-Api-Key header. The server fails to start without it.—
NPS_BASE_URLNPS Data API base URL override (testing / proxy).https://developer.nps.gov/api/v1
MCP_TRANSPORT_TYPETransport: stdio or http.stdio
MCP_HTTP_PORTPort for the HTTP server.3010
MCP_HTTP_ENDPOINT_PATHPath where the MCP server is mounted./mcp
MCP_SESSION_MODESession handling: auto, stateful, or stateless. The schema default auto resolves to stateful; this server sets stateless explicitly. MCP 2026-07-28 is sessionless in either mode.stateless
MCP_AUTH_MODEAuth mode: none, jwt, or oauth.none
MCP_LOG_LEVELLog level (RFC 5424).info
LOGS_DIRDirectory for log files (Node.js only).<project-root>/logs
LOG_TOOL_FAILURE_PAYLOADSLog each failed tool call's arguments and result, redacted by key name and capped at LOG_TOOL_FAILURE_PAYLOAD_MAX_BYTES (default 16384). A secret inside a free-form value is not redacted.false
STORAGE_PROVIDER_TYPEStorage backend: in-memory, filesystem, supabase, cloudflare-kv/r2/d1.in-memory
OTEL_ENABLEDEnable OpenTelemetry instrumentation (spans, metrics, completion logs).false

See .env.example for the full list of optional overrides.

Running the server

Local development

Requires Bun v1.4 or higher (or Node.js v24+) and an NPS Data API key.

  • Clone and install:

    sh
    git clone https://github.com/cyanheads/national-parks-mcp-server.gitcd national-parks-mcp-server && bun installcp .env.example .env   # set NPS_API_KEY
  • Build and run:

    sh
    # One-time buildbun run rebuild
    # Run the built serverbun run start:stdio# orbun run start:http
  • Run checks and tests:

    sh
    bun run devcheck   # Lint, format, typecheck, securitybun run test       # Vitest test suitebun run lint:mcp   # Validate MCP definitions against spec

Docker

sh
docker run --rm -e NPS_API_KEY=your-key -p 3010:3010 ghcr.io/cyanheads/national-parks-mcp-server:latest

The image defaults to HTTP transport, stateless session mode, and logs to /var/log/national-parks-mcp-server. To run over stdio, use docker run -i --rm -e MCP_TRANSPORT_TYPE=stdio -e NPS_API_KEY=your-key ghcr.io/cyanheads/national-parks-mcp-server:latest. Build locally with docker build -t national-parks-mcp-server .; OpenTelemetry peers are installed by default — add --build-arg OTEL_ENABLED=false to omit them.

Project structure

DirectoryPurpose
src/index.tscreateApp() entry point — registers the six tools and inits the NPS service.
src/configServer-specific environment variable parsing and validation with Zod.
src/mcp-server/toolsTool definitions (*.tool.ts).
src/services/npsNPS Data API service — HTTP client, retry boundary, error-envelope detection, and all upstream normalization.
skills/Published visit-planning guidance for agents using the tools, also served over MCP.
framework-skills/Development guidance synced from the framework.
tests/Unit and integration tests mirroring src/.

Development guide

See AGENTS.md / CLAUDE.md for development guidelines and architectural rules. The short version:

  • Handlers throw, framework catches — no try/catch in tool logic
  • Use ctx.log for request-scoped logging, ctx.state for tenant-scoped storage
  • Register new tools in the createApp() arrays
  • Wrap the external API: validate raw → normalize to domain type → return output schema; never fabricate missing fields

Data & attribution

Data is retrieved from the NPS Data API operated by the U.S. National Park Service. Content produced by NPS employees in their official capacity is a U.S. Government work in the public domain (17 U.S.C. §§ 101 and 105). No claim to original U.S. Government works.

Not all content returned by the API is government-authored. Some images and materials carry third-party copyright or other restrictions — check individual item rights before reuse.

The NPS Arrowhead symbol is a restricted mark protected under 18 U.S.C. § 701. It must not be reproduced or reused without written permission from the NPS Director.

Contributing

Issues are welcome. Run checks and tests before submitting:

sh
bun run devcheckbun run test

License

Apache-2.0 — see LICENSE for details.

来源:README.md,提交 8ea0231

工具

6

nps_find_parks

national-parks-mcp-server: find parks

Resolve a place name, US state, or free-text query to National Park Service parks — the required first step before the detail tools. Returns each park's parkCode (the key nps_get_park, nps_get_alerts, nps_find_campgrounds, nps_get_activities, and nps_find_events all use) plus a compact trip-planning summary (designation, states, description, coordinates, headline activities, entrance fee, NPS page). Coverage is US NPS sites only — national parks, monuments, historic sites, seashores — not state parks and not Forest Service or BLM land.

输入参数limitquerystartactivitystateCode

nps_get_park

national-parks-mcp-server: get park detail

Full trip-planning detail for one or more parks by parkCode: description, activities and topics, entrance fees and passes, operating hours by area/season, contacts, directions, a free-text weather overview, representative images, and the NPS page for everything else. Get codes from nps_find_parks. Accepts up to ten codes per call. Use the fields parameter to return only the sections you need.

输入参数fieldsparkCode必填

nps_get_alerts

national-parks-mcp-server: get alerts

Current alerts for a park or a whole state — closures, hazards, caution notices, and information — with category and recency surfaced first so "is anything closed at Glacier right now?" is answered at a glance. Get park codes from nps_find_parks, or pass a stateCode for a statewide "what's closed" sweep. Returns most-recent-first. An empty result with totalCount 0 means no active alerts match the request (with category or query set, alerts outside that filter may still be active); an empty page with a non-zero totalCount means start ran past the end of the matches. Closures and road conditions change daily.

输入参数limitquerystartcategoryparkCodestateCode

nps_find_campgrounds

national-parks-mcp-server: find campgrounds

Campgrounds at a park or across a state: amenities (potable water, showers, RV dump station, toilets, trash collection, RV access), reservable vs. first-come-first-served site counts, reservation guidance and booking URL, accessibility, and fees. Check the linked campground page for RV hookups and date-specific availability. Get park codes from nps_find_parks. Some parks list lodging or backcountry permits instead of NPS-managed campgrounds; an empty result is not an error.

输入参数limitquerystartparkCodestateCode

nps_get_activities

national-parks-mcp-server: get activities

Curated things to do and points of interest at a park — title, description, time commitment, location, accessibility, and fee/pet/reservation flags — answering "what should I do at Acadia?" Covers the NPS editorially-curated activity list (distinct from a park's raw activity tags in nps_get_park). Accepts a single 4-letter park code or a single two-letter state code, and at least one is required. Not every park has a curated list; an empty result is not an error.

输入参数limitquerystartparkCodestateCode

nps_find_events

national-parks-mcp-server: find events

Scheduled events at a park within a date range — ranger programs, festivals, tours, interpretive events — answering "what's happening at Yellowstone this weekend?" with title, dates and times, location, category, fee, and registration links. Get park codes from nps_find_parks. Paginates by page number, not offset. Many parks list few or no events; an empty result is not an error.

输入参数querydateEndpageSizeparkCodedateStartstateCodepageNumber

版本历史

6
  1. v0.3.0最新Oct 29, 2026
  2. v0.2.2Oct 25, 2026
  3. v0.2.1Oct 9, 2026
  4. v0.2.0Sep 24, 2026
  5. v0.1.7Sep 20, 2026
  6. v0.1.6Sep 16, 2026

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分