国家公园数据助手
便于使用国家公园管理局(NPS)API检索国家公园服务数据,允许用户按州列出国家公园并获取特定公园的详细信息。
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"nps": {
"args": [
"/\u003cPath to Server\u003e/build/index.js"
],
"command": "node",
"env": {
"API_KEY": "Your NPS API Key"
}
}
}
}
该服务需要配置环境变量:API_KEY
服务介绍
国家公园服务数据的MCP服务器
此MCP服务器提供了一个接口来检索国家公园服务(NPS)的数据。它允许用户:
- 获取给定美国州内的国家公园列表。
- 获取特定国家公园的详细信息。
它使用国家公园服务API来获取数据。
要求
- Node.js (推荐v18及以上版本)
- npm 或 yarn
- 有效的NPS API密钥(可从https://www.nps.gov/subjects/developer/get-started.htm获取)
- 安装了Claude Desktop(用于运行MCP服务器)
设置
-
克隆此仓库:
git clone <repository-url> cd <repository-folder> -
安装依赖项:
npm install -
在根目录下创建一个
.env文件,并添加您的NPS API密钥:API_KEY=your_nps_api_key_here
运行服务器
要启动MCP服务器:
npm run build
node ./build/server.js
使用Claude Desktop:
- 将此MCP服务器添加到
claude_desktop_config.json中
{
"mcpServers": {
"nps": {
"command": "node",
"args": [
"/<Path to Server>/build/index.js"
],
"env": {
"API_KEY": "Your NPS API Key"
}
}
}
}
- 启动或重启Claude Desktop
- 确保您的MCP服务器被识别并正在运行,通过点击Claude聊天窗口底部的工具图标。
- 使用Claude的界面查询国家公园服务数据。
API端点
按州获取国家公园列表
工具名称: park-list
参数:
stateCode(字符串) – 两字母的美国州代码
响应示例:
[
{
"fullName": "Yellowstone National Park",
"description": "First national park in the U.S.",
"parkCode": "yell"
}
]
获取国家公园详情
工具名称: park-details
参数:
parkCode(字符串) – 国家公园查找代码
响应示例:
[
{
"fullName": "Yellowstone National Park",
"description": "First national park in the U.S.",
"states": "WY, MT, ID"
}
]
提示
检索州内公园
提示名称: parks-by-state
参数:
stateCode(字符串)
示例:
What National Parks are in the state of CA?
获取公园详情
提示名称: details-for-park
参数:
park(字符串)
示例:
Give me details about Yellowstone National Park.
注意:原文中的#0, #1, #2, #3, #4, #5标记似乎是指向具体实现或示例的位置占位符,在这里保持不变。如果这些标记对应具体的代码或配置示例,请根据实际情况替换它们。