Labsco
lubosstrejcek logo

Victron ModBus TCP

from lubosstrejcek

Server that connects to Victron Energy GX devices on local network.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

Victron TCP โ€” MCP Server

Connect AI assistants to Victron Energy systems. Read real-time solar, battery, grid, and inverter data from your local network โ€” no cloud required.

32 tools | 23 prompts | 2 resources | 900+ registers | Modbus TCP + MQTT


Which package do I want?

This is the local / LAN half of a pair. The remote / cloud half is victron-vrm-mcp.

victron-tcp (this repo)victron-vrm-mcp
Transportstdio (local subprocess)Streamable HTTP (remote)
Data sourceModbus TCP + MQTT on your LANVRM cloud API
Needs access to the GX on your LANYesNo
Works when you're away from the boat / houseNoYes
Works when the internet is downYesNo
LatencyReal-time (~50 ms)~15 min (VRM sampling)
Raw register accessYes (900+ registers)No
Write coverage (planned)Broad โ€” anything D-Bus exposesNarrow โ€” only what VRM sanctions remotely (Dynamic ESS, clear-alarm, tags, โ€ฆ)
MCP Connector API compatibleNo (stdio)Yes (HTTPS)
ClientsClaude Code, Claude Desktop, Cursor, WindsurfAnthropic Messages API + anything that speaks MCP over HTTP
AuthNone locally (trusts LAN)Per-request VRM personal access token

Use this package when: you're on the same LAN as a GX device and want real-time, low-latency read access with raw-register support. Use victron-vrm-mcp when: you need remote access, you're building an API-backed app via the MCP Connector, or you don't want to expose anything on your LAN.

You can use both simultaneously โ€” they serve different use cases and carry different risk profiles.


What you can do

Energy Reporting

PromptWhat it does
hourly-snapshotQuick power flow snapshot โ€” SOC, PV, grid, load
daily-reportProduction, consumption, self-consumption ratio, grid dependency
weekly-reviewYield trends, battery health, load patterns, scheduling tips
monthly-analysisEnergy balance, cost savings, battery aging, seasonal comparison

Energy Optimization

PromptWhat it does
energy-optimizerAI-driven tuning โ€” choose goal: self-consumption, cost savings, battery longevity, backup readiness, or balanced
ess-tuningReview ESS mode, grid setpoint, battery limits, Dynamic ESS
storm-prepPre-outage readiness check

Monitoring & Troubleshooting

PromptWhat it does
diagnose-systemFull health check with alarm scan
solar-performancePV yield analysis, tracker comparison, shading detection
troubleshootGuided debugging with error code lookup
tank-monitorFuel, water, waste levels (marine/RV/off-grid)
generator-managementAuto-start conditions, runtime, quiet hours

Device Discovery

PromptWhat it does
setup-guideFirst-time setup wizard
find-devicesScan network, discover all GX devices and their connected devices
identify-device"What is unit ID 247?" โ€” identify any device
system-topologyMap AC/DC buses, connections, energy flow paths
device-inventoryFull device table for documentation or support
register-explorerBrowse registers, explain types and scale factors
firmware-checkFirmware versions across all devices

For Installers

PromptWhat it does
commissioningNew system checklist โ€” inventory, wiring, config, pass/fail
site-auditCommunication, alarms, measurements, performance audit

Integration

PromptWhat it does
nodered-checkNode-RED on Venus OS โ€” MQTT topics, flow debugging
mqtt-debugBroker connectivity, topic tracing, keepalive debugging

Tools Reference

Core Monitoring (9 tools)
ToolDescription
victron_system_overviewBattery SOC, PV power, grid power, AC consumption, ESS status
victron_battery_statusSOC, voltage, current, power, temperature, cell data, time-to-go
victron_solar_statusPV power, yield today/yesterday/total, charger state, tracker data
victron_grid_statusGrid power per phase (L1/L2/L3), voltage, current, frequency
victron_vebus_statusMulti/Quattro: AC in/out, current limit, mode, state, alarms
victron_tank_levelsTank level, capacity, remaining, fluid type
victron_temperatureTemperature, sensor type, humidity, pressure
victron_inverter_statusStandalone inverter: AC output, state, alarms
victron_evcs_statusEV Charging Station: power, status, session energy
Extended Devices (14 tools)
ToolDescription
victron_multi_statusMulti RS inverter/charger
victron_pvinverter_statusAC-coupled PV inverters (Fronius, SolarEdge, ABB)
victron_genset_statusAC genset controllers
victron_dcgenset_statusDC generators
victron_alternator_statusNMEA 2000 alternators
victron_charger_statusAC chargers (Skylla, Blue Smart)
victron_dcdc_statusOrion XS DC-DC converter
victron_acload_statusAC load / current sensors
victron_dcenergy_statusDC energy meters (SmartShunts in DC meter mode)
victron_gx_infoGX device identity, relay states
victron_digital_inputsDigital input state and type
victron_gps_statusGPS position, altitude, speed
victron_meteo_statusSolar irradiance, wind speed, temperatures
victron_generator_statusGenerator auto start/stop, runtime, alarms
Discovery & Setup (4 tools)
ToolDescription
victron_network_scanScan local network to find GX devices
victron_setupFull setup: test transports, discover devices, generate config
victron_mqtt_discoverAuto-discover MQTT portal ID, services, device instances
victron_discoverScan Modbus unit IDs to find connected devices
Utility & Documentation (5 tools)
ToolDescription
victron_read_categoryRead all registers for any device category
victron_read_registerRead raw register(s) by address (Modbus only)
victron_list_registersList available registers for a device category
victron_search_docsSearch offline docs (registers + VRM API)
victron_check_onlineGet URLs for latest Victron docs

Resources

URIContent
victron://register-listCCGX Modbus TCP register list (Rev 3.71) โ€” 943 registers
victron://unit-id-mappingDevice type to unit ID mapping

Debugging

The MCP Inspector is the fastest way to poke at the server interactively.

# Inspect a locally-built server
npm run inspect

# Inspect the published npm package as users would run it
npm run inspect:npm

Both open a browser-based UI where you can call tools, view structured content, and watch the notification stream. Logs go to stderr (stdout is reserved for the JSON-RPC stream on stdio transport โ€” never write to stdout).

For Claude Desktop specifically, MCP server logs land in ~/Library/Logs/Claude/mcp-server-victron-tcp.log (macOS) or %APPDATA%\Claude\logs\mcp-server-victron-tcp.log (Windows). See the spec's debugging guide for a full walkthrough.


Documentation

GuideContent
SetupClient configs, transport comparison, unit IDs, supported devices
ExamplesReal-world prompts with step-by-step AI behavior
TroubleshootingCommon errors and fixes
FAQFrequently asked questions
ArchitectureCode structure, register map, how it works
SecuritySecurity model, data sensitivity, network exposure

Roadmap

  • Write support โ€” ESS mode control, grid setpoint, charge current limits, relay control (via MQTT W/ topics)
  • MCP Resources โ€” register list + unit ID mapping (VRM API spec moved to victron-vrm-mcp)
  • MCP Prompts โ€” 23 guided workflows
  • NPM package (npx victron-tcp)
  • Sibling package for VRM cloud access โ€” victron-vrm-mcp

References