Skip to main content
Glama
bhyve-mcp

bhyve-mcp

by norman2112

bhyve-mcp

An MCP server for Orbit B-Hyve smart irrigation systems. Query device status, zones, and watering history — or start/stop watering, set rain delays, and manage programs — from Claude Code, Cursor, or any MCP-compatible client.

Why This Exists

I built this to control my sprinkler system from the same AI tools I use for everything else. Instead of opening the B-Hyve app to check zone status or adjust a rain delay, I can do it from a Claude conversation or a Cursor terminal.

It's also a good example of an MCP server that bridges REST (reads) and WebSocket (writes) APIs under a single interface — a different integration pattern than my other MCP servers which are pure REST or REST+SOAP.

Related MCP server: opensprinkler-mcp

Features

  • Read tools: list devices, device status, zones, programs, watering history

  • Write tools: start/stop watering, rain delay, device mode, program updates, smart watering toggle

  • Resources: bhyve://devices and bhyve://device/{device_id}/zones

  • Transport: stdio (local MCP)

Requirements

  • Python 3.10+

  • uv (recommended) or pip

  • Orbit B-Hyve account

Setup

  1. Clone this repo and install dependencies:

cd bhyve-mcp
uv sync
  1. Copy credentials:

cp .env.example .env
# Edit .env with your BHYVE_EMAIL and BHYVE_PASSWORD

Cursor / Claude Code configuration

Add to ~/.cursor/mcp.json or your project's .mcp.json:

{
  "mcpServers": {
    "bhyve": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/path/to/bhyve-mcp",
        "python",
        "-m",
        "bhyve_mcp.server"
      ],
      "env": {
        "BHYVE_EMAIL": "your-email@example.com",
        "BHYVE_PASSWORD": "your-password"
      }
    }
  }
}

Replace /path/to/bhyve-mcp with the absolute path to this directory.

Development

# Run tests
uv run pytest

# Interactive MCP testing
uv run mcp dev src/bhyve_mcp/server.py

Architecture

  • FastMCP (mcp Python SDK) — MCP tool/resource server over stdio

  • Vendored pybhyve — B-Hyve REST + WebSocket client (from sebr/bhyve-home-assistant)

  • Session wrapper — lazy auth, token refresh on 401/403, structured errors

Write operations (start watering, rain delay, etc.) use the B-Hyve WebSocket API. Read operations use REST polling.

Safety

  • start_watering defaults to a 30-minute max unless allow_extended_runtime=true

  • Rain delay capped at 168 hours (7 days)

  • Watering duration capped at 120 minutes

License

MIT

Available Tools

12 tools
disable_rain_delayA

Cancel an active rain delay.

Args:
    device_id: Device ID from list_devices.

Inputs: device_id (required). Returns: result

enable_rain_delayA

Enable rain delay (pauses all scheduled watering).

Args:
    device_id: Device ID from list_devices.
    hours: Hours to delay (1-168, max 7 days).

Inputs: hours (required), device_id (required). Returns: result

get_device_statusA

Get current status of a specific device including watering state and rain delays.

Args:
    device_id: Device ID from list_devices.

Inputs: device_id (required). Returns: result

get_programsB

List watering programs configured for a device.

Args:
    device_id: Device ID from list_devices.

Inputs: device_id (required). Returns: result

get_watering_historyA

Get recent watering history for a device.

Args:
    device_id: Device ID from list_devices.
    page: Page number (default 1).
    per_page: Results per page (default 10).

Inputs: device_id (required), page, per_page. Returns: result

get_zone_detailsB

Get detailed info for all zones on a device.

Args:
    device_id: Device ID from list_devices.

Inputs: device_id (required). Returns: result

list_devicesA

List all B-Hyve devices (controllers, hubs, hose timers, flood sensors) on the account.

Returns device id, name, type, status, firmware, station count, battery, and connectivity. Use device IDs from this response with all other tools.

Inputs: no named parameters. Returns: result

set_device_modeA

Set device operating mode.

Args:
    device_id: Device ID from list_devices.
    mode: Operating mode — "auto" or "off".

Inputs: mode (required), device_id (required). Returns: result

start_wateringA

Start watering a specific zone for a given duration.

Safety: durations over 30 minutes require allow_extended_runtime=true.

Args:
    device_id: Device ID from list_devices.
    zone: Zone/station number (1-indexed).
    minutes: Duration in minutes (1-120).
    allow_extended_runtime: Set true to allow watering longer than 30 minutes.

Inputs: zone (required), minutes (required), device_id (required), allow_extended_runtime. Returns: result

stop_wateringB

Stop all active watering on a device.

Args:
    device_id: Device ID from list_devices.

Inputs: device_id (required). Returns: result

toggle_smart_wateringA

Enable or disable Smart Watering for a zone (device-wide water_sense_mode).

Args:
    device_id: Device ID from list_devices.
    zone: Zone/station number.
    enabled: True to enable, false to disable.

Inputs: zone (required), enabled (required), device_id (required). Returns: result

update_programA

Update an existing watering program's configuration.

Programs must be created in the B-Hyve app first. Only modifies existing programs.

Args:
    device_id: Device ID from list_devices.
    program_id: Program ID from get_programs.
    start_times: Watering start times in HH:MM format.
    frequency: Frequency config with type (days|interval), days [0-6], interval int.
    budget: Watering budget percentage (0-200, 100 = default).

Inputs: device_id (required), program_id (required), budget, frequency, +1 more. Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 12 tools

    Disambiguation5/5

    Each tool has a clear, distinct purpose: listing devices, getting status, controlling watering, rain delays, programs, etc. There is no overlap between tool functionalities.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern with lowercase and underscores (e.g., enable_rain_delay, get_device_status, start_watering). No mixing of conventions.

    Tool Count5/5

    12 tools cover the essential operations for a smart irrigation controller without being overwhelming or too sparse. The count is appropriate for the domain.

    Completeness4/5

    The tool set covers most key actions (device management, watering, rain delays, programs, history). A minor gap is the inability to create or delete programs, which is noted as requiring the app. Otherwise complete.

    Maintenance

    ActivityInactive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that wraps the Ambient Weather REST API. Query your personal weather stations conversationally from Claude Code, Claude.ai, or any MCP-compatible client.
      1
      MIT
    • F
      license
      Not graded
      quality
      F
      maintenance
      Enables managing OpenSprinkler irrigation controllers via Claude Desktop, including starting/stopping stations, setting rain delays, and viewing controller status.
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      MCP server for Hunter Hydrawise irrigation controllers, exposing the Hydrawise REST API as tools for AI agents to manage watering schedules and controller settings.
      -