Skip to main content
Glama
Surf MCP Server

Surf MCP Server

by ravinahp

浏览 MCP 服务器

MCP 服务器适用于冲浪和上网的人。

图表

字母点阵 - 5 dpi

Related MCP server: BC Water Tides MCP Server

视频演示

https://github.com/user-attachments/assets/0a4453e2-66df-4bf5-8366-8538cda366ed

特征

  • 使用经纬度获取任意位置的潮汐信息

  • 支持特定日期的潮汐查询

  • 详细的潮汐数据,包括高潮/低潮和站点信息

  • 自动时区处理(UTC)

先决条件

  • Python 3.x

  • Storm Glass API 密钥

获取您的 Storm Glass API 密钥

  1. 参观Storm Glass

  2. 点击“免费试用”或“登录”创建帐户

  3. 注册后,您将收到您的 API 密钥

关于 API 使用限制的说明:

  • 免费套餐:每天 10 个请求

  • 可用的付费计划:

    • 小型:500 个请求/天(19 欧元/月)

    • 中等:5000 个请求/天(49 欧元/月)

    • 大型:25,000 个请求/天(129 欧元/月)

    • 企业:提供定制计划

根据您的使用需求选择套餐。免费套餐适合测试和个人使用。

安装

  1. 克隆存储库:

git clone https://github.com/ravinahp/surf-mcp.git
cd surf-mcp
  1. 使用 uv 安装依赖项:

uv sync

注意:由于该项目使用pyproject.toml进行依赖管理,因此我们使用uv而不是 pip。

配置为 MCP 服务器

要将此工具添加为 MCP 服务器,您需要修改 Claude 桌面配置文件。此配置包含您的 Storm Glass API 密钥,因此您无需单独设置。

配置文件位置取决于您的操作系统:

  • MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%/Claude/claude_desktop_config.json

将以下配置添加到您的 JSON 文件:

{
    "surf-mcp": {
        "command": "uv",
        "args": [
            "--directory",
            "/Users/YOUR_USERNAME/Code/surf-mcp",
            "run",
            "surf-mcp"
        ],
        "env": {
            "STORMGLASS_API_KEY": "your_api_key_here"
        }
    }
}

⚠️重要提示:

  1. 将YOUR_USERNAME替换为您的实际系统用户名

  2. 将your_api_key_here替换为你的实际 Storm Glass API 密钥

  3. 确保目录路径与本地安装匹配

部署

建筑

准备包:

  1. 同步依赖项并更新锁文件:

uv sync
  1. 构建包:

uv build

这将在dist/目录中创建分布。

调试

由于 MCP 服务器通过 stdio 运行,调试起来可能颇具挑战性。为了获得最佳调试体验,我们强烈建议使用 MCP Inspector。

您可以使用以下命令启动 MCP Inspector:

npx @modelcontextprotocol/inspector uv --directory /path/to/surf-mcp run surf-mcp

启动后,检查器将显示一个 URL,您可以在浏览器中访问该 URL 以开始调试。

检查员提供:

  • 实时请求/响应监控

  • 输入/输出验证

  • 错误追踪

  • 性能指标

用法

该服务提供了一个用于获取潮汐信息的 FastMCP 工具:

@mcp.tool()
async def get_tides(latitude: float, longitude: float, date: str) -> str:
    """Get tide information for a specific location and date."""

参数:

  • latitude :表示位置纬度的浮点值

  • longitude :表示位置经度的浮点值

  • date :YYYY-MM-DD 格式的日期字符串

响应示例:

Tide Times:
Time: 2024-01-20T00:30:00+00:00 (UTC)
Type: HIGH tide
Height: 1.52m

Time: 2024-01-20T06:45:00+00:00 (UTC)
Type: LOW tide
Height: 0.25m

Station Information:
Name: Sample Station
Distance: 20.5km from requested location

用例

示例 1:寻找最佳冲浪时间

您可以使用此工具确定您最喜欢的海滩和最近的冲浪站的最佳冲浪时间。通常,最佳冲浪条件是在涨潮时,即涨潮前约 2 小时。

给 Claude 的示例提示:

注意:不同的海滩可能因其特定的地理位置和浪涌类型而具有不同的最佳潮汐条件。此工具还提供站点距离信息,应与潮汐信息一起考虑。(例如,站点距离越长,误差变化越大——您也可以在提示时向 Claude 询问此信息)。

错误处理

该服务包括针对以下方面的强大错误处理:

  • API 请求失败

  • 无效坐标

  • API 密钥缺失或无效

  • 网络超时

Available Tools

1 tool
get_tidesB

Get tide information for a specific location and date.

Args:
    latitude: Float value representing the location's latitude
    longitude: Float value representing the location's longitude
    date: Date string in YYYY-MM-DD format
    
Returns:
    Formatted string containing tide information and station details

Inputs: latitude (required), longitude (required), date (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only one tool, there is no possibility of ambiguity or overlap between tools. The tool's purpose is clearly defined as retrieving tide information for a specific location and date, making it distinct by default.

    Naming Consistency5/5

    The single tool follows a clear verb_noun pattern (get_tides), which is consistent and predictable. Since there are no other tools to compare against, the naming convention is perfectly uniform.

    Tool Count2/5

    A single tool is too few for a server named 'Surf MCP Server', which implies a broader scope related to surfing or ocean conditions. This minimal toolset feels incomplete and under-scoped for the apparent domain.

    Completeness2/5

    The tool surface is severely incomplete for a surfing-related server. While get_tides covers tide information, there are obvious gaps such as wave forecasts, weather data, or surf spot details, which are essential for the domain and will likely cause agent failures.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers