[Showcase] OpenHAB MCP Server (v1.2.0) - The "Agentic" Extension for AI Assistants

Hi everyone,

I’ve been working on a Model Context Protocol (MCP) server for OpenHAB that goes beyond basic REST API exposure. I created this because I couldn’t find any other MCP implementations that offered the “agentic” capabilities needed for high-level AI assistance.

While other MCPs pipe the API through, this version is designed to let an AI assistant perform complex, autonomous tasks—like rebuilding your entire Semantic Model, converting legacy Sitemaps to modern MainUI, and performing deep-dive forensic troubleshooting that would otherwise take hours of manual effort.

:high_voltage: Performance & Token Efficiency

Speed and efficiency were a major focus in this implementation:

  • Parallel Execution: Uses execute_batch to fire multiple commands simultaneously, drastically reducing the “latency drag” of sequential AI actions.

  • Token-Optimized Summaries: Instead of the AI reading your entire item list (which can blow through context windows), tools like get_system_summary and summarize_persistence_range deliver high-density data that uses ~90% fewer tokens.

  • API Caching: Built-in TTL caching ensures that repeated AI queries for things or items are served instantly without hitting the OpenHAB REST API every time.

Full Capability List (84 Tools)

I’ve categorized the tools below. The “Mastery” tools are highlighted at the top as they are the ones that really empower an AI agent to manage your home autonomously.

:brain: Mastery & Agentic Intelligence

  • get_system_summary: High-density overview of items, things, rooms, and health.

  • shadow_run: Virtual simulation of command sequences.

  • simulate_system_state: Predict outcome including rule triggers for a single command.

  • explain_item_state: Forensic review of item history, hardware links, and rule influence.

  • create_equipment_from_thing: Rapidly generates semantic hierarchy from hardware.

  • audit_semantic_model: Structural audit for loose items or misaligned tags.

  • find_orphans_and_broken_links: Scans for dead links and missing semantics.

  • analyze_system_health: Proactive scan for OFFLINE nodes and battery issues.

  • predictive_rule_generator: Intent-to-JS rule generation.

  • get_visual_chart: ASCII sparkline trend analysis.

  • calculate_energy_insights: Power/efficiency consumption reporting.

  • bulk_item_remediation: Mass-update tags, categories, and groups.

  • discover_automation_patterns: Finds temporal correlations for automation ideas.

  • standardize_naming_convention: Proposes unified semantic naming formats.

  • optimize_persistence_strategy: Performance recommendations for DB bloat.

  • summarize_persistence_range: Statistical persistence summaries to save tokens.

  • optimize_mcp_focus: Lock the AI’s “vision” to a specific room or group.

  • generate_home_blueprint: Creates a full Markdown manual of your setup.

  • audit_system_safety: Security audit for locks and alarms.

  • get_mcp_health & get_mcp_capabilities: Real-time server metrics and feature status.

:package: Items & Semantic Model

  • get_items / get_item: Retrieval with advanced filtering.

  • send_command / update_state: The core control loop.

  • create_or_update_item / delete_item: Full managed-mode lifecycle.

  • add_tag / remove_tag: Dynamic semantic tagging.

  • set_metadata / remove_metadata: Namespace management.

  • get_room_status: Concise occupancy/device summary by room.

  • find_equipment_by_type: Spatial queries (e.g., “all lights in the kitchen”).

  • get_item_statistics: Persistence analysis (peaks, duty cycles).

  • search_items: Fuzzy search across names and labels.

  • get_schema: Zero-token name/type mapping.

  • suggest_semantic_tags: AI-driven tagging suggestions.

:gear: Things, Channels & Links

  • get_things / get_thing: Hardware layer inspection.

  • create_thing / update_thing / delete_thing: Lifecycle management.

  • enable_thing / get_thing_status: Real-time node monitoring.

  • update_thing_config: Remote parameter adjustment.

  • get_links / link_item_to_channel / unlink_item_from_channel: The bridge between hardware and logic.

  • configure_link_profile: Advanced link behaviors (Follow, Offset, Transform).

