SprutHub MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SprutHub MCP Server turn off the lights in the living room"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SprutHubCTL
Высокоуровневая интеграция SprutHub для LLM-ассистентов (Antigravity, Claude Desktop, Cursor, Claude Code, Cline и др.) и системных администраторов.
Предоставляет два формата работы в одном пакете:
On-Demand CLI (
spruthubctl/sprut) + Skill — ультралегковесный запуск по требованию для терминала и AI-агентов (Antigravity, Claude Code) с нулевым оверхедом по RAM и контекстному окну (~80 мс на запрос, 0 байт RAM в простое).MCP Server (
spruthub-mcp) — стандартный сервер Model Context Protocol (для клиентов без доступа к терминалу, например Claude Desktop).
Ключевые особенности
⚡ Прямой локальный WebSocket: прямое подключение к хабу в локальной сети (
ws://<IP>/spruthub), нулевые задержки (< 5 мс), полная автономность без зависимости от облака.🧠 Семантический фасад вместо сырого RPC: сервер берет на себя нормализацию данных, фильтрацию служебного мусора и разрешение сервисов, позволяя LLM работать за 1 шаг.
🛡️ Автоматическая нормализация типов: упаковка базовых типов (
bool,int,float,str) в структуры SprutHub (boolValue,intValueи др.).💡 Умное переключение (
switch): вам не нужно знать точныйservice_idилиcharacteristic_idреле — система автоматически найдёт целевую службуSwitch/Lightbulb/Outlet.🔒 Безопасная аутентификация: работа по локальному паролю (токену) без необходимости хранить мастер-пароль от аккаунта.
🚀 Нулевой оверхед (Hybrid Architecture): поддержка работы как в виде фонового MCP-сервера, так и через легковесный CLI.
Related MCP server: MCP-HASS
⚡ Быстрая установка (Prompt-ready)
Если вы используете AI-агента (Antigravity, Claude Code, Cursor, Cline):
Просто отправьте вашему ассистенту сообщение со ссылкой на репозиторий:
«Установи SprutHub из https://github.com/pikerr/spruthubctl. Мой хост:
192.168.1.100, локальный пароль:ВАШ_ПАРОЛЬ»
Агент прочитает AGENTS.md и выполнит всё сам за один шаг.
Установка вручную в терминале:
uvx --from git+https://github.com/pikerr/spruthubctl spruthubctl install --host 192.168.1.100 --token ВАШ_ПАРОЛЬ(Для регистрации MCP-сервера в Claude Desktop / Cursor добавьте флаг --mcp).
Команда автоматически:
Сохраняет конфигурацию в
~/.config/spruthubctl/config.json(chmod 600).Устанавливает готовый Agent Skill в директории
~/.gemini/и~/.claude/.Проверяет связь с вашим контроллером SprutHub.
Архитектура: Двойной интерфейс (CLI + MCP)
flowchart TD
subgraph Clients["Клиенты и Ассистенты"]
Claude["Claude Desktop / Cursor<br/>(клиенты без терминала)"]
Terminal["Antigravity / Claude Code / Терминал<br/>(on-demand агенты)"]
end
subgraph Package["Пакет spruthubctl"]
CLI["CLI & Skill (cli.py)<br/>spruthubctl / sprut<br/>On-Demand (80ms, 0 RAM)"]
MCP["MCP Server (server.py)<br/>spruthub-mcp<br/>Stdio JSON-RPC daemon"]
Core["SprutHubClient<br/>Семантический фасад & нормализация типов"]
end
Hub[("SprutHub Controller<br/>ws://IP/spruthub")]
Terminal -->|uvx / CLI| CLI
Claude -->|MCP Protocol| MCP
CLI --> Core
MCP --> Core
Core -->|Локальный WebSocket| HubИнструменты и команды
(Команда spruthubctl также доступна по короткому алиасу sprut и совместимому spruthub-cli).
Категория | Команда CLI | MCP Tool | Описание |
Хаб и система |
|
| Комплексная сводка: статус хаба, аккаунт, комнаты с устройствами, расширения, статистика. |
|
| Краткая информация о контроллере (имя, модель, серийник, версия ПО, онлайн-статус). | |
|
| Перезагрузка контроллера / службы SprutHub. | |
Комнаты |
|
| Список комнат со сводкой датчиков в реальном времени. |
|
| Создание новой комнаты. | |
|
| Переименование существующей комнаты. | |
|
| Удаление комнаты (с подтверждением). | |
Устройства |
|
| Список устройств и их текущих состояний (с фильтрацией). |
|
| Полная развернутая структура аксессуара (сервисы, характеристики, метаданные). | |
|
| Быстрое включение/выключение любого реле, выключателя, розетки или лампы. | |
|
| Установка любого значения характеристики (яркость, температура, режим). | |
История и датчики |
|
| Выгрузка временных рядов, расчет аналитики (min/max/avg/delta) и дневных сводок. |
Сценарии |
|
| Список настроенных сценариев автоматизации и их статус. |
|
| Запуск сценария автоматизации по имени или индексу. | |
Диагностика |
|
| Просмотр системных логов контроллера и ошибок драйверов. |
|
| Статус всех протокольных расширений (Zigbee, BLE, HomeKit, MQTT и др.). | |
Каталог шаблонов |
|
| Поиск и просмотр шаблонов поддерживаемых устройств в каталоге. |
|
| Получение схемы и маппинга сервисов конкретного шаблона оборудования. |
📖 Полная документация низкоуровневого протокола: docs/SPRUTHUB_API.md — карта всех 18 модулей и 62 RPC-методов ядра SprutHub.
Где взять токен (локальный пароль)?
Всё настраивается за 10 секунд прямо из веб-интерфейса SprutHub:
В браузере откройте веб-интерфейс хаба (
http://<IP_ХАБА>).Перейдите в Настройки → Пользователи → откройте карточку вашего пользователя (Владелец).
Скопируйте значение из поля «Локальный пароль» (при необходимости можно сгенерировать новый кнопкой «Сгенерировать новый пароль»).
Конфигурация
Для работы требуется всего два параметра: IP-адрес (или хост) хаба и локальный пароль.
Конфигурация автоматически определяется по цепочке:
Переменные окружения (
SPRUTHUBCTL_HOST/SPRUTHUB_HOSTиSPRUTHUBCTL_TOKEN/SPRUTHUB_TOKEN).Системный файл конфигурации:
Linux / macOS:
~/.config/spruthubctl/config.json(или~/.config/spruthub/config.json)Windows:
%APPDATA%\spruthubctl\config.json(или%APPDATA%\spruthub\config.json)
Локальный файл
./config.jsonв рабочей директории.
Пример config.json:
{
"host": "192.168.1.100",
"token": "ВАШ_ЛОКАЛЬНЫЙ_ПАРОЛЬ"
}(Также поддерживается указание домена, например "host": "spruthub.local" или полного WebSocket URL, если у вас нестандартный порт или реверс-прокси).
Варианты использования
Режим 1: Skill для Antigravity / Claude Code (Рекомендуется)
Идеальный режим: 0 байт RAM в простое, 0 лишних токенов в контексте.
Ничего вручную копировать не нужно:
uvx --from git+https://github.com/pikerr/spruthubctl spruthubctl install --host 192.168.1.100 --token ВАШ_ПАРОЛЬКоманда автоматически:
Сохранит данные в
~/.config/spruthubctl/config.jsonс правами доступа600.Установит скилл в
~/.gemini/config/skills/spruthub/(и~/.claude/skills/).Проверит соединение с вашим хабом.
После этого агент готов к управлению («выключи свет в спальне», «какая температура в кабинете»).
Режим 2: MCP Server (для Claude Desktop / Cursor)
Автоматическая регистрация (Рекомендуется):
Одной командой зарегистрирует сервер в Claude Desktop и/или Cursor (с сохранением резервной копии старого конфига):
uvx --from git+https://github.com/pikerr/spruthubctl spruthubctl install-mcp --host 192.168.1.100 --token ВАШ_ПАРОЛЬ(Либо передайте флаг --mcp при первой установке: spruthubctl install --mcp, и утилита настроит и Skill, и Claude Desktop сразу).
Ручная настройка:
Если вы предпочитаете прописать конфиг вручную в claude_desktop_config.json:
{
"mcpServers": {
"spruthub": {
"command": "uvx",
"args": ["--from", "git+https://github.com/pikerr/spruthubctl[mcp]", "spruthub-mcp"],
"env": {
"SPRUTHUB_HOST": "192.168.1.100",
"SPRUTHUB_TOKEN": "ВАШ_ЛОКАЛЬНЫЙ_ПАРОЛЬ"
}
}
}
}Лицензия
Available Tools
18 toolssprut_create_roomC
Create a new room in the smart home.
Args: name: Name for the new room.
Inputs: name (required). Returns: result
sprut_delete_roomC
Delete a room from the smart home.
Args: room_id: ID of the room to delete.
Inputs: room_id (required). Returns: result
sprut_get_catalog_templateB
Get full device template and definition from catalog.
Args: file_or_model: Template file path or model name. store: Optional catalog store (default MAIN). controller: Optional controller (e.g. zigbee).
Inputs: file_or_model (required), store, controller. Returns: result
sprut_get_deviceC
Get complete details and all characteristics of a specific accessory.
Args: accessory_id: The ID of the accessory (e.g. 1155).
Inputs: accessory_id (required). Returns: result
sprut_get_historyC
Retrieve historical telemetry data and statistics for sensor or accessory characteristics.
Args: accessory_id: ID of the accessory. service_id: Optional Service ID (sId). characteristic_id: Optional Characteristic ID (cId). days: Optional time window in days (e.g. 7). hours: Optional time window in hours (e.g. 24). limit: Optional maximum number of records to retrieve.
Inputs: accessory_id (required), days, hours, limit, +2 more. Returns: result
sprut_get_hub_infoA
Get general information about the SprutHub controller (name, model, firmware version, online status).
Inputs: no named parameters. Returns: result
sprut_get_logsC
Get recent system and driver logs from SprutHub.
Args: count: Number of log entries to retrieve (default 50). level: Optional filter by log level (e.g. ERROR, WARN, INFO).
Inputs: count, level. Returns: result
sprut_get_summaryB
Get a comprehensive smart home dashboard summary (hub info, users, room counts, device breakdown, extensions, scenarios).
Inputs: no named parameters. Returns: result
sprut_list_catalogA
List or search device templates in the SprutHub catalog.
Args: search: Optional query to search by model or manufacturer (e.g. Aubess, TS000F). limit: Max number of templates to return.
Inputs: limit, search. Returns: result
sprut_list_devicesA
List smart home accessories / devices with their controllable services and current values.
Args: room_id: Optional filter to list devices only in a specific room.
Inputs: room_id. Returns: result
sprut_list_extensionsA
List installed protocols and extensions (Zigbee, BLE, HomeKit, MQTT, etc.) and their status.
Inputs: no named parameters. Returns: result
sprut_list_roomsA
List all rooms in the smart home with their IDs, names, and sensor summary.
Inputs: no named parameters. Returns: result
sprut_list_scenariosA
List all automation scenarios configured in SprutHub.
Inputs: no named parameters. Returns: result
sprut_restart_hubB
Restart the SprutHub controller service.
Inputs: no named parameters. Returns: result
sprut_run_scenarioB
Trigger / execute an automation scenario by index.
Args: index: The index of the scenario (from sprut_list_scenarios).
Inputs: index (required). Returns: result
sprut_set_characteristicC
Set any characteristic on an accessory (brightness, temperature, mode, etc.).
Args: accessory_id: The ID of the accessory. service_id: The ID of the service (sId). characteristic_id: The ID of the characteristic (cId). value: The target value to set (boolean, integer, float, or string).
Inputs: value (required), service_id (required), accessory_id (required), characteristic_id (required). Returns: result
sprut_set_switchB
Turn a switch, light, or relay ON or OFF.
Args: accessory_id: The ID of the accessory (e.g. 1155). on: True to turn ON, False to turn OFF. service_id: Optional service ID if the accessory has multiple switches. If omitted, the first Switch service is used automatically.
Inputs: on (required), accessory_id (required), service_id. Returns: result
sprut_update_roomC
Update or rename an existing room.
Args: room_id: ID of the room to update. name: Optional new name for the room.
Inputs: room_id (required), name. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Most tools target a distinct resource+action (list_rooms, get_device, set_characteristic, restart_hub, etc.), so an agent can pick the right one. Minor overlap exists: sprut_get_summary aggregates hub info, rooms, devices, extensions, and scenarios already covered by dedicated list tools, and sprut_set_switch is a convenience wrapper over sprut_set_characteristic for switch services.
Every tool uses the sprut_ prefix followed by a consistent verb_noun pattern (list_catalog, get_device, set_switch, run_scenario, create_room, update_room, delete_room). Naming is uniform and predictable across the whole set.
18 tools is slightly on the heavy side but each maps to a real smart-home operation, so it is not bloated. It earns most of its places, with only sprut_get_summary arguably redundant against the individual list tools.
Rooms have full CRUD, devices have list/get/set coverage, and telemetry, logs, catalog, scenarios, and extensions are all reachable. Gaps remain around scenario lifecycle (list/run only, no create/update/delete) and extensions (read-only), but agents can cover the core workflows.
Maintenance
Related MCP Connectors
Control your existing Philips lights, Sonos speakers, Roborock vacuums and other supported devices through Port OS cloud. Give ChatGPT, Claude and other MCP-compatible assistants access to the devices you connect. Turn off the living room lights, play music on your speakers, adjust the thermostat, run a vacuum in a room, check a camera snapshot or find a connected tracker. Available actions depend on your linked provider accounts and each device’s supported capabilities. Port OS runs in the cloud; no local server is required. You choose the account, device and capability permissions each assistant receives. Device operations require user OAuth; public tool discovery does not grant device access. Port OS is in alpha. Setup: https://portoperatingsystem.com/docs/getting-started/ Support: https://portoperatingsystem.com/contact/
Control your Tesla from your AI assistant - climate, charging, access, and security.
Home energy for AI assistants: live Power flow, Energy history, solar forecast, and device control.
Control a Loxone Miniserver smart home: lights, blinds, climate, scenes and energy.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Home Assistant smart home devices through natural language. Control devices, manage automations, query entity states, and retrieve historical data across your home automation system.1MIT
- AlicenseNot gradedqualityDmaintenanceConnects AI assistants to Home Assistant, enabling them to discover and control smart home entities, services, areas, devices, and cameras via the Model Context Protocol.4BSD 3-Clause
- AlicenseAqualityDmaintenanceEnables control of Sprut.hub smart home devices through dynamic API discovery and schema validation.359 npm3MIT
- FlicenseNot gradedqualityDmaintenanceEnables LLMs to control Home Assistant devices, including lights, switches, and climate devices, through natural language commands.-