boston-harbor-ferries

boston-harbor-ferries

MCP server to track Boston Harbor commuter ferries in real-time, providing vessel positions, routes, and schedules.

Category
访问服务器

README

Boston Harbor Ferries

PyPI version Python 3.10+ License: MIT Code style: ruff APRS.fi

APRS-based Boston Harbor commuter ferry tracker with MCP server support.

Tightly scoped to track Seaport Ferry vessels operating in Boston Harbor.

Data provided by aprs.fi - https://aprs.fi

Features

  • Track all 4 Seaport Ferry vessels in real-time
  • In-memory caching with 120-second TTL (respects aprs.fi API terms)
  • Rate limiting: 10 requests/minute (configurable)
  • Rich CLI with beautiful terminal output
  • MCP server for integration with Claude Code and other AI assistants
  • Run with uvx (no installation required)
  • Live position tracking and historical data export

Tracked Vessels

Seaport Ferry - North Station Route

  • PHILLIS WHEATLEY (MMSI: 368227350)
  • SAMUEL WHITTEMORE (MMSI: 368227370)
  • COMMONWEALTH (MMSI: 368351390)

Route: LoveJoy Wharf (North Station) ↔ Fan Pier (Seaport) ↔ Pier 10 Travel time: ~30 minutes

Seaport Ferry - East Boston Route

Route: Lewis Mall Wharf (East Boston) ↔ Fan Pier (Seaport) Travel time: ~10 minutes

🚢 Latest Position: 42.351318°N, 71.038918°W (Course: 339°) 📊 View 24-Day Activity Analysis - Speed patterns, hourly heatmaps, route visualization 📍 Live Position Data - Real-time JSON feed

Historical Data: 4,777 positions over 24 days (Sep 15 - Oct 10) • Avg speed: 12.4kn • Operating hours: 05:00-19:00

📊 Activity Heatmap (Last 2 Weeks)

Activity by hour - darker blocks indicate more position reports:

      00  04  08  12  16  20
      │   │   │   │   │   │
09-29 │    ░▓████▒ ░▒░███▓▒
09-30 │    ░▓████░  ▒▓████▒
10-01 │     ▒████▒    ████▒
10-02 │    ░▓████░    ████▒
10-03 │     ▓█████▓░▒▒████▒
10-06 │    ░▒████▓░▒▒▒████▒
10-07 │    ░▓████▒   ░████▒
10-08 │     ▓█░▓█░   ░████▒
10-09 │    ░█████▒▒█░▓████░
10-10 │    ░▓████▒

Legend: ░ Low ▒ Medium ▓ High █ Peak Pattern: Clear AM (06-10) and PM (15-18) commute peaks

🚢 Speed Distribution

Speed (knots) │ Frequency
──────────────┼──────────────────────────────────────────────────
        2- 4 │ ██████ 188
        4- 6 │ ███████ 202
        6- 8 │ █████ 148
        8-10 │ ██████ 176
       10-12 │ ████████ 229
       12-14 │ ████████████ 349
       14-16 │ ███████████████████████ 673
       16-18 │ ████████████████████████████████████████ 1123
       18-20 │ ███ 93
       20-22 │  21

Peak Speed: 16-18 knots (75% of time cruising >10kn)

🗺️ Route Map

           Boston Harbor
    ╔══════════════════════╗
    ║                      ║

  Lewis Mall Wharf    Fan Pier
   (East Boston)      (Seaport)
         │                │
         │   ~10 min      │
         │   8-12 kn      │
         └───────┬────────┘
                 │
            CRISPUS ATTUCKS
            (90 passengers)

Operating: 05:00-19:00 daily • Peak: 06-10, 15-18


Installation

Run with uvx (recommended)

# Set your API key
export APRS_API_KEY="your-key-from-aprs.fi"

# Run commands directly
uvx --from . harbor-ferry list-vessels
uvx --from . harbor-ferry track 368157410
uvx --from . harbor-ferry track-all

Install in development mode

cd boston_harbor_ferries
pip install -e .

Configuration

Get your free API key from https://aprs.fi (requires registration).

Set the API key via environment variable:

export APRS_API_KEY="your-api-key-here"

Or create a .env file:

APRS_API_KEY=your-api-key-here
APRS_CACHE_TTL_SECONDS=120
APRS_MAX_REQUESTS_PER_MINUTE=10

CLI Usage

# List all known ferries
harbor-ferry list-vessels