:scroll: Rules & Automation

  • get_rules / get_rule: Logic layer inspection.

  • create_rule / update_rule / delete_rule: Scripts and triggers.

  • run_rule / enable_rule: Manual execution and logic toggle.

  • detect_rule_conflicts: Race condition and logic collision detection.

  • validate_rule_logic: Pre-flight syntax and safety (loop) check.

:bar_chart: Persistence & Historian

  • get_persistence_services: View active DB connectors.

  • get_item_persistence_data: Raw value retrieval.

  • store_item_persistence_data: Manual state injection.

:speaker_high_volume: Media, Voice & Habot

  • control_media: Context-aware Play/Pause/Volume controls.

  • voice_say: TTS announcement system.

  • voice_interpret: OpenHAB native NLP interpreter.

  • get_voices / get_audio_sinks / get_audio_sources: Hardware audio routing.

  • chat_with_habot: Direct link to the official Habot assistant.

:hammer_and_wrench: System, Sitemaps & UI

  • get_inbox / approve_inbox_item / ignore_inbox_item: Discovery management.

  • get_addons / install_addon / uninstall_addon: Extension management.

  • get_system_info / get_loggers / set_logger_level: Diagnostic control.

  • get_services / get_service_config / update_service_config: System-wide settings.

  • get_sitemaps / sitemap_to_main_ui: Legacy migration tools.

  • generate_ui_widget: Professional MainUI YAML generation.

  • generate_topology: Mermaid graph spatial visualization.

  • get_recent_logs: Real-time log buffer (tail) for the AI.

Getting Started

It is a standard Node.js MCP server.

Latest Release: Release v1.2.0: Community Enhancements · deswong/Openhab-MCP · GitHub

Repository: deswong/Openhab-MCP

Quick Setup:

  1. Clone the repo and npm install && npm run build.

  2. Configure your OPENHAB_URL and OPENHAB_API_TOKEN.

  3. Add it to your MCP client (Claude Desktop, Roo Code, Cline, etc.).

Detailed instructions are in the README.

I’d love to get some feedback if you find this useful and let me know if you come across issues.

Cheers,

Des

10 Likes

Looks nice, I installed it in Claude Code. It is sometimes failing to authenticate. Other calls succeed though.

● openhab - get_things (MCP)
  ⎿  Error: Error executing tool get_things: OpenHAB API Error: 401 - {"error":{"message":"Authentication required","http-code":401}}
● openhab - get_schema (MCP)
  ⎿  [
       {
         "name": "FrontDoorLight",
     … +196 lines (ctrl+o to expand)

● openhab - search_items (MCP)(query: "zwave")
  ⎿  []

● openhab - get_system_summary (MCP)
  ⎿  Error: Error executing tool get_system_summary: OpenHAB API Error: 401 - {"error":{"message":"Authentication required","http-code":401}}

1 Like

… that sounds cool. Do you have a docker container for the MCP Server too?

This is a very comprehensive solution. I’m especially interested in the more advanced tools and will definitely give this a try! Thank you for this contribution.

I think I have isolated this issue.

There is a limit to the tools that can be used with Claude Code, so I have started refactoring the tools down to logical blocks, rather than what I have done and created a tool for each function I was looking for. This will hopefully resolve the issue and I will do more testing today to ensure that the code isn’t broken.

I haven’t thought of a docker at this point, as I run this on the machine I have antigravity on.

Once I resolve the issue with the other agents having limits and issues with using the MCP, I will look into this and see how complex/easy it would be to build a pipeline for this.

Thank you for your encouragement!

It definitely has been a learning and challenge, I have actually used yours in the past which has worked well.

I’m still on my “L” plates for MCP stuff, and finding that even though I have a MCP, the actual agents themselves sometimes don’t really do what I want, so I have tried to put into the code enough hints for the agent to go and do it a certain way, and also trying to make it a lot faster and efficient to pull data from Openhab and not use up a zillion tokens in the agent doing the interaction.

1 Like