NIFC MCP服务器
 ](package.json) 
一个模型上下文协议(MCP)服务器,为应急响应、火灾管理和公众意识提升提供国家机构间消防中心(NIFC)的野火事件数据访问。
注: 这个项目目前正处于规划和文件编制阶段。实施(src/ (目录)尚未创建。请参阅 实施计划 用于制定发展路线图。概述
这个MCP服务器与NIFC数据服务集成,提供实时和历史火灾事件信息。服务器对数据进行格式化处理,以符合所使用的火灾信息架构 火灾行为 应用程序。
什么是NIFC?
国家跨机构消防中心(NIFC)是位于爱达荷州博伊西的国家野外灭火支持中心。NIFC负责协调灭火资源,并提供全美范围内活跃野火的相关数据。
NIFC提供:
- 实时火灾数据所有活跃野火的实时信息
- 事件信息火灾名称、地点、规模及控制情况的详细信息
- 周长数据GIS火灾周边范围多边形
- InciWeb公共事件信息门户
- IRWIN(艾润)野火信息综合报告系统
- 历史数据过去的火灾事件及统计数据
关键数据点:
- 火灾位置(坐标、县、州)
- 火灾规模(英亩)
- 所含百分比
- 发现日期和时间
- 事件状态(活跃、受控、结束)
- 原因(如已知)
- 分配的资源
- 疏散和关闭
特点/功能
- 按位置、州或全国范围获取活跃的野火事件
- 获取详细的事件信息(规模、控制情况、资源)
- 获取火灾周边数据(GeoJSON多边形)
- 在坐标半径范围内搜索火灾
- 访问历史火灾数据
- 将数据格式化为符合wildfire_prompt_template.json模式的格式
- 来自NIFC数据源的实时更新
- 与InciWeb集成以获取详细的事件叙述
它是如何工作的
NIFC MCP服务器作为Claude(或其他MCP客户端)与NIFC数据服务之间的桥梁:
- “Fire Query”可以翻译为“执行查询”或“发起查询”你问克劳德(Claude)关于特定地区的野火情况
- 数据检索服务器从NIFC API获取活动事件
- 位置过滤根据邻近关系或行政边界过滤火灾
- 富集如果可用,添加周边数据和InciWeb详细信息
- 模式转换将数据格式化为标准化的野火数据模式
- 回应返回结构化的火灾事件信息
安装
先决条件: Node.js 18.0.0 或更高版本
# Clone the repository
git clone https://github.com/tyson-swetnam/nifc-mcp.git
cd nifc-mcp
# Install dependencies
npm install
# Configure environment variables
cp .env.example .env
# Edit .env if needed (most NIFC APIs are public)配置
MCP服务器配置
在您的Claude桌面配置中添加:
- macOS(苹果电脑操作系统):
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"nifc": {
"command": "node",
"args": ["/absolute/path/to/nifc-mcp/src/index.js"]
}
}
}重要提示: 使用绝对路径来 src/index.js,而不是相对路径。
可选配置
创建一个 .env 用于高级配置的文件:
# Server Configuration
LOG_LEVEL=info
CACHE_TTL_SECONDS=300 # 5 minutes (active fire data updates frequently)
# Data Source Configuration
ENABLE_PERIMETER_DATA=true
ENABLE_INCIWEB_INTEGRATION=true
# Feature Flags
INCLUDE_HISTORICAL_FIRES=true
MAX_FIRES_PER_QUERY=100使用方法
启动服务器
# Start the MCP server
npm start
# Or start with auto-reload for development
npm run dev示例查询
一旦配置好Claude Desktop,您就可以询问:
- “加利福尼亚州目前有哪些野火在燃烧?”
- “显示科罗拉多州博尔德市50英里范围内的活跃火点”
- “了解克里克火灾的详细信息”
- “俄勒冈州的火灾控制情况如何?”
- “北纬40.0°,西经105.2°附近有没有火灾?”
- “列出所有超过1万英亩的火灾”
可用工具
1. 获取活跃火点
获取当前活跃的野火事件。
参数:
state(字符串,可选):州缩写(例如,“CA”,“CO”)latitude(数字,可选):用于附近搜索的纬度longitude(数字,可选):用于附近搜索的经度radius_miles(数字,可选):搜索半径,单位为英里(默认:50)min_size_acres(数字,可选):最小火灾规模过滤器limit(数字,可选):最大结果数(默认:50)
示例请求:
{
"state": "CA",
"min_size_acres": 1000,
"limit": 10
}示例回复:
{
"fires": [
{
"incident_id": "2025-CASNF-001234",
"name": "Creek Fire",
"status": "Active",
"location": {
"latitude": 37.2345,
"longitude": -119.5678,
"county": "Fresno",
"state": "CA",
"unit": "Sierra National Forest"
},
"size_acres": 12458,
"containment_percent": 25,
"discovery_date": "2025-08-15T14:30:00Z",
"cause": "Lightning",
"resources": {
"personnel": 850,
"engines": 45,
"helicopters": 8,
"air_tankers": 3
},
"evacuations": true,
"structures_threatened": 450
}
],
"total_fires": 1,
"query_timestamp": "2025-08-29T14:00:00Z",
"data_sources": [
{
"name": "NIFC Active Fire Mapping",
"type": "wildfire",
"url": "https://data-nifc.opendata.arcgis.com/"
}
]
}2. 通过ID获取火源
获取特定火灾事件的详细信息。
参数:
incident_id(字符串,必填):NIFC 事件标识符include_perimeter(布尔值,可选):是否包含GeoJSON周边轮廓(默认:否)include_inciweb(布尔值,可选):是否包含InciWeb的叙述内容(默认:否)
示例请求:
{
"incident_id": "2025-CASNF-001234",
"include_perimeter": true,
"include_inciweb": true
}示例回复:
{
"incident_id": "2025-CASNF-001234",
"name": "Creek Fire",
"status": "Active",
"size_acres": 12458,
"containment_percent": 25,
"discovery_date": "2025-08-15T14:30:00Z",
"last_update": "2025-08-29T12:00:00Z",
"perimeter": {
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [[[-119.5, 37.2], [-119.4, 37.2], ...]]
},
"properties": {
"perimeter_date": "2025-08-29T08:00:00Z",
"source": "IR Mapping"
}
},
"inciweb": {
"url": "https://inciweb.nwcg.gov/incident/8765/",
"summary": "The Creek Fire is burning in steep, rugged terrain...",
"last_updated": "2025-08-29T10:00:00Z"
}
}3. 按位置搜索火灾
查找特定地点附近的火灾。
参数:
latitude(数字,必填):纬度(-90 至 90)longitude(数字,必填):经度(-180 至 180)radius_miles(数字,必填):搜索半径(英里)include_contained(布尔值,可选):是否包含内部火灾(默认:否)
示例请求:
{
"latitude": 40.0150,
"longitude": -105.2705,
"radius_miles": 100,
"include_contained": false
}示例回复:
{
"location": {
"latitude": 40.0150,
"longitude": -105.2705,
"search_radius_miles": 100
},
"fires_found": 3,
"fires": [
{
"incident_id": "2025-COHDF-000123",
"name": "Cameron Peak Fire",
"distance_miles": 25.3,
"bearing": "NW",
"size_acres": 8542,
"containment_percent": 45,
"status": "Active"
},
{
"incident_id": "2025-COHDF-000124",
"name": "East Troublesome Fire",
"distance_miles": 42.8,
"bearing": "W",
"size_acres": 15234,
"containment_percent": 15,
"status": "Active"
}
],
"warning": "Multiple active fires within 50 miles of your location"
}4. 获取火灾历史记录
检索某区域的历史火灾数据。
参数:
state(字符串,可选):州缩写county(字符串,可选):县名year(数字,可选):特定年份start_year(数字,可选):范围的起始年份end_year(数字,可选):范围的结束年份min_size_acres(数字,可选):最小火灾规模
示例请求:
{
"state": "CA",
"start_year": 2020,
"end_year": 2025,
"min_size_acres": 50000
}示例回复:
{
"state": "California",
"time_period": {
"start_year": 2020,
"end_year": 2025
},
"total_fires": 8,
"total_acres_burned": 1245678,
"fires": [
{
"incident_id": "2020-CABTF-000567",
"name": "August Complex",
"year": 2020,
"size_acres": 1032648,
"cause": "Lightning",
"start_date": "2020-08-16",
"contained_date": "2020-11-12"
}
],
"statistics": {
"largest_fire": {
"name": "August Complex",
"acres": 1032648,
"year": 2020
},
"average_size": 155709,
"fires_by_cause": {
"Lightning": 5,
"Human": 2,
"Unknown": 1
}
}
}数据模式(或数据架构)
服务器输出符合火灾行为的数据 wildfire_prompt_template.json 模式,特别是填充(或具体填充) wildfire_status 部分/章节。
野火状态架构:
{
"wildfire_status": {
"incident_id": "2025-CASNF-001234",
"name": "Creek Fire",
"status": "Active",
"acres": 12458,
"containment": "25%",
"start_time": "2025-08-15T14:30:00Z",
"expected_end": null
},
"risk_assessment": {
"overall_risk": "High",
"notes": "Active wildfire within 50 miles. Monitor conditions and be prepared for evacuations."
},
"data_sources": [
{
"name": "NIFC Active Fire Mapping",
"type": "wildfire",
"url": "https://data-nifc.opendata.arcgis.com/"
}
]
}见 数据模式文档 以获取完整的地图详情。
数据来源
这个MCP服务器连接到:
- NIFC ArcGIS 服务
- 网址:https://data-nifc.opendata.arcgis.com/ - 活跃火场边界 - 事件点 - 实时更新
- IRWIN(综合报告系统)
- 网址:https://irwin.doi.gov/ - 官方事件报告 - 详细的火焰属性
- InciWeb
- 网址:https://inciweb.nwcg.gov/ - 公共事件信息 - 叙事更新 - 疏散信息
- NIFC(国家集成火灾中心)情况报告
- 每日情况报告 - 全国火灾统计 - 资源分配数据
火灾状态等级
活跃火点
- 新最近发现(\<24小时)
- 成长积极传播,低遏制(或“低控制”)
- 活跃燃烧但处于可控状态
- 包含在周边区域建立了防火线
- 受控的无逃脱威胁,正在收尾清理
火灾复杂性等级
- 五型小火,消耗1-2资源
- 类型4中等火势,多个资源(或“多种资源”)
- 第三类延长攻势,全面组织
- 2型高复杂性,区域性资源
- 第一型最复杂的是,国家资源
与火灾行为的整合
NIFC数据对野火风险评估至关重要:
- 主动火灾探测识别附近活跃的火点
- 近距离警报当火灾发生在指定半径范围内时发出警告
- 状态追踪监控火势发展及控制进展
- 疏散意识提供疏散状态和道路封闭信息
- 资源信息显示已部署的消防资源
看 火灾行为综合指南 以获取详细的集成步骤。
常见用例
紧急意识
Query: "Are there any active fires near Boulder, Colorado?"
Response includes:
- All fires within specified radius
- Distance and bearing to each fire
- Size, containment, and growth trend
- Evacuation status
- Air quality impacts财产风险评估
Query: "What's the status of the fire threatening Yosemite?"
Response includes:
- Current fire size and containment
- Perimeter map data
- Structures threatened/destroyed
- Firefighting resources assigned
- Expected containment date历史分析
Query: "Show me major California wildfires from the last 5 years"
Response includes:
- List of fires meeting criteria
- Total acres burned
- Causes and patterns
- Comparison to historical averages故障排除
未发现火情
可能的原因:
- 查询区域内无活跃火点(好消息!)
- 搜索半径太小
- 州缩写错误
- 过滤条件过于严格(最小面积亩数过高)
解决方案:
- 增大搜索半径
- 检查州代码(使用“CA”而非“California”)
- 移除或降低过滤器
- 先尝试不使用过滤器进行查询
过时数据
NIFC数据更新因来源而异:
- 活跃火灾地点每15-30分钟更新一次
- 周长数据每日更新(早晚各一次)
- InciWeb故事叙述每日更新1-2次
检查一下 last_update 在回复中加入字段以验证数据的时效性。
缺失的周边数据
并非所有火灾都有周边数据:
- 非常小的火灾(\< 100英亩)往往缺乏周边界定
- 新发现的火灾可能尚未进行初步地图绘制
- 远程火灾可能延误了周边区域的测绘工作
使用 incident_point 位置作为备用选项。
发展
# Install dependencies
npm install
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Run linter
npm run lint
# Fix linting issues
npm run lint:fix
# Run in development mode with auto-reload
npm run dev见 \CONTRIBUTING.md\ 翻译成中文是:“贡献指南.md” 或 “贡献规范.md”。这个文件通常用于说明如何向项目贡献代码或内容,包括贡献的流程、规范、要求等 以获取详细开发指南。
项目结构
nifc-mcp/
├── src/
│ ├── index.js # MCP server entry point
│ ├── tools/ # MCP tool implementations
│ ├── api/ # API client modules
│ ├── schemas/ # Data validation schemas
│ └── utils/ # Helper functions
├── docs/
│ ├── architecture.md # System architecture
│ ├── implementation_plan.md
│ ├── data_schema.md # Schema mapping details
│ └── api_endpoints.md # External API documentation
├── tests/
│ ├── unit/
│ └── integration/
├── .env.example
├── package.json
├── CONTRIBUTING.md
└── README.md做出贡献
我们欢迎您的贡献!无论是修复漏洞、新增功能、改进文档,还是提供示例,您的帮助都将不胜感激。
见 \CONTRIBUTING.md\ 翻译为中文是:“贡献指南文件(Markdown 格式)”。这个文件通常用于说明如何向项目做出贡献,包括贡献的流程、规范、注意事项等 以获取详细指南。
许可证
Apache 2.0 - 详见LICENSE文件
文档
相关项目
- 火行为 - 野火信息接口
- raws-mcp 翻译为中文可以是“RAW格式的MCP(可能指某种配置或设置)”。不过,具体翻译可能需要根据上下文来确定“raws”和“mcp”在特定语境中的准确含义。如果“raws”是指未经处理的原始数据,“mcp”可能是一个特定领域或软件中的术语,那么翻译时可能需要保留这些专业术语或进行适当解释。但基于一般理解,上述翻译是一个较为通用的版本 - RAWS天气数据MCP服务器
- 干旱-MCP(注:MCP可能代表某种特定的术语或缩写,根据上下文可能需要具体翻译,此处保留原样) - 美国干旱监测多点并发(MCP)服务器
- 模型上下文协议 - MCP规范
致谢
- 数据源国家跨机构消防中心(NIFC)
- 伙伴美国农业部林业局,内政部,西北野火协调小组
- 模式/架构基于火灾行为应用的
wildfire_prompt_template.json - 映射数据ArcGIS Online,IRWIN公司,InciWeb(注:InciWeb是一个用于提供野外火灾信息的在线平台,由多个美国州政府和联邦机构合作开发,但在此处直接翻译为“野外火灾信息网”可能不够通用,因此保留原英文缩写)
支持
对于问题或疑问:
状态
这个项目目前正处于 规划与文档编制阶段核心实现正在开发中。请参阅 实施计划 用于时间线和里程碑。
数据更新频率
NIFC数据源以不同间隔进行更新:
- 活跃火点每15-30分钟
- 火场周边警戒线/火场边界每日2-3次(早晚各一次)
- 事件属性由事件管理团队(视情况而定)更新
- InciWeb在急性发作期间,每日1-2次
- 情况报告每日(早晨)
MCP服务器根据更新频率(活动数据的TTL为5-15分钟)适当地缓存数据。
