潮汐预测服务器

一个提供加拿大潮汐预测数据的模型上下文协议(MCP)服务器,支持AI应用检索加拿大各地监测站的潮汐预报。

  • by kykoay
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 kykoay/BCTideMCPServerLocal

使用说明

不列颠哥伦比亚省潮汐MCP服务器

模型上下文协议(MCP)服务器,提供从综合水位系统(IWLS)API对加拿大潮汐预测的访问。该服务器使人工智能应用程序能够检索加拿大各地监测站的潮汐预报。

特性

工具

  • get_tide_forecast -获取特定站点的7天潮高预测
  • list_stations -列出可用的潮汐监测站及其过滤选项

安装

  1. 克隆或下载此存储库

    git clone <repository-url>
    cd bc-tide-mcp-server
    
  2. 安装依赖项

    pip install -r requirements.txt
    # or using uv
    uv sync
    

用法

运行服务器

开发模式(stdio):

python main.py

使用紫外线:

uv run main.py

与Claude Desktop集成

添加到您的Claude Desktop配置文件(claude_desktop_config.json):

{
  "mcpServers": {
    "bc-tides": {
      "command": "python",
      "args": ["/absolute/path/to/bc-tide-mcp-server/main.py"]
    }
  }
}

或使用紫外线:

{
  "mcpServers": {
    "bc-tides": {
      "command": "uv",
      "args": ["run", "--directory", "/absolute/path/to/bc-tide-mcp-server", "main.py"]
    }
  }
}

api参考

工具

get_tide_forecast

为加拿大监测站获取7天潮位预报。

参数:

  • station_name (必填):监测站的名称(例如,“阿特金森点”、“温哥华”、“维多利亚”)。支持部分匹配。

退货:

{
  "success": true,
  "station": {
    "name": "Point Atkinson",
    "id": "5cebf1de3d0f4a073c4bbcef",
    "code": "07795",
    "latitude": 49.3299,
    "longitude": -123.2633,
    "operating": true
  },
  "time_range": {
    "from": "2024-01-01T00:00:00Z",
    "to": "2024-01-08T00:00:00Z"
  },
  "resolution": "SIXTY_MINUTES (hourly)",
  "total_predictions": 168,
  "forecasts": [
    {
      "timestamp": "2024-01-01T00:00:00Z",
      "water_level_meters": 3.42,
      "qc_flag": "2"
    }
  ]
}

list_stations

列出可用的潮汐监测站。

参数:

  • search_term (可选):按名称过滤站
  • operating_only (可选,默认值:true):仅返回当前正在运行的工作站
  • limit (可选,默认值:20):要返回的最大站数(1-100)

退货:

{
  "success": true,
  "search_term": "vancouver",
  "operating_only": true,
  "total_matching": 3,
  "stations": [
    {
      "name": "Point Atkinson",
      "alternative_name": null,
      "id": "5cebf1de3d0f4a073c4bbcef",
      "code": "07795",
      "latitude": 49.3299,
      "longitude": -123.2633,
      "operating": true
    }
  ]
}

车站名称示例

  • 阿特金森角(温哥华附近)
  • 维多利亚
  • 托菲诺
  • 鲁珀特王子
  • 纳奈莫
  • 坎贝尔河

数据源

该服务器使用加拿大渔业和海洋部(DFO-MPO)提供的综合水位系统(IWLS)API。

API基本URL: https://api-iwls.dfo-mpo.gc.ca/api/v1

Claude中的示例用法

设置服务器后,您可以在Claude Desktop中使用它:

"What are the tide predictions for Point Atkinson for the next week?"

"List all tide stations near Victoria"

"Get the tide forecast for Tofino"

许可证

该项目根据MIT许可证获得许可。