debmatic-mcp

debmatic-mcp

Integrates HomeMatic smart home devices (via CCU3, RaspberryMatic, or debmatic) as MCP tools, enabling natural language query and control of rooms, devices, programs, and system variables.

Category
访问服务器

README

debmatic-mcp

Talk to your HomeMatic smart home from Claude, Cursor, or any MCP client.

debmatic-mcp connects to the CCU's built-in JSON-RPC API and exposes your devices, rooms, programs, and system variables as MCP tools. No addons, no XML-API, no cloud — just a direct connection to the CCU on your local network.

Built for debmatic (HomeMatic on Debian) but works with any CCU3 or RaspberryMatic installation that exposes the standard /api/homematic.cgi endpoint.

What can it do?

Ask your AI assistant things like:

  • "What's the temperature in the bathroom?"
  • "Are any windows open?"
  • "Set the living room heating to 21 degrees"
  • "Show me all devices with low battery"
  • "What's the gas meter reading?"
  • "Which devices have low battery or haven't been seen in a long time?"
  • "Find all channels whose names don't match their device name"
  • "Rename all devices to follow a consistent naming convention with floor labels (UG/OG/EG)"
  • "Which room is the window sensor in?"

The MCP server handles device discovery, type resolution, session management, and value conversion — the AI just calls the tools.

Prerequisites

  • A running HomeMatic CCU (debmatic, CCU3, or RaspberryMatic) reachable on your network
  • The CCU's admin username and password (the same credentials you use to log into the WebUI)
  • Node.js 22+ (for running from source or stdio mode) or Docker

Quick start

export CCU_HOST=your-ccu-hostname-or-ip
export CCU_PASSWORD=your-ccu-admin-password
npx debmatic-mcp --stdio

If it prints server_ready to stderr, it's working. Press Ctrl+C to stop. Now set it up in your MCP client — see below.

Installation

There are two ways to run this: stdio (the server runs as a subprocess of your MCP client) or HTTP (the server runs standalone in Docker and clients connect over the network). Pick one.

Option A: stdio (direct, simplest)

This is the easiest setup. Your MCP client (Claude Code, Cursor, etc.) starts the server as a child process — no Docker, no network config, no auth tokens.

For Claude Code, create a .mcp.json file in your project directory (or any directory where you'll use Claude Code):

{
  "mcpServers": {
    "debmatic": {
      "command": "npx",
      "args": ["debmatic-mcp", "--stdio"],
      "env": {
        "CCU_HOST": "your-ccu-hostname-or-ip",
        "CCU_PASSWORD": "your-ccu-admin-password"
      }
    }
  }
}

Replace your-ccu-hostname-or-ip with your CCU's hostname (like homematic-ccu3) or IP (like 192.168.1.50), and your-ccu-admin-password with the password you use to log into the CCU WebUI.

Restart Claude Code. Run /mcp to check it connected. You should see debmatic in the list.

Alternatively, use the Claude Code CLI:

claude mcp add debmatic -- npx debmatic-mcp --stdio

Option B: Docker (standalone HTTP server)

Use this if you want the server running independently — for example on a home server, accessible to multiple clients, or when your MCP client supports HTTP remotes.

1. Start the container:

docker run -d \
  --name debmatic-mcp \
  -e CCU_HOST=your-ccu-hostname-or-ip \
  -e CCU_PASSWORD=your-ccu-admin-password \
  -v debmatic-data:/data \
  -p 3000:3000 \
  debmatic-mcp

2. Get the auth token. The server generates a random bearer token on first startup and saves it inside the container's data volume. You need this token to authenticate your MCP client. Grab it with:

docker exec debmatic-mcp grep MCP_AUTH_TOKEN /data/.env

This prints something like MCP_AUTH_TOKEN=e96suzi1iG0H-GPif6K2.... The part after = is your token.

3. Configure your MCP client. If your client uses .mcp.json, add the HTTP server:

{
  "mcpServers": {
    "debmatic": {
      "url": "http://your-server-ip:3000",
      "headers": {
        "Authorization": "Bearer PASTE-YOUR-TOKEN-HERE"
      }
    }
  }
}

To inject the token automatically (requires jq):

TOKEN=$(docker exec debmatic-mcp grep MCP_AUTH_TOKEN /data/.env | cut -d= -f2)
jq --arg t "$TOKEN" '.mcpServers.debmatic.headers.Authorization = "Bearer " + $t' .mcp.json > .mcp.json.tmp && mv .mcp.json.tmp .mcp.json

This only updates the debmatic entry — other servers in your .mcp.json are left alone.

4. Check it's healthy:

curl http://localhost:3000/health

HTTPS

If your CCU uses HTTPS (self-signed certificates are fine), add these environment variables:

CCU_HTTPS=true
CCU_PORT=443

The server accepts self-signed certificates automatically.

Configuration

All configuration is via environment variables:

Variable Default Description
CCU_HOST required Hostname or IP of your CCU
CCU_PASSWORD required CCU admin password
CCU_USER Admin CCU username
CCU_PORT 80 API port (443 when using HTTPS)
CCU_HTTPS false Connect via HTTPS (self-signed certs supported)
CCU_TIMEOUT 10000 CCU request timeout in milliseconds
CCU_SCRIPT_TIMEOUT 30000 HM Script execution timeout in milliseconds
LOG_LEVEL info error, warn, info, or debug
CACHE_DIR /data Where to store device type cache and session
CACHE_TTL 86400 Cache lifetime in seconds (24h)

Tools

18 tools organized by what you'd actually want to do:

Find thingslist_devices, list_rooms, list_functions, list_interfaces, list_programs, list_system_variables, describe_device_type

Read stateget_value, get_values (bulk), get_paramset

Change thingsset_value, put_paramset, set_system_variable, execute_program

Check healthget_service_messages, get_system_info

Otherhelp (context-aware), run_script (raw HomeMatic Script for bulk operations, renaming devices/channels, querying room membership, or anything not covered by the other tools)

Most tools auto-resolve the interface and value types from the device address — you don't need to know whether a device is on BidCos-RF or HmIP-RF.

How it works

The server talks to the CCU's JSON-RPC API (the same one the WebUI uses). On startup it:

  1. Logs in and caches the session (reused across restarts)
  2. Loads the device type cache from disk (or warms it in the background)
  3. Starts the MCP server on stdio or HTTP

Device type schemas are cached locally so the AI can look up valid parameters, types, and value ranges without hitting the CCU every time.

Values come back as native types — 21.5 not "21.500000", true not "true".

Tested devices

This has been tested against a production debmatic installation with:

  • HmIP-eTRV-2 / eTRV-2 I9F (radiator thermostats)
  • HmIP-STHD (wall thermostats with humidity)
  • HmIP-WTH-2 (wall thermostats)
  • HmIP-SWDO-I (door/window contacts)
  • HmIP-STHO (outdoor temperature/humidity)
  • HmIP-ESI (energy/gas meter)
  • HmIP-FALMOT-C12 (floor heating controller)
  • HmIP-HEATING (virtual heating groups)
  • HmIP-WRCC2 (wall remote)
  • HM-PB-6-WM55 (BidCos 6-button remote)
  • RPI-RF-MOD (radio module)

Other device types should work too — the server queries the CCU for parameter descriptions rather than maintaining a static device database.

Related projects

  • debmatic — Run HomeMatic on Debian, Ubuntu, Raspberry Pi OS, Armbian
  • OCCU — Open CCU SDK by eQ-3 (the upstream HomeMatic software)
  • RaspberryMatic — HomeMatic on Raspberry Pi
  • MCP — Model Context Protocol specification

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选