
tdeckers/openhab-mcp
API developmentこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
OpenHAB の MCP サーバー
概要
実際の openHAB インスタンスと相互作用する MCP (Model Context Protocol) サーバー。 このプロジェクトでは、REST API を介して、実際の openHAB インスタンスに接続する MCP サーバーの実装を提供しています。 ClaudeやClineなどのAIアシスタントが、あなたのopenHABスマートホームシステムと相互作用することを可能にします。 サーバは、OpenHABのコアコンポーネントへの包括的なアクセスを提供します。 - リスト、取得、作成、更新、削除項目 - 項目の状態を更新する - すべてのものをリスト - 取得、作成、更新、および削除 - Thing の設定を更新 - 設定のステータスを取得する - Thing の有効/無効な状態を設定 - Thing の状態とファームウェア情報の取得 - 利用可能なファームウェアの更新 - リスト、取得、作成、更新、削除ルール - ルールスクリプトのアクションを更新 - ルールをオンデマンドで実行する - リスト、取得、作成、更新、削除スクリプト VSCodeのClaudeまたはClineに接続すると、自然言語を使用して、openHABシステムを制御および管理し、ホームオートメーションをより使いやすく、直観的に行うことができます.
概要(AI 翻訳)
実際の openHAB インスタンスと相互作用する MCP (Model Context Protocol) サーバー。
概要
このプロジェクトでは、REST API を介して、実際の openHAB インスタンスに接続する MCP サーバーの実装を提供しています。 ClaudeやClineなどのAIアシスタントが、あなたのopenHABスマートホームシステムと相互作用することを可能にします。
サーバは、OpenHABのコアコンポーネントへの包括的なアクセスを提供します。
アイテム
- リスト、取得、作成、更新、削除項目
- 項目状態を更新して下さい
物事
- すべてのものをリスト
- 物事の取得、作成、更新、削除
- Thing の設定を更新する
- 設定ステータスの取得
- 有効/無効な状態を設定する
- 現状とファームウェア情報の取得
- 利用可能なファームウェアのアップデートを入手
ルール
- リスト、取得、作成、更新、削除ルール
- ルールスクリプトのアクションを更新する
- 要求のルールを実行
スクリプト
- リスト、取得、作成、更新、削除スクリプト
VSCodeのClaudeまたはClineに接続すると、自然言語を使用して、openHABシステムを制御および管理し、ホームオートメーションをより使いやすく、直観的に行うことができます。
要件
- Python 3.7 +
クイックスタート(完成イメージ)
GitHubコンテナレジストリ(`ghcr)に公式画像が公開されました.
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
OpenHAB MCP Server
A MCP (Model Context Protocol) server that interacts with a real openHAB instance.
Overview
This project provides an implementation of an MCP server that connects to a real openHAB instance via its REST API. It enables AI assistants like Claude and Cline to interact with your openHAB smart home system.
The server provides comprehensive access to openHAB’s core components:
Items
- List, get, create, update, and delete items
- Update item states
Things
- List all things
- Get, create, update, and delete things
- Update thing configurations
- Get thing configuration status
- Set thing enabled/disabled status
- Get thing status and firmware information
- Get available firmware updates
Rules
- List, get, create, update, and delete rules
- Update rule script actions
- Run rules on demand
Scripts
- List, get, create, update, and delete scripts
When connected to Claude or Cline in VSCode, you can use natural language to control and manage your openHAB system, making home automation more accessible and intuitive.
Requirements
- Python 3.7+
Quick Start (prebuilt image)
The official image is published to the GitHub Container Registry (ghcr.io/tdeckers/openhab-mcp). Pulling this image is the fastest way to get the MCP server running.
By default the server uses stdio for MCP. For remote HTTP clients, set MCP_MODE=remote to expose both Streamable HTTP at http://HOST:PORT/mcp and SSE at http://HOST:PORT/sse from the same container. The container examples below use remote mode; for stdio, omit MCP_MODE and the port mapping. Streamable HTTP supports session headers like Mcp-Session-Id for stateful clients.
-
(Optional for private registries) Authenticate with GHCR:
podman login ghcr.io # or: docker login ghcr.io -
Run the container with Podman (add
-e OPENHAB_USERNAME=...and-e OPENHAB_PASSWORD=...if your OpenHAB instance requires basic authentication):podman run -d --rm -p 8081:8000 \ -e MCP_MODE=remote \ -e OPENHAB_URL=http://your-openhab-host:8080 \ -e OPENHAB_API_TOKEN=your-api-token \ --name openhab-mcp \ ghcr.io/tdeckers/openhab-mcp:latestUsing Docker instead?
docker run -d --rm -p 8081:8000 \ -e MCP_MODE=remote \ -e OPENHAB_URL=http://your-openhab-host:8080 \ -e OPENHAB_API_TOKEN=your-api-token \ --name openhab-mcp \ ghcr.io/tdeckers/openhab-mcp:latest -
Stop the container when you are done:
podman stop openhab-mcp # or: docker stop openhab-mcp
When running with MCP_MODE=remote, the container listens on port 8000 internally, but the examples map it to port 8081 on the host to avoid conflicts with an existing OpenHAB installation. Streamable HTTP clients connect to http://HOST:PORT/mcp, while SSE clients connect to http://HOST:PORT/sse.
Optional: Build and run a custom image
インストール
docker run -d --rm -p 8081:8000 \