本项目借助MCP协议,提供对美国国家海洋和大气管理局(NOAA)海洋与大气数据的快速访问。涵盖潮汐、海流、气象、天文和气候等多方面数据,为各类需求提供一站式解决方案。
📦 快速开始 • 🛠️ 可用工具 • 📖 使用示例 • 🏗️ 高级用法
# 立即安装并运行,无需设置!
npx @ryancardin/noaa-tides-currents-mcp-server
# 或使用更短的别名
npx noaa-mcp
标准输入输出模式(默认 - MCP协议)
# 用于Claude Desktop集成的标准MCP服务器
npx @ryancardin/noaa-tides-currents-mcp-server
# 或使用更短的别名
npx noaa-mcp
HTTP流式模式(用于Web集成)
# 在默认端口3000上启动HTTP服务器
npx @ryancardin/noaa-tides-currents-mcp-server --http
# 指定自定义端口
npx @ryancardin/noaa-tides-currents-mcp-server --http --port 8080
# 使用更短的别名
npx noaa-mcp --http --port 8080
# 通过服务器发送事件访问
curl http://localhost:3000/sse
通过Smithery直接安装到Claude Desktop:
npx -y @smithery/cli install @RyanCardin15/tidesandcurrents --client claude
# 克隆并构建
git clone https://github.com/RyanCardin15/NOAA-Tides-And-Currents-MCP.git
cd NOAA-Tides-And-Currents-MCP
npm install && npm run build
# 启动服务器
npm start
# 使用FastMCP进行测试
npx fastmcp dev dist/index.js
get_water_levels:实时和历史水位数据。get_tide_predictions:高低潮预测和连续数据。get_currents:实时和历史海流测量数据。get_current_predictions:海流速度和方向预测。get_meteorological_data:风、气温、水温、气压等气象数据。get_stations:搜索和列出监测站点。get_station_details:详细的站点元数据和功能信息。get_sea_level_trends:长期海平面上升趋势和速率。get_extreme_water_levels:极端事件的统计分析。get_high_tide_flooding_daily:每日洪水事件计数。get_high_tide_flooding_monthly:每月洪水模式。get_high_tide_flooding_seasonal:季节性洪水分析。get_high_tide_flooding_annual:年度洪水趋势。get_high_tide_flooding_projections:未来洪水风险情景。get_high_tide_flooding_likelihoods:每日洪水概率。get_top_ten_water_levels:有记录以来的最高/最低水位。get_moon_phase:当前月相和光照情况。get_moon_phases_range:指定日期范围内的月相。get_next_moon_phase:查找下一个新月/满月/季度月。get_sun_times:日出、日落、黎明、黄昏时间。get_sun_times_range:指定日期范围内的太阳时间。get_sun_position:实时太阳方位角和仰角。get_next_sun_event:下一个日出、日落或太阳正午时间。get_parameter_definitions:所有API参数的有效取值。# 获取波士顿港的最新水位
get_water_levels station="8443970" date="latest"
# 获取迈阿密今天的潮汐预测
get_tide_predictions station="8723214" begin_date="today" end_date="today" interval="hilo"
# 获取极端水位统计数据,用于风暴规划
get_extreme_water_levels station="8518750" units="english"
# 检查明天的洪水可能性
get_high_tide_flooding_likelihoods station="8518750" date="2024-12-16" threshold="minor"
# 分析30年的海平面趋势
get_sea_level_trends station="8518750" affiliation="US"
# 获取2050年代中等海平面上升情景下的高潮洪水预测
get_high_tide_flooding_projections station="8518750" scenario="intermediate" decade="2050s"
# 获取今晚用于导航的月相
get_moon_phase date="2024-12-15" latitude="42.3601" longitude="-71.0589"
# 计算帆船航行的日出/日落时间
get_sun_times date="2024-12-15" latitude="25.7617" longitude="-80.1918" timezone="America/New_York"
# 根据当前预测获取最佳钓鱼时间
get_current_predictions station="ACT0446" date="today" interval="MAX_SLACK"
# 获取风和气象条件
get_meteorological_data station="8443970" product="wind" date="today"
# 在开发模式下运行(标准输入输出)
npm run dev
# 使用HTTP传输进行开发
npm run dev:http
# 使用不同传输方式进行生产构建
npm start # 标准输入输出模式(默认)
npm run start:http # 在端口3000上使用HTTP
npm run start:http:3001 # 在端口3001上使用HTTP
npm run start:http:8080 # 在端口8080上使用HTTP
# 检查服务器功能
npx fastmcp inspect dist/index.js
当以HTTP模式运行时,服务器在 /sse 提供服务器发送事件(SSE):
# 启动HTTP服务器
npx @ryancardin/noaa-tides-currents-mcp-server --http --port 3000
# 测试端点
curl -N http://localhost:3000/sse
# 或与Web应用程序集成
fetch('http://localhost:3000/sse')
.then(response => response.body.getReader())
.then(reader => {
// 处理流式MCP响应
});
HTTP模式的使用场景:
所有工具支持多种输出格式:
该服务器与三个NOAA API集成:
| API | 用途 | 基础URL |
|---|---|---|
| 数据API | 实时观测和预测 | api.tidesandcurrents.noaa.gov/api/prod/ |
| 元数据API | 站点信息和功能 | api.tidesandcurrents.noaa.gov/mdapi/prod/ |
| 衍生产品API | 气候分析和研究数据 | api.tidesandcurrents.noaa.gov/dpapi/prod/ |
# 检查Node.js版本
node --version # 应为18+
# 重新构建TypeScript
npm run build
get_stations 查找有效站点。chmod +x dist/index.js。我们欢迎贡献!以下是开始的步骤:
git checkout -b amazing-feature)。npm test。npm run build # 构建TypeScript
npm run dev # 开发模式
npm run test # 运行测试套件
npm run format # 使用Prettier格式化代码
MIT许可证 - 详情请参阅 LICENSE 文件。
由 Ryan Cardin 用心打造
得益于NOAA对开放海洋数据的支持 🌊