
tdeckers/openhab-mcp
API development이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
An MCP server for OpenHAB
개요
A MCP (Model Context Protocol) server that interacts with a real openHAB instance. 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: - List, get, create, update, and delete items - Update item states - 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 - List, get, create, update, and delete rules - Update rule script actions - Run rules on demand - 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.
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 \