# Show routes and schedules
harbor-ferry routes

# Track a specific ferry
harbor-ferry track 368157410

# Track all ferries
harbor-ferry track-all

# Force fresh data (bypass cache)
harbor-ferry track 368157410 --no-cache

# Cache management
harbor-ferry cache-info
harbor-ferry clear-cache

MCP Server Usage

The MCP server allows AI assistants like Claude Code to track ferries in real-time.

Quick Start

# Test the MCP server
gmake test-mcp

# Expected output:
# ✓ MCP server responding to JSON-RPC
# Tools: list_ferries, track_ferry, track_all_ferries, get_ferry_routes, clear_cache

Available MCP Tools

  • list_ferries - List all known Boston Harbor ferries with details
  • get_ferry_routes - Get route information and schedules
  • track_ferry - Track specific ferry by MMSI number
  • track_all_ferries - Get all ferry positions at once
  • clear_cache - Force fresh data (bypasses 2-minute cache)

Claude Code/Desktop Integration

See docs/CLAUDE_CODE_INTEGRATION.md for complete integration guide.

Adding to Claude Code

From within this repository directory:

# Add the MCP server to Claude Code
claude mcp add-json boston-harbor-ferries \
  '{"command":"uv","args":["run","python","-m","boston_harbor_ferries.mcp_server"],"env":{"APRS_API_KEY":"'"${APRS_API_KEY}"'"}}'

# Verify it's connected
claude mcp list
# Should show: boston-harbor-ferries - ✓ Connected

# View available tools
claude mcp get boston-harbor-ferries

Claude Desktop Configuration

For global access in all Claude Desktop conversations:

Linux: ~/.config/Claude/claude_desktop_config.json macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "boston-harbor-ferries": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/full/path/to/boston-harbor-ferries",
        "python",
        "-m",
        "boston_harbor_ferries.mcp_server"
      ],
      "env": {
        "APRS_API_KEY": "your-api-key-here"
      }
    }
  }
}

Example Questions for Claude

Once configured, you can ask Claude:

  • "Where is CRISPUS ATTUCKS right now?"
  • "Show me all active ferries"
  • "What are the ferry routes in Boston Harbor?"
  • "Clear the cache and check ferry positions again"

Understanding Position Data

Operating Hours: Ferries transmit APRS positions during service hours (05:00-19:00 daily)

  • Peak times: 06:00-10:00 (morning) and 15:00-18:00 (evening)
  • Off-hours: No position data when ferries are not operating
  • Data age: Position reports update every 1-2 minutes when active

If you see old position data (>1 hour), the ferry is likely docked between runs or service has ended for the day. Check during peak commute hours for live tracking.

All 6 MCP tools tested and working ✅ (see gmake test)

Bonus: FreeBSD Leave Reminder MCP Server

This repository also includes a standalone MCP server that wraps FreeBSD's leave(1) command for setting reminders.

See LEAVE_MCP.md for complete documentation.

Quick test:

gmake test-leave-mcp

Tools available:

  • set_reminder - Set a reminder for a specific time or duration
  • check_reminders - View active reminders
  • cancel_reminders - Cancel all reminders

Example: "Remind me to leave in 30 minutes" → Uses +0030 format

Python API

from boston_harbor_ferries import APRSClient, VESSELS

# Initialize client (loads API key from env)
with APRSClient() as client:
    # Track specific ferry
    position = client.get_vessel_position("368157410")
    if position:
        print(f"{position.vessel.name} at {position.latitude}, {position.longitude}")

    # Track all ferries
    positions = client.get_all_ferries()
    for pos in positions:
        print(f"{pos.vessel.name}: {pos.age_seconds:.0f}s old")

API Terms Compliance

This tool complies with aprs.fi API terms of service:

  • ✅ Credits aprs.fi as data source in all output
  • ✅ Provides link back to aprs.fi
  • ✅ Free to use for all users
  • ✅ Includes User-Agent header with app name/version
  • ✅ Each user uses their own API key
  • ✅ Built-in rate limiting (10 req/min default)
  • ✅ Intelligent caching (2 min TTL default)
  • ✅ Only queries when actively needed (no background polling)

Development

# Install with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Type checking
mypy boston_harbor_ferries

License

MIT

Acknowledgments

Data provided by aprs.fi - Hessu's excellent APRS infrastructure service.

Ferry service operated by Seaport Ferry.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